Skip to content

w3c tracecontext: Cover random trace ID flag semantics - #6074

Open
mabdinur wants to merge 10 commits into
mainfrom
munir/add-tests-for-randomness-bit
Open

mabdinur wants to merge 10 commits into
mainfrom
munir/add-tests-for-randomness-bit

Conversation

@mabdinur

@mabdinur mabdinur commented Jan 20, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

Add coverage for the W3C Trace Context Level 2 trace flags, including the random trace ID flag.

Changes

  • Check the sampled bit independently of the random bit using 00, 01, 02, and 03. Reserved-bit acceptance is outside this test's scope.
  • Check random-flag preservation for all four sampled/random combinations, asserting the trace ID stays unchanged and the child span has a different parent ID.
  • Check that new traces advertise randomness with sampling rates 0 and 1. This tests the specification's SHOULD recommendation; it does not statistically validate trace ID randomness.
  • Keep unsupported random-flag behavior declared in the nine language manifests, including Rust rejecting 03 for version 00. These declarations still execute the tests and report expected failures. Enable propagation for Python from the verified 4.16.1 baseline; earlier versions may also support it.

The tests use the existing native Datadog header endpoints. No parametric application or framework changes are needed.

Validation

  • ./format.sh: passed.
  • Manifest and convention self-tests: 33 passed.
  • Python 4.16.1: full Trace Context file validated; all four random-flag propagation combinations pass. New-trace randomness remains an expected failure.
  • Node.js 7.0.0-pre: sampled-bit cases pass; random-flag generation and preservation of a set flag remain unsupported.
  • Go 2.13.0-dev, final focused run: 4 passed, 4 expected failures, 2 expected passes. All four sampled/random flag combinations preserve the trace and sampling decision.
  • Final CI run is green on 346b07e14: 407 successful checks and 74 intentionally skipped. The earlier Java OpenLiberty/JMX flake passed on the fresh run.

Reviewer checklist

  • Test logic and specification interpretation reviewed by the feature owners.

@mabdinur mabdinur changed the title Munir/add tests for randomness bit w3c tracecontext: Add traceparent randomness bit tests Jan 20, 2026
@github-actions

github-actions Bot commented Jan 20, 2026 •

Copy link
Copy Markdown
Contributor

CODEOWNERS have been resolved as:

manifests/cpp.yml                                                       @DataDog/system-tests-reviewers
manifests/dotnet.yml                                                    @DataDog/system-tests-reviewers
manifests/golang.yml                                                    @DataDog/system-tests-reviewers
manifests/java.yml                                                      @DataDog/system-tests-reviewers
manifests/nodejs.yml                                                    @DataDog/system-tests-reviewers
manifests/php.yml                                                       @DataDog/system-tests-reviewers
manifests/python.yml                                                    @DataDog/system-tests-reviewers
manifests/ruby.yml                                                      @DataDog/system-tests-reviewers
manifests/rust.yml                                                      @DataDog/system-tests-reviewers
tests/parametric/test_headers_tracecontext.py                           @DataDog/system-tests-reviewers

@datadog-official

datadog-official Bot commented Jan 21, 2026 •

Copy link
Copy Markdown

Pipelines  Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 346b07e | Docs | View more details | Give us feedback!

@mabdinur mabdinur changed the title w3c tracecontext: Add traceparent randomness bit tests w3c tracecontext: Cover random trace ID flag semantics Nov 6, 2026
@mabdinur
mabdinur marked this pull request as ready for review November 6, 2026 16:31
@mabdinur
mabdinur requested a review from a team as a code owner November 6, 2026 16:31
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-06T16:33:12.655545Z cb0b440 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

This branch has not been deployed

No deployments
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.

1 participant