fix(ddtrace/tracer): honor DD_DOGSTATSD_PORT over agent StatsD port#4564
Closed
SergioChan wants to merge 1 commit intoDataDog:mainfrom
Closed
fix(ddtrace/tracer): honor DD_DOGSTATSD_PORT over agent StatsD port#4564SergioChan wants to merge 1 commit intoDataDog:mainfrom
SergioChan wants to merge 1 commit intoDataDog:mainfrom
Conversation
Contributor
|
@SergioChan thanks so much for the PR! Sorry it took a little bit longer than expected, but fixing this issue was already in our radar. I went ahead and did a deeper refactor so all the user provided configuration ( |
Author
|
Thanks for the update and for linking #4575. Since that broader refactor covers this issue path, I’m closing this PR to avoid duplicate work. |
Author
|
Closing as superseded by #4575, which applies the user-provided DogStatsD config precedence more comprehensively. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
resolveDogstatsdAddrso an explicitly configuredDD_DOGSTATSD_PORTis preserved instead of being overwritten by the agent-reported StatsD port.DD_DOGSTATSD_PORTis not set.TestTracerOptionsDefaults/dogstatsdexpectations forenv-portandenv-allto match the new precedence.WithDogstatsdAddrdocs to reflect the new precedence rule.Motivation
Issue #4518 reports that
DD_DOGSTATSD_PORTis ignored when the agent reports a port, which prevents users from enforcing a different exposed DogStatsD port.This change gives precedence to explicit
DD_DOGSTATSD_PORTconfiguration while keeping the agent-reported port behavior as the default fallback.Fixes #4518
Validation:
go test ./ddtrace/tracer -run "dogstatsd/env-(port|all)$" -count=1option_test.go/writer_test.goreferencing removed config fields likeagentURL/traceProtocol).Reviewer's Checklist
make lintlocally.make testlocally.make generatelocally.make fix-moduleslocally.