feat: trace context propagation behavior#4635
feat: trace context propagation behavior#4635gh-worker-dd-mergequeue-cf854d[bot] merged 58 commits into
Conversation
547e777 to
b2227f3
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files
🚀 New features to boost your workflow:
|
BenchmarksBenchmark execution time: 2026-05-27 12:58:09 Comparing candidate commit 3243ac6 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 297 metrics, 2 unstable metrics, 1 flaky benchmarks without significant changes.
|
- Rename firstExtract → firstExtraction - Remove extractedCtx2/ctx2 aliases, use extractedCtx/ctx directly - Improve comments explaining W3C/Datadog parent ID resolution - Improve overrideDatadogParentID docs explaining reparentID purpose
… happy path with no indents
…nStart to generate a new traceID and span ID
b2227f3 to
e86bc01
Compare
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: 3243ac6 | Docs | Datadog PR Page | Give us feedback! |
…lper, move baggage fix inside restart branch
|
👋 from a DD customer at figma. Can we do anything to help this PR along? |
@spiliopoulos Thanks for chiming in. We will do our best to push this forward. @igoragoli @genesor Do you need any help with this? |
|
Heya @kakkoyun @spiliopoulos This PR is a mentorship project with @igoragoli, we will work on having it merged by EOW. Once merged it will either land in |
|
Thanks for the work @igoragoli and @genesor. We will wait to see what release picks it up and give it a spin. I do expect this will give us a lot of flexibility in decomposing our traces into more manageable chunks |
What does this PR do?
Implements
DD_TRACE_PROPAGATION_BEHAVIOR_EXTRACTfor dd-trace-go.See RFC.
Three modes:
continue(default): existing behavior -- incoming trace context is used as the local trace context. Baggage is propagated.restart: starts a new trace with a fresh trace ID and sampling decision. The incoming context is referenced via a span link withreason=propagation_behavior_extract. Baggage is propagated.ignore: discards the entire incoming trace context. Returnsnil, nilfromExtract()so callers produce a fresh root span with no parent, no span links, and no baggage.When
DD_TRACE_PROPAGATION_EXTRACT_FIRST=trueis combined withrestart, baggage is explicitly extracted after the first propagator returns, since the RFC requires baggage to be propagated inrestartmode regardless.Motivation
See RFC: Trace Context Propagation Extraction Modes
System-tests PR: DataDog/system-tests#6757
Reviewer's Checklist
Note: Still working on it: DataDog/system-tests#6757
Note: Benchmarking is explicitly out of scope per the RFC ("the processing overhead is minimal in comparison to the rest of the context extraction operation").
make lintlocally.make testlocally.make generatelocally.make fix-moduleslocally.Unsure? Have a question? Request a review!