-
Notifications
You must be signed in to change notification settings - Fork 150
Clean up header when tracing is disabled #7367
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
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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.
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.
This is nice in theory, but it could run into potential issues 🤔 e.g. there are often nested handlers, and if we remove this header from the first one, the innermost handler may create a span 🤔 I think instead we may need to implement the "black hole" span approach which has been discussed a few times, but which is non-trivial to implement at the moment 🤔
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.
Ok! Was worth a shot. I can close this out for now. But before I do...
Do you have any recommendations for folks in my position? I've tried delegating handlers as the PrimaryHttpMessageHandler, HttpClientHandler, but the headers are still present. I'd really like to have tracing enabled for my other services and the one I'm trying to instrument is a bit of a monolith, so there are a lot of other http requests coming in and out of it.
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.
Unfortunately, currently, the tracing (span generation) of HttpClient spans is tied to propagation. Assuming you do want to see spans for the requests, you just don't want to include the headers in the outgoing request, I think there's currently only one avenue:
DD_TRACE_HTTP_CLIENT_EXCLUDED_URL_SUBSTRINGS
, e.g.DD_TRACE_HTTP_CLIENT_EXCLUDED_URL_SUBSTRINGS=some.domain.com,some.other.domain/and/path
.HttpClient
requests to emulate the span that you would have got.The need to use the manual span is obviously a bit hacky, but I think it's the only real workaround available at the moment. Hope that helps, and we'll bear this request in mind as a possible new feature in the future, thanks!
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.
DD_TRACE_HTTP_CLIENT_EXCLUDED_URL_SUBSTRINGS
is exactly what I needed! Totally worked. Didn't know that existed, for what it's worth, but I see it in the code now. Thanks a ton!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.
Cool, glad that solved your issue 🙂