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

chore(w3c): ensure last parent id is never set to 16 zeros #2808

Merged
merged 2 commits into from
Aug 8, 2024

Conversation

mabdinur
Copy link
Contributor

@mabdinur mabdinur commented Aug 6, 2024

What does this PR do?

Currently when w3c tracestate headers are extracted by Datadog W3C Propagators:

  1. The p value in the tracestate is stored in SpanContext.reparentID.
  2. If the p value is not found in the tracestate then SpanContext.reparentID (which will be used to set Span.meta["_dd.parent_id"]) is set to 0000000000000000.

The second condition is no longer required. Datadog internal services no longer handle the case where Span.meta["_dd.parent_id"] == 0000000000000000. 0000000000000000 is treated as an invalid value and ignored. We should avoid setting this value in client libraries.

Motivation

  • Simplify the extraction logic for w3c tracecontext headers.
  • Avoids unnecessary tags to the Datadog agent.

Reviewer's Checklist

  • Changed code has unit tests for its functionality at or near 100% coverage.
  • System-Tests covering this feature have been added and enabled with the va.b.c-dev version tag.
  • There is a benchmark for any new code, or changes to existing code.
  • If this interacts with the agent in a new way, a system test has been added.
  • Add an appropriate team label so this PR gets put in the right place for the release notes.
  • Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild.

Unsure? Have a question? Request a review!

@mabdinur mabdinur requested a review from a team as a code owner August 6, 2024 13:44
@mabdinur mabdinur requested a review from mtoffl01 August 6, 2024 13:44
@pr-commenter
Copy link

pr-commenter bot commented Aug 6, 2024

Benchmarks

Benchmark execution time: 2024-08-07 18:48:45

Comparing candidate commit 3221f07 in PR branch munir/remove-16-zeros-w3c with baseline commit 6e9ec58 in branch main.

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

scenario:BenchmarkInjectW3C-24

  • 🟥 execution_time [+110.220ns; +147.380ns] or [+2.682%; +3.586%]

Copy link
Member

@darccio darccio left a comment

Choose a reason for hiding this comment

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

LGTM

@mtoffl01 mtoffl01 merged commit 0462924 into main Aug 8, 2024
164 of 165 checks passed
@mtoffl01 mtoffl01 deleted the munir/remove-16-zeros-w3c branch August 8, 2024 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants