-
Notifications
You must be signed in to change notification settings - Fork 375
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
Add:HTTP header tagging with DD_TRACE_HEADER_TAGS for clients #2946
Conversation
Codecov Report
@@ Coverage Diff @@
## DD_TRACE_HEADER_TAGS #2946 +/- ##
======================================================
Coverage 98.09% 98.10%
======================================================
Files 1305 1305
Lines 72808 72938 +130
Branches 3375 3379 +4
======================================================
+ Hits 71423 71554 +131
+ Misses 1385 1384 -1
... and 2 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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.
code LGTM. We need to make sure to fix system test failure on #2935 before merging both in master
@GustavoCaso @lloeki, regrading the system-test failure in this PR, the issue is that we perform HTTP header tagging for dd-trace-rb/lib/datadog/appsec/event.rb Line 64 in c0fc32e
sinatra.request does not receive these tags.
And because Weblog variants have the environment variable The issue happens because This causes the test assertion to fail because the remaining expected headers ( I'm not too sure how this was working before, but I don't see where we could be setting all the 3 tags in all spans generated by this Weblog test run. For reference, this is the stdout with the spans that are failing for this test (test name
A few solutions
None seem too clean, to be honest. |
@marcotc Thanks so much for the detailed information on the current issue with the system test I have a few questions:
How would that solve the issue? What is the underlying thing that happens underneath would make the test pass?
It might be risky, since this is affecting all languages, but it might be worth a try. Since we want the span with Alternatively, if we see ourselves blocked by this, we could skip the test until we have a better solution. |
Opened a system-tests PR for this issue^: DataDog/system-tests#1430 |
I recommend reviewing #2935 before this one, as most of the context is in there.
What does this PR do?
As a follow up to #2935, this PR adds the ability for clients to save the value of HTTP clients in their application's HTTP clients as span tags by configuring the
DD_TRACE_HEADER_TAGS
environment variable.Motivation
This PR brings HTTP clients on par with HTTP servers, which are configurable through
DD_TRACE_HEADER_TAGS
since #2935.Also, as soon as Remote Configure is available for Ruby Tracing, this configuration will be configurable remotely.
Additional Notes
How to test the change?
The test suite of each affected HTTP client has been modified to cover this new use case.
Running their test suites cover all changes in this PR.