diff --git a/ddtrace/tracer/option.go b/ddtrace/tracer/option.go index 28e1f421ed..067d6a3827 100644 --- a/ddtrace/tracer/option.go +++ b/ddtrace/tracer/option.go @@ -637,9 +637,12 @@ func WithRuntimeMetrics() StartOption { } } -// WithDogstatsdAddress specifies the address to connect to for sending metrics -// to the Datadog Agent. If not set, it defaults to "localhost:8125" or to the -// combination of the environment variables DD_AGENT_HOST and DD_DOGSTATSD_PORT. +// WithDogstatsdAddress specifies the address to connect to for sending metrics to the Datadog +// Agent. It should be a "host:port" string, or the path to a unix domain socket.If not set, it +// attempts to determine the address of the statsd service according to the following rules: +// 1. Look for /var/run/datadog/dsd.socket and use it if present. IF NOT, continue to #2. +// 2. The host is determined by DD_AGENT_HOST, and defaults to "localhost" +// 3. The port is retrieved from the agent. If not present, it is determined by DD_DOGSTATSD_PORT, and defaults to 8125 // This option is in effect when WithRuntimeMetrics is enabled. func WithDogstatsdAddress(addr string) StartOption { return func(cfg *config) {