feat(tracing): add support for DD_TRACE_PROPAGATION_BEHAVIOR_EXTRACT#337
feat(tracing): add support for DD_TRACE_PROPAGATION_BEHAVIOR_EXTRACT#337MilanGarnier wants to merge 14 commits into
Conversation
|
🎯 Code Coverage (details) 🔗 Commit SHA: 3e874a4 | Docs | Datadog PR Page | Give us feedback! |
BenchmarksBenchmark execution time: 2026-07-15 10:53:25 Comparing candidate commit 3e874a4 in PR branch Found 1 performance improvements and 0 performance regressions! Performance is the same for 7 metrics, 0 unstable metrics.
|
7bdf91b to
a8070c3
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9b642bbdb6
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
9b642bb to
217c950
Compare
only if w3c context matches the extracted context
09afdc7 to
16eb8a7
Compare
…opagation-behavior-extract
ac278e1 to
3e874a4
Compare
Description
Add support for
DD_TRACE_PROPAGATION_BEHAVIOR_EXTRACT, which controls how thetracer handles incoming distributed-trace context during extraction:
continue(default): preserve the existing behavior and continue theextracted trace context.
restart: create a new root trace with a fresh sampling decision and add aspan link to the extracted context.
ignore: discard the incoming context;extract_spanreturnsError::NO_SPAN_TO_EXTRACT, and baggage extraction is disabled.Changes:
PropagationBehaviorExtractenum and parser, with valuescontinue,restart, andignore.DD_TRACE_PROPAGATION_BEHAVIOR_EXTRACT(default:continue) to tracerconfiguration, config inversion metadata, and telemetry reporting. Both
programmatic and environment configuration are supported; environment values
take precedence.
Tracer::extract_span:continueretains the existing extraction path.restartcreates a new trace and attaches a span link to the selectedextracted context. The link records
reason=propagation_behavior_extract,the selected extraction style in
context_headers, the merged samplingdecision as W3C flags, and the raw W3C
tracestatewhen it belongs to thelinked context.
ignoreshort-circuits context extraction.tracestateduring extraction so it can be retained on arestart link when applicable.
parent use collision-safe synthetic handles.
metadata, sampling flags, and selected-context behavior.
Span::add_link(const Span&, ...)to construct the link in onestep.
This PR is stacked on
milan.garnier/span-links-support, which supplies theunderlying span-link support; this diff is scoped to propagation behavior on
extraction.
Motivation
This aligns C++ with the extraction-behavior control available in other
Datadog tracers. It lets services avoid continuing an untrusted or foreign
trace while retaining a correlation link to its context.
System tests: DataDog/system-tests#7279
Jira ticket: APMAPI-1941