feat(golang): implement DD_TRACE_PROPAGATION_BEHAVIOR_EXTRACT#6757
Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 12 commits intoJun 19, 2026
Conversation
Contributor
|
|
9 tasks
…n-extraction-modes
…ng in make_distant_call" This reverts commit 54e3b54.
🎉 All green!🧪 All tests passed 🔗 Commit SHA: 21cfecb | Docs | Datadog PR Page | Give us feedback! |
…ing in make_distant_call" This reverts commit 20d7cac.
…n-extraction-modes
gh-worker-dd-mergequeue-cf854d Bot
pushed a commit
to DataDog/dd-trace-go
that referenced
this pull request
May 28, 2026
### What does this PR do? Implements `DD_TRACE_PROPAGATION_BEHAVIOR_EXTRACT` for dd-trace-go. See [RFC](https://docs.google.com/document/d/1KWx5F-XEzJ55XZPwY30t0otVIyOUYHWsDhEt3YPDnso/edit?pli=1&tab=t.0). 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 with `reason=propagation_behavior_extract`. Baggage is propagated. - **`ignore`**: discards the entire incoming trace context. Returns `nil, nil` from `Extract()` so callers produce a fresh root span with no parent, no span links, and no baggage. When `DD_TRACE_PROPAGATION_EXTRACT_FIRST=true` is combined with `restart`, baggage is explicitly extracted after the first propagator returns, since the RFC requires baggage to be propagated in `restart` mode regardless. ### Motivation See RFC: [Trace Context Propagation Extraction Modes](https://docs.google.com/document/d/1htJFBWR4RFpmK1i6wopxkZwlvYu9unkPJnMnTom4Xjo) System-tests PR: DataDog/system-tests#6757 ### Reviewer's Checklist - [x] Changed code has unit tests for its functionality at or near 100% coverage. - [x] [System-Tests](https://github.com/DataDog/system-tests/) covering this feature have been added and enabled with the va.b.c-dev version tag. Note: Still working on it: DataDog/system-tests#6757 - [ ] There is a benchmark for any new code, or changes to existing code. 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"). - [x] If this interacts with the agent in a new way, a system test has been added. - [x] New code is free of linting errors. You can check this by running `make lint` locally. - [x] New code doesn't break existing tests. You can check this by running `make test` locally. - [x] Add an appropriate team label so this PR gets put in the right place for the release notes. - [x] All generated files are up to date. You can check this by running `make generate` locally. - [x] Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild. Make sure all nested modules are up to date by running `make fix-modules` locally. Unsure? Have a question? Request a review! Co-authored-by: genesor <[email protected]> Co-authored-by: kakkoyun <[email protected]>
…n-extraction-modes
genesor
marked this pull request as ready for review
June 11, 2026 19:52
nccatoni
approved these changes
Jun 16, 2026
…n-extraction-modes
|
genesor
approved these changes
Jun 19, 2026
gh-worker-dd-mergequeue-cf854d
Bot
deleted the
augusto/dd-trace-go-trace-context-propagation-extraction-modes
branch
June 19, 2026 22:14
darccio
added a commit
that referenced
this pull request
Jun 26, 2026
…l make_distant_call PR #6757 added span-context injection and header-key lowercasing to the net-http /make_distant_call handler and activated Test_ExtractBehavior_Restart_With_Extract_First at v2.10.0-dev for all Go weblogs. The net-http-span-pool clone never received the matching handler change, so after merging main the test ran against span-pool and failed with KeyError: 'x-datadog-trace-id'. Mirror the net-http handler: inject the active span context into the outbound request headers and lowercase the captured request-header keys. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
dd-trace-go now implements all three extraction behavior modes for
DD_TRACE_PROPAGATION_BEHAVIOR_EXTRACTper RFC feature 353:continue(default): continues the extracted trace contextrestart: starts a new trace, creating a span link to the extracted contextignore: ignores any extracted trace context entirelyAlso supports the
restart+extract_firstcombination.Implementation is in the dd-trace-go branch:
augusto/trace-context-propagation-extraction-modesChanges
Remove the four
missing_featuremarkers forTest_ExtractBehavior_*tests inmanifests/golang.ymland replace them with version markers targetingv2.9.0-dev.Workflow
🚀 Once your PR is reviewed and the CI green, you can merge it!
🛟 #apm-shared-testing 🛟
Reviewer checklist
tests/ormanifests/is modified ? I have the approval from R&P teambuild-XXX-imagelabel is present