Skip to content
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

Trace Tags Propagation in Distributed Traces #2260

Merged
merged 39 commits into from
Nov 8, 2022
Merged

Conversation

marcotc
Copy link
Member

@marcotc marcotc commented Sep 7, 2022

This implements the propagation of Datadog-specific trace tags across a distributed trace's lifecycle.

Trace tags starting with the string _dd.p. are considered Datadog distributed tags, are are propagated through the new x-datadog-tags header.

The x-datadog-tags header is consumed from upstream calls, if present, and inject into downstream calls when present.

The first value for a distributed tag is _dd.p.dm: Sampling Decision Maker. This tag represents what mechanism was used to make a sampling decision.

When the sampling decision comes from an upstream context, ddtrace propagates that value downstream, as well as setting it as a trace-level tag. This tag will be flushed with trace payload.

When the sampling decision is made in the instrumented Ruby application, the value of _dd.p.dm is populated locally and propagated downstream.

@marcotc marcotc added the feature Involves a product feature label Sep 7, 2022
@marcotc marcotc self-assigned this Sep 7, 2022
@github-actions github-actions bot added core Involves Datadog core libraries tracing labels Oct 7, 2022
@codecov-commenter
Copy link

codecov-commenter commented Oct 7, 2022

Codecov Report

Merging #2260 (f58ccad) into master (f4791d1) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff            @@
##           master    #2260    +/-   ##
========================================
  Coverage   98.33%   98.33%            
========================================
  Files        1100     1102     +2     
  Lines       58334    58613   +279     
========================================
+ Hits        57361    57638   +277     
- Misses        973      975     +2     
Impacted Files Coverage Δ
lib/datadog/tracing/propagation/http.rb 100.00% <ø> (ø)
lib/datadog/core/configuration/settings.rb 97.47% <100.00%> (+0.03%) ⬆️
lib/datadog/tracing/configuration/ext.rb 100.00% <100.00%> (ø)
.../datadog/tracing/distributed/datadog_tags_codec.rb 100.00% <100.00%> (ø)
lib/datadog/tracing/distributed/headers/datadog.rb 100.00% <100.00%> (ø)
lib/datadog/tracing/distributed/headers/ext.rb 100.00% <100.00%> (ø)
lib/datadog/tracing/metadata/ext.rb 100.00% <100.00%> (ø)
lib/datadog/tracing/trace_digest.rb 100.00% <100.00%> (ø)
lib/datadog/tracing/trace_operation.rb 98.87% <100.00%> (+0.01%) ⬆️
lib/datadog/tracing/tracer.rb 95.29% <100.00%> (+0.02%) ⬆️
... and 11 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@github-actions github-actions bot added appsec Application Security monitoring product integrations Involves tracing integrations labels Nov 7, 2022
@marcotc marcotc changed the title WIP:Sampling Propagation Trace Tags Propagation in Distributed Traces Nov 7, 2022
@marcotc marcotc marked this pull request as ready for review November 7, 2022 23:21
@marcotc marcotc requested a review from a team November 7, 2022 23:21
@marcotc marcotc removed appsec Application Security monitoring product integrations Involves tracing integrations labels Nov 7, 2022
Copy link
Contributor

@delner delner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty big, but good to see this ready to go! Thanks for your hard work, and patience with reviews on this one.

If you think it would be helpful, I would encourage sanity-testing a pre-release build in some kind of controlled environment. But that shouldn't block a merge at this point.

@github-actions github-actions bot added appsec Application Security monitoring product integrations Involves tracing integrations labels Nov 8, 2022
@marcotc marcotc merged commit af16512 into master Nov 8, 2022
@marcotc marcotc deleted the feat-Sampling-Propagation branch November 8, 2022 20:38
@github-actions github-actions bot added this to the 1.6.0 milestone Nov 8, 2022
@TonyCTHsu TonyCTHsu mentioned this pull request Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
appsec Application Security monitoring product core Involves Datadog core libraries feature Involves a product feature integrations Involves tracing integrations tracing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants