1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
#!/usr/bin/env bash
set -xeuo pipefail
IFS=$'\n\t'
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "${SCRIPT_DIR}"
docker run -d --name dd-agent \
-v /var/run/docker.sock:/var/run/docker.sock:ro \
-v /proc/:/host/proc/:ro \
-v /sys/fs/cgroup/:/host/sys/fs/cgroup:ro \
-e "DD_API_KEY=${DD_API_KEY}" \
-e DD_DOGSTATSD_NON_LOCAL_TRAFFIC=true \
-e DD_APM_ENABLED=true \
-p 8125:8125/udp \
-p 8126:8126 \
datadog/agent:latest
function finish {
docker rm -f dd-agent || true
}
trap finish EXIT
export GO111MODULE=off
go build \
-tags "tracer_static tracer_static_datadog" \
router.go
GITLAB_TRACING=opentracing://datadog \
./router
|