Repository navigation
fix(config): treat empty OTEL_PROPAGATORS as unset - #11327
gh-worker-dd-mergequeue-cf854d[bot] merged 7 commits into
Conversation
Overall package sizeSelf size: 9.56 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.5.3 | 131.25 kB | 531.9 kB | | opentracing | 0.14.7 | 194.81 kB | 194.81 kB | | dc-polyfill | 0.1.11 | 25.74 kB | 25.74 kB |🤖 This report was automatically generated by heaviest-objects-in-the-universe |
🎉 All green!🧪 All tests passed 🔄 Datadog retried 1 test - 1 passed on retry 🔗 Commit SHA: a53e527 | Docs | View more details | Give us feedback! |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #11327 +/- ##
=========================================
Coverage 99.15% 99.15%
=========================================
Files 1127 1136 +9
Lines 187234 188318 +1084
Branches 82 86 +4
=========================================
+ Hits 185645 186729 +1084
- Misses 1588 1589 +1
+ Partials 1 0 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
BenchmarksBenchmark execution time: 2026-11-23 16:42:10 Comparing candidate commit a53e527 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 2445 metrics, 12 unstable metrics.
|
…ACE_PROPAGATION_STYLE
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
…ty-protocol-propagators
BridgeAR
left a comment
There was a problem hiding this comment.
LGTM, while one condition could likely be removed for simplicity reasons
c3b0f6f
into
master
fix(config): treat empty OTEL_PROPAGATORS as unset fix(config): let a set DD_TRACE_PROPAGATION_STYLE hide OTEL_PROPAGATORS feat(config): disable propagation when OTEL_PROPAGATORS contains none refactor(config): stop treating OTEL_PROPAGATORS as an alias of DD_TRACE_PROPAGATION_STYLE chore(config): keep DD_TRACE_PROPAGATION_STYLE on registry implementation D Merge remote-tracking branch 'origin/master' into ben.db/fix-otel-empty-protocol-propagators refactor(config): drop redundant DD_TRACE_PROPAGATION_STYLE origin check Co-authored-by: benjamin.debernardi <benjamin.debernardi@datadoghq.com>
fix(config): treat empty OTEL_PROPAGATORS as unset fix(config): let a set DD_TRACE_PROPAGATION_STYLE hide OTEL_PROPAGATORS feat(config): disable propagation when OTEL_PROPAGATORS contains none refactor(config): stop treating OTEL_PROPAGATORS as an alias of DD_TRACE_PROPAGATION_STYLE chore(config): keep DD_TRACE_PROPAGATION_STYLE on registry implementation D Merge remote-tracking branch 'origin/master' into ben.db/fix-otel-empty-protocol-propagators refactor(config): drop redundant DD_TRACE_PROPAGATION_STYLE origin check Co-authored-by: benjamin.debernardi <benjamin.debernardi@datadoghq.com>
What does this PR do?
Treats an empty
OTEL_PROPAGATORSas unset, as the OpenTelemetry spec requires, while keepingDD_TRACE_PROPAGATION_STYLE=""as the way to disable propagation. It also alignsnonehandling with the OpenTelemetry JavaScript SDK.OTEL_PROPAGATORSgets its own config entry again (registry implementationA). Its transform,validateOtelPropagators, resolves an empty list to unset and otherwise reusesvalidatePropagationStyles.noneinOTEL_PROPAGATORSdisables propagation even when combined with other propagators, likegetPropagatorFromEnvin the OpenTelemetry JavaScript SDK. Combining it with others logs a warning.DD_TRACE_PROPAGATION_STYLEkeeps its current handling ofnone.OTEL_PROPAGATORSis no longer an alias ofDD_TRACE_PROPAGATION_STYLE, since it accepts different values. It is now an explicit one-way fallback: the OTel value only applies whenDD_TRACE_PROPAGATION_STYLEis not set in any source. A setDD_TRACE_PROPAGATION_STYLEtakes precedence even when its value is invalid, in which case its own default applies.otel.env.hiding/otel.env.invalid) now checks the origin ofOTEL_PROPAGATORSitself, so an invalidOTEL_PROPAGATORShidden by a setDD_TRACE_PROPAGATION_STYLEis reported as invalid. It was previously missed.OTEL_PROPAGATORS=""OTEL_PROPAGATORS=tracecontextOTEL_PROPAGATORS=noneOTEL_PROPAGATORS=tracecontext,noneDD_TRACE_PROPAGATION_STYLE=""DD_TRACE_PROPAGATION_STYLE=none,tracecontextDD_TRACE_PROPAGATION_STYLE=""+OTEL_PROPAGATORS=tracecontextDD_TRACE_PROPAGATION_STYLE=datadog+OTEL_PROPAGATORS=tracecontextDD_TRACE_PROPAGATION_STYLE=invalid+OTEL_PROPAGATORS=tracecontextThe v5 b3 single/multi header selection now looks up
OTEL_PROPAGATORSdirectly when no validDD_TRACE_PROPAGATION_STYLEis set, instead of going through the alias. It still picks single-header b3 when only the OTel variable is set.Motivation
The OpenTelemetry SDK environment variable spec says an empty value MUST be interpreted the same as an unset variable. Since
OTEL_PROPAGATORSbecame an alias ofDD_TRACE_PROPAGATION_STYLE(#7916),OTEL_PROPAGATORS=""parsed to an empty list and disabled propagation.DD_TRACE_PROPAGATION_STYLE=""is the documented way to disable propagation, so the empty-value handling has to differ between the two variables, which needs a separate entry.This fixes the system-tests case
Test_OTEL_PROPAGATORS::test_empty_is_treated_as_unset.Jira: APMAPI-2475