fix(ddtrace/tracer): prioritize user-provided settings for dogstatsd addr#4575
fix(ddtrace/tracer): prioritize user-provided settings for dogstatsd addr#4575rarguelloF wants to merge 5 commits intomainfrom
Conversation
|
✅ Tests 🎉 All green!❄️ No new flaky tests detected 🎯 Code Coverage (details) 🔗 Commit SHA: 4d40658 | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback! |
BenchmarksBenchmark execution time: 2026-03-26 12:05:07 Comparing candidate commit 4d40658 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 215 metrics, 9 unstable metrics.
|
|
Assigning myself and @mtoffl01 because there were also recent changes touched by us. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files
🚀 New features to boost your workflow:
|
|
Pinging @mtoffl01 one last time :) |
mtoffl01
left a comment
There was a problem hiding this comment.
Hmm.. the calls to env.Get("...")...
This is the old way of assuming a configuration can only be set by env var, and later overwritten by programmatic API.
I'd request that for any env var that is already supported in ddtrace/internal/config, get its resolved value from tracer.config.internalConfig instead; for env vars that are not yet supported on that config, it'd be nice if you could add them there, but I guess I won't block this PR on that.
|
@mtoffl01 Thanks for the review! I’d prefer to keep this PR focused on fixing the current behavior in main. Right now main reads these configs using the env package: dd-trace-go/ddtrace/tracer/option.go Lines 591 to 608 in aca1a62 Would it be ok to handle these additional changes in a follow-up PR? I think they’re a bit out of scope for this one. |
mtoffl01
left a comment
There was a problem hiding this comment.
Approved! config migration can happen in a future PR.
What does this PR do?
Rewrites
resolveDogstatsdAddrto follow a clear, well-defined priority order:DD_DOGSTATSD_HOST,DD_DOGSTATSD_PORT).DD_AGENT_HOST>localhostis used as a host fallback only when the port is provided and not the host. The agent-reported port >8125is used as a fallback when the host is provided but not the port./var/run/datadog/dsd.socket), then agent-reported port, thenlocalhost:8125.DD_AGENT_HOSTis used as the hostname when available.Motivation
Fix #4518
Reviewer's Checklist
make lintlocally.make testlocally.make generatelocally.make fix-moduleslocally.Unsure? Have a question? Request a review!