-
Notifications
You must be signed in to change notification settings - Fork 445
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(ddtrace/tracer): ignore agent-provided TCP port when using a UDS w/ WithDogstatsdAddress #2985
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thank you for handling this!
BenchmarksBenchmark execution time: 2024-11-22 14:07:01 Comparing candidate commit 3e7b5f7 in PR branch Found 1 performance improvements and 1 performance regressions! Performance is the same for 57 metrics, 0 unstable metrics. scenario:BenchmarkHttpServeTrace-24
scenario:BenchmarkSetTagMetric-24
|
assert.Equal(t, "localhost:8125", c.dogstatsdAddr) | ||
assert.Equal(t, "localhost:8125", globalconfig.DogstatsdAddr()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume we expect localhost:8125 because that would be what's reported by the agent by default. But I imagine loadAgentFeatures isn't returning any data because we don't test with an agent here right?
Maybe we can test this by setting c.agent.StatsdPort
directly to 8125, and confirm that this value is used over the user-defined one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mtoffl01 I think that wouldn't test the code as it'll run in the wild. It's better to test with the zero value, as it means it's meaningful (falling back to 8125).
For instance, smoke-tests
are red because they are running on the tip of main
, and it behaves in a different way. By setting the value manually in c.agent.StatsdPort
we could miss hidden behaviours like this. It was a head-scratcher but I'm glad it happened once I realized it was using main
.
Co-authored-by: Mikayla Toffler <[email protected]>
What does this PR do?
Fixes a corner case involving using a Unix Domain Socket path as address in
WithDogstatsdAddress
, as it was being ignored by the tracer as it tried to respect the TCP port informed by the agent. This leads to a situation where runtime and tracer health metrics are disabled.Motivation
Ensure that runtime and tracer health metrics work in all the scenarios.
Reviewer's Checklist
Unsure? Have a question? Request a review!