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

w3c(phase 3): ensure tracecontext headers always take precedence #2667

Merged
merged 14 commits into from
May 31, 2024

Conversation

mabdinur
Copy link
Contributor

Description

Ensures when trace headers with the same trace_id but different span_ids are received by an application the tracecontext headers are treated as the source of truth.

The traceparent header will be used to set the parent_id
If the conflicting trace information was extracted from datadog headers, the span_id from the datadog headers will be stored in the _dd.parent_id parent_id tag.
All other propagation styles are third class citizens. If they conflict with tracecontext headers their span_ids will be overwritten.
This behavior will be validated by the following system-tests: DataDog/system-tests#2385

Reviewer checklist

  • Test coverage seems ok.
  • Appropriate labels assigned.

@mabdinur mabdinur requested a review from bwoebi May 20, 2024 16:57
@codecov-commenter
Copy link

codecov-commenter commented May 20, 2024

Codecov Report

Attention: Patch coverage is 80.00000% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 77.79%. Comparing base (92560fa) to head (17dfb2c).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #2667   +/-   ##
=========================================
  Coverage     77.78%   77.79%           
  Complexity     2223     2223           
=========================================
  Files           226      226           
  Lines         26347    26357   +10     
  Branches        988      988           
=========================================
+ Hits          20495    20505   +10     
  Misses         5326     5326           
  Partials        526      526           
Flag Coverage Δ
appsec-extension 69.13% <ø> (ø)
tracer-extension 78.66% <80.00%> (+0.01%) ⬆️
tracer-php 80.33% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
ext/distributed_tracing_headers.c 84.63% <80.00%> (+0.17%) ⬆️

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 92560fa...17dfb2c. Read the comment docs.

@mabdinur mabdinur force-pushed the munir-w3c-phase3 branch 2 times, most recently from fa5b378 to cc73685 Compare May 20, 2024 17:42
…ng spans

fix condition

Update ext/distributed_tracing_headers.c
@pr-commenter
Copy link

pr-commenter bot commented May 21, 2024

Benchmarks

Benchmark execution time: 2024-05-31 21:20:05

Comparing candidate commit 17dfb2c in PR branch munir-w3c-phase3 with baseline commit 92560fa in branch master.

Found 3 performance improvements and 1 performance regressions! Performance is the same for 174 metrics, 0 unstable metrics.

scenario:EmptyFileBench/benchEmptyFileBaseline-opcache

  • 🟥 execution_time [+79.829µs; +203.211µs] or [+3.242%; +8.254%]

scenario:PDOBench/benchPDOBaseline

  • 🟩 execution_time [-20.127µs; -16.833µs] or [-10.515%; -8.794%]

scenario:PDOBench/benchPDOOverhead

  • 🟩 execution_time [-17.605µs; -13.760µs] or [-6.147%; -4.804%]

scenario:PDOBench/benchPDOOverheadWithDBM

  • 🟩 execution_time [-18.892µs; -16.870µs] or [-6.057%; -5.409%]

mabdinur and others added 2 commits May 24, 2024 14:50
Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
@mabdinur mabdinur marked this pull request as ready for review May 31, 2024 17:30
@mabdinur mabdinur requested a review from a team as a code owner May 31, 2024 17:30
@mabdinur mabdinur force-pushed the munir-w3c-phase3 branch 2 times, most recently from b639b8c to ac29ce9 Compare May 31, 2024 18:27
Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
Copy link
Collaborator

@bwoebi bwoebi left a comment

Choose a reason for hiding this comment

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

Looks good now :-)

Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
@bwoebi bwoebi requested review from a team as code owners May 31, 2024 21:24
@bwoebi bwoebi merged commit 44945bb into master May 31, 2024
10 of 13 checks passed
@bwoebi bwoebi deleted the munir-w3c-phase3 branch May 31, 2024 21:25
@github-actions github-actions bot added profiling Relates to the Continuous Profiler tracing area:asm labels May 31, 2024
@github-actions github-actions bot added this to the 1.1.0 milestone May 31, 2024
@bwoebi bwoebi modified the milestones: 1.1.0, 1.0.0 Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:asm profiling Relates to the Continuous Profiler tracing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants