Skip to content

fix(internal/config): accept udp:// in DD_DOGSTATSD_URL - #5587

Open
kjvalencik wants to merge 1 commit into
DataDog:mainfrom
kjvalencik:kj/dogstatsd-url-udp-scheme
Open

kjvalencik wants to merge 1 commit into
DataDog:mainfrom
kjvalencik:kj/dogstatsd-url-udp-scheme

Conversation

@kjvalencik

Copy link
Copy Markdown

What does this PR do?

parseDogstatsdAddr now accepts udp://host[:port]. It turns the value into the host:port form internal/config uses. It matches the default host and port behavior of datadog-go.

Additionally, it fixes comments that called the scheme-less host:port form "TCP". datadog-go sends it over UDP.

Motivation

Since #4796 (first released in v2.10.0, still present in v2.11.2), the tracer reads DD_DOGSTATSD_URL. The parser only recognized unix://. Any other value was used as the host verbatim. So the form datadog-go documents for this variable fails:

DD_DOGSTATSD_URL=udp://127.0.0.1:8125
→ DogstatsdAddr() == "udp://127.0.0.1:8125"
→ statsd.NewDirect: address udp://127.0.0.1:8125: too many colons in address

The tracer logs Runtime and health metrics disabled: … and continues with a no-op statsd client. Contrib statsd clients fail the same way. So there are no datadog.tracer.* health metrics, no runtime metrics, and no contrib metrics.

Reviewer's Checklist

  • Changed code has unit tests for its functionality at or near 100% coverage.
  • System-Tests covering this feature have been added and enabled with the va.b.c-dev version tag. (N/A: config parsing fix)
  • There is a benchmark for any new code, or changes to existing code. (N/A: startup-time parsing only)
  • If this interacts with the agent in a new way, a system test has been added. (N/A)
  • New code is free of linting errors. You can check this by running make lint locally. (golangci-lint run ./internal/config/... clean, make lint/errlog analyzers clean on internal/config)
  • New code doesn't break existing tests. You can check this by running make test locally. (Ran go test ./... on the root module, the make test/unit equivalent, all passing. Integration and contrib suites not run locally.)
  • Add an appropriate team label so this PR gets put in the right place for the release notes.
  • All generated files are up to date. You can check this by running make generate locally. (N/A: no generated files touched)
  • Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild. Make sure all nested modules are up to date by running make fix-modules locally. (N/A: no go.mod changes)

@kjvalencik
kjvalencik requested a review from a team as a code owner October 14, 2026 12:00
@kjvalencik
kjvalencik requested review from anna-git and removed request for a team October 14, 2026 12:00
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-14T12:05:57.390122Z 5c45c0d PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Using DD_DOGSTATSD_URL=udp://host:port reached the statsd client verbatim and failed to parse with "too many colons in  address." This form is already established and documented by datadog-go. These changes match the behavior along with default hostname and port.

parseDogstatsdAddr only recognized unix:// and otherwise used the value
verbatim as the host, so DD_DOGSTATSD_URL=udp://host:port reached the
statsd client as "udp://host:port" and failed with "too many colons in
address". The tracer then ran without a statsd client, dropping its
runtime, health and contrib metrics.

udp:// is the form datadog-go documents for DD_DOGSTATSD_URL. Parse it
to host:port, defaulting the port to 8125 as datadog-go does. The same
parser backs WithDogstatsdAddr, so that option accepts udp:// too.

Also fix comments that called the scheme-less host:port form TCP;
datadog-go sends it over UDP.
@kjvalencik
kjvalencik force-pushed the kj/dogstatsd-url-udp-scheme branch from 5c45c0d to 80bdccd Compare October 14, 2026 12:01

@anna-git anna-git left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks

@dd-octo-sts dd-octo-sts Bot mentioned this pull request Oct 29, 2026
@darccio

darccio commented Nov 9, 2026

Copy link
Copy Markdown
Member

/gardener shadow

@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Pipelines

❌ Errors

Your PR has failed checks. Please review the issues below and take necessary action before merging.

🚦 13 Pipeline jobs failed

Orchestrion | Integration Test (ubuntu | stable | DRIVER) — 🔄 Retry may pass, looks flaky

View more details · View in GitHub Actions

Pull Request Tests | multios-unit-tests (macos-latest, 1.27) / test-multi-os — 🔄 Retry may pass, looks flaky

View more details · View in GitHub Actions

Check Pull Request CI Status | all-jobs-are-green

View more details · View in GitHub Actions

View all 13 failed jobs.

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 80bdccd | Docs | View more details | Give us feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants