Skip to content

fix(config): treat empty OTEL_PROPAGATORS as unset - #11327

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 7 commits into
masterfrom
ben.db/fix-otel-empty-protocol-propagators
Nov 23, 2026
Merged

gh-worker-dd-mergequeue-cf854d[bot] merged 7 commits into
masterfrom
ben.db/fix-otel-empty-protocol-propagators

Conversation

@genesor

@genesor genesor commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

What does this PR do?

Treats an empty OTEL_PROPAGATORS as unset, as the OpenTelemetry spec requires, while keeping DD_TRACE_PROPAGATION_STYLE="" as the way to disable propagation. It also aligns none handling with the OpenTelemetry JavaScript SDK.

  • OTEL_PROPAGATORS gets its own config entry again (registry implementation A). Its transform, validateOtelPropagators, resolves an empty list to unset and otherwise reuses validatePropagationStyles.
  • none in OTEL_PROPAGATORS disables propagation even when combined with other propagators, like getPropagatorFromEnv in the OpenTelemetry JavaScript SDK. Combining it with others logs a warning. DD_TRACE_PROPAGATION_STYLE keeps its current handling of none.
  • OTEL_PROPAGATORS is no longer an alias of DD_TRACE_PROPAGATION_STYLE, since it accepts different values. It is now an explicit one-way fallback: the OTel value only applies when DD_TRACE_PROPAGATION_STYLE is not set in any source. A set DD_TRACE_PROPAGATION_STYLE takes precedence even when its value is invalid, in which case its own default applies.
  • The OTel/DD conflict telemetry (otel.env.hiding / otel.env.invalid) now checks the origin of OTEL_PROPAGATORS itself, so an invalid OTEL_PROPAGATORS hidden by a set DD_TRACE_PROPAGATION_STYLE is reported as invalid. It was previously missed.
Env Before After
OTEL_PROPAGATORS="" propagation disabled default styles
OTEL_PROPAGATORS=tracecontext tracecontext tracecontext
OTEL_PROPAGATORS=none disabled disabled
OTEL_PROPAGATORS=tracecontext,none tracecontext, none disabled, with a warning
DD_TRACE_PROPAGATION_STYLE="" disabled disabled
DD_TRACE_PROPAGATION_STYLE=none,tracecontext none, tracecontext none, tracecontext
DD_TRACE_PROPAGATION_STYLE="" + OTEL_PROPAGATORS=tracecontext disabled disabled
DD_TRACE_PROPAGATION_STYLE=datadog + OTEL_PROPAGATORS=tracecontext datadog datadog
DD_TRACE_PROPAGATION_STYLE=invalid + OTEL_PROPAGATORS=tracecontext tracecontext default styles

The v5 b3 single/multi header selection now looks up OTEL_PROPAGATORS directly when no valid DD_TRACE_PROPAGATION_STYLE is 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_PROPAGATORS became an alias of DD_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

@dd-octo-sts

dd-octo-sts Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Overall package size

Self size: 9.56 MB
Deduped: 10.31 MB
No deduping: 10.31 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

@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🔄 Datadog retried 1 test - 1 passed on retry View in Datadog

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

@codecov

codecov Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.15%. Comparing base (ed7cc43) to head (a53e527).
⚠️ Report is 22 commits behind head on master.

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     
Flag Coverage Δ
ai-guard 63.32% <94.87%> (+0.06%) ⬆️
apm-capabilities 55.15% <100.00%> (-0.03%) ⬇️
apm-integrations 81.92% <94.87%> (+0.19%) ⬆️
appsec 59.23% <94.87%> (+0.05%) ⬆️
debugger 70.88% <94.87%> (+0.03%) ⬆️
instrumentation 60.16% <94.87%> (+0.16%) ⬆️
llmobs 82.51% <94.87%> (+0.02%) ⬆️
master-coverage 99.15% <100.00%> (?)
openfeature 68.05% <94.87%> (+0.06%) ⬆️
platform 68.14% <94.87%> (+0.07%) ⬆️
profiling 66.48% <94.87%> (+0.03%) ⬆️
serverless 66.65% <94.87%> (+1.17%) ⬆️
test-optimization 82.01% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pr-commenter

pr-commenter Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-11-23 16:42:10

Comparing candidate commit a53e527 in PR branch ben.db/fix-otel-empty-protocol-propagators with baseline commit ed7cc43 in branch master.

📊 Benchmarking dashboard

Found 0 performance improvements and 0 performance regressions! Performance is the same for 2445 metrics, 12 unstable metrics.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

Unstable benchmarks

These benchmarks have a confidence interval too wide to call a change; treat them as noise rather than signal.

scenario:appsec-appsec-enabled-20

  • unstable max_rss_usage [-42.475MB; +59.584MB] or [-21.552%; +30.234%]

scenario:appsec-iast-no-vulnerability-iast-enabled-default-config-20

  • unstable max_rss_usage [-28.397MB; +39.017MB] or [-12.048%; +16.553%]

scenario:appsec-iast-with-vulnerability-iast-enabled-default-config-20

  • unstable max_rss_usage [-25.252MB; +33.525MB] or [-7.327%; +9.728%]

scenario:encoders-0.4-immediate-flush-20

  • unstable max_rss_usage [-12.473MB; +7.531MB] or [-14.622%; +8.829%]

scenario:openfeature-initialization-configuration-26

  • unstable cpu_user_time [-148.417ms; +103.158ms] or [-8.571%; +5.957%]
  • unstable execution_time [-147.290ms; +105.907ms] or [-8.199%; +5.896%]
  • unstable throughput [-32630.125op/s; +41702.026op/s] or [-5.734%; +7.329%]

scenario:openfeature-initialization-error-20

  • unstable max_rss_usage [-5048.599KB; +4864.962KB] or [-6.708%; +6.464%]

scenario:openfeature-scale-full-26

  • unstable max_rss_usage [-37.961MB; +13.112MB] or [-17.742%; +6.128%]

scenario:plugin-claude-agent-sdk-compact-hook-indexed-20

  • unstable cpu_user_time [-452.892ms; +555.690ms] or [-4.503%; +5.525%]

scenario:plugin-graphql-long-with-depth-off-26

  • unstable max_rss_usage [-19.108MB; +31.420MB] or [-10.157%; +16.702%]

scenario:plugin-graphql-long-with-depth-on-max-26

  • unstable max_rss_usage [-21.834MB; +6.291MB] or [-11.732%; +3.381%]

@genesor
genesor marked this pull request as ready for review November 20, 2026 13:33
@genesor
genesor requested a review from a team as a code owner November 20, 2026 13:33
@genesor
genesor requested review from BridgeAR and removed request for a team November 20, 2026 13:33
@chatgpt-codex-connector

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

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-20T13:46:51.568367Z fef2811 New commits
ℹ️ 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.

@BridgeAR BridgeAR left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, while one condition could likely be removed for simplicity reasons

Comment thread packages/dd-trace/src/config/index.js Resolved
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit c3b0f6f into master Nov 23, 2026
784 of 785 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the ben.db/fix-otel-empty-protocol-propagators branch November 23, 2026 16:44
dd-octo-sts Bot pushed a commit that referenced this pull request Nov 24, 2026
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>
@dd-octo-sts dd-octo-sts Bot mentioned this pull request Nov 24, 2026
dd-octo-sts Bot pushed a commit that referenced this pull request Nov 24, 2026
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>
@dd-octo-sts dd-octo-sts Bot mentioned this pull request Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants