← Back to Pull requests

fix(propagation): honor OTEL B3 injection on v5 #10892

Merged
rochdev merged 9 files (307 lines) on Oct 27, 2026 17:13 UTC
View on GitHub
rochdev rochdev commented on Oct 22, 2026 16:43 UTC
Author

What does this PR do?

Makes v5 resolve the b3 injection wire format from the effective configuration source:

  • OTEL_PROPAGATORS=b3 emits the single b3 header.

  • Datadog and programmatic b3 settings retain the legacy x-b3- headers.

  • Runtime and remote configuration changes refresh the selected format without overwriting higher-priority values.

  • Configuration-shape compatibility is retained for callers that do not expose origin tracking.
  • Motivation

    System tests exposed that v5 already extracted OTEL_PROPAGATORS=b3 as single-header B3 but injected it as multi-header B3. This made cross-process propagation asymmetric and caused the v5 release-line failure in DataDog/dd-trace-js#10768.

    Additional Notes

    Validation:

  • Targeted ESLint passed.

  • Config-helper, config, and text-map propagation specs: 655 passing, 3 pending.

  • Final Codex review against master found no actionable issues.
  • Generated by Codex.*

    Diff: 307 lines (+285 / -22) across 9 files Reviewer: pabloerhard Review duration: 7229m
    All Vouch review confidence checks passed
    Residual risk 0.05 = Change Risk (0.49) × (1 − Review Confidence (0.91)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.49 · 307 lines diff across 9 files
    0.49
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.91 · 5 substantive comment(s)
    0.91
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 50%
    90%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.343
    Real PR Conversation Timeline
    16 items
    dd-octo-sts[bot] dd-octo-sts[bot] commented on Oct 22, 2026 16:44 UTC
    Bot

    Overall package size

    Self size: 9.7 MB
    Deduped: 10.44 MB
    No deduping: 10.44 MB

    <details><summary>Dependency sizes</summary>
    | name | version | self size | total size |
    |------|---------|-----------|------------|
    | import-in-the-middle | 3.5.1 | 127.66 kB | 528.28 kB |
    | opentracing | 0.14.7 | 194.81 kB | 194.81 kB |
    | dc-polyfill | 0.1.11 | 25.74 kB | 25.74 kB |

    </details>

    <sub>🤖 This report was automatically generated by heaviest-objects-in-the-universe<sub>

    datadog-prod-us1-6[bot] datadog-prod-us1-6[bot] commented on Oct 22, 2026 16:46 UTC
    Bot

    <a target='_blank' href='https://app.datadoghq.com/ci/pipeline-executions?query=ci_level%3Ajob+%40git.commit.sha%3A6b88986ede6f8077c1d426fb7a1c658525696c87&referrer=pr-comment&start=1793030535000'><picture><source media="(prefers-color-scheme: dark)" srcset="https://static.datadoghq.com/static/images/pr_comments/software_delivery/badges_header/pipelines-ok.svg"/><img src="https://static.datadoghq.com/static/images/pr_comments/software_delivery/badges_header/pipelines-ok-light.svg" alt="Pipelines" align="center" /></picture></a> &nbsp;<a target='_blank' href='https://app.datadoghq.com/ci/test/runs?query=test_level%3Atest+%40git.commit.sha%3A9e3a99801f1c8b03a7bad58349fdbbbd914f99eb&referrer=pr-comment&start=1793030535000'><picture><source media="(prefers-color-scheme: dark)" srcset="https://static.datadoghq.com/static/images/pr_comments/software_delivery/badges_header/tests-ok.svg"/><img src="https://static.datadoghq.com/static/images/pr_comments/software_delivery/badges_header/tests-ok-light.svg" alt="Tests" align="center" /></picture></a>

    <details><summary><b>🎉 All green!</b></summary>

    🧪 All tests passed
    ❄️ No new flaky tests detected
    </details>

    🔄 Datadog retried 2 tests - 2 passed on retry <a href="https://app.datadoghq.com/ci/test/runs?query=test_level%3Atest+%40git.commit.sha%3A9e3a99801f1c8b03a7bad58349fdbbbd914f99eb+%40test.is_retry%3Atrue+AND+%28%40test.retry_reason%3Aauto_test_retry+OR+%28-%40test.retry_reason%3A%2A+AND+-%40test.is_new%3Atrue%29%29&referrer=pr-comment" title="View in Datadog"><img src="https://static.datadoghq.com/static/images/pr_comments/software_delivery/datadog_icon.svg" alt="View in Datadog" align="center" /></a>

    🎯 Code Coverage (<a target='_blank' href='https://app.datadoghq.com/ci/code-coverage/github.com%2Fdatadog%2Fdd-trace-js/pull-requests/10892'>details</a>)<br>• <strong><span title="Percentage of modified executable lines covered by tests in this PR">Patch Coverage</span></strong>: 100.00%<br>• <strong><span title="Percentage of all executable lines covered by tests in the entire codebase">Overall Coverage</span></strong>: 98.36%<br>

    <sub>
    This comment will be updated automatically if new data arrives. <br />
    🔗 Commit SHA: 6b88986 | <a href="https://docs.datadoghq.com/integrations/guide/source-code-integration/#pr-comments">Docs</a> | <a href="https://app.datadoghq.com/ci/pull-request/Z2l0aHViLmNvbS9kYXRhZG9nL2RkLXRyYWNlLWpzLzEwODky?referrer=pr-comment">View more details</a> | Give us <a href="https://dd.enterprise.slack.com/archives/C07E3U2QRMM">feedback</a>!
    </sub>

    codecov[bot] codecov[bot] commented on Oct 22, 2026 16:50 UTC
    Bot

    Codecov Report


    :white_check_mark: All modified and coverable lines are covered by tests.
    :white_check_mark: Project coverage is 98.96%. Comparing base (1fae4a7) to head (6b88986).
    :warning: Report is 33 commits behind head on master.

    <details><summary>Additional details and impacted files</summary>

    @@            Coverage Diff             @@
    ##           master   #10892      +/-   ##
    ==========================================
    + Coverage   93.61%   98.96%   +5.34%     
    ==========================================
      Files        1068     1069       +1     
      Lines      175077   175456     +379     
      Branches       72       72              
    ==========================================
    + Hits       163906   173638    +9732     
    + Misses      11170     1817    -9353     
      Partials        1        1              
    

    | Flag | Coverage Δ | |
    |---|---|---|
    | ai-guard | 63.60% <47.87%> (-0.09%) | :arrow_down: |
    | apm-capabilities | 54.82% <100.00%> (+0.08%) | :arrow_up: |
    | apm-integrations | 80.86% <47.87%> (?) | |
    | appsec | 57.26% <47.87%> (+0.04%) | :arrow_up: |
    | debugger | 70.82% <45.74%> (-0.10%) | :arrow_down: |
    | instrumentation | 55.39% <47.87%> (+0.07%) | :arrow_up: |
    | llmobs | 81.32% <47.87%> (-0.11%) | :arrow_down: |
    | master-coverage | 98.96% <100.00%> (?) | |
    | openfeature | 67.31% <47.87%> (-0.10%) | :arrow_down: |
    | platform | 68.35% <47.87%> (-0.07%) | :arrow_down: |
    | profiling | 65.84% <45.74%> (-0.09%) | :arrow_down: |
    | serverless | 64.85% <47.87%> (-0.07%) | :arrow_down: |
    | test-optimization | 82.04% <100.00%> (+0.10%) | :arrow_up: |

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

    :umbrella: View full report in Codecov by Harness.
    :loudspeaker: Have feedback on the report? Share it here.
    <details><summary> :rocket: New features to boost your workflow: </summary>

  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

  • </details>

    pr-commenter[bot] pr-commenter[bot] commented on Oct 22, 2026 16:57 UTC
    Bot

    Benchmarks

    Benchmark execution time: 2026-10-26 16:49:14

    Comparing candidate commit 6b88986ede6f8077c1d426fb7a1c658525696c87 in PR branch rochdev/fix-v5-otel-b3-injection with baseline commit 1fae4a7fd99d0647f8627657c790b0d4815a68ec in branch master.

    📊 Benchmarking dashboard

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

    <details>
    <summary><h3>Explanation</h3></summary>

    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.

    <details>
    <summary><h4>More details about the CI and significant changes</h4></summary>

    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 ----------------------------------'
    

    </details>

    </details>

    <details>
    <summary><h3>Unstable benchmarks</h3></summary>

    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 [-91.497MB; -24.795MB] or [-40.307%; -10.923%]
  • scenario:appsec-iast-with-vulnerability-iast-enabled-default-config-20

  • unstable max_rss_usage [-30.675MB; +36.603MB] or [-8.527%; +10.175%]
  • scenario:appsec-iast-with-vulnerability-iast-enabled-default-config-26

  • unstable max_rss_usage [-30.270MB; +25.764MB] or [-9.876%; +8.406%]
  • scenario:debugger-line-probe-with-snapshot-default-20

  • unstable max_rss_usage [-6.982MB; +9.622MB] or [-5.080%; +7.000%]
  • scenario:encoders-0.4-immediate-flush-20

  • unstable max_rss_usage [-10662.944KB; +10538.944KB] or [-12.868%; +12.718%]
  • scenario:openfeature-scale-full-24

  • unstable max_rss_usage [-31.286MB; +27.591MB] or [-10.283%; +9.069%]
  • scenario:plugin-graphql-long-with-depth-off-26

  • unstable cpu_user_time [-605.176ms; +475.667ms] or [-8.847%; +6.954%]

  • unstable execution_time [-635.720ms; +488.359ms] or [-9.103%; +6.993%]

  • unstable max_rss_usage [-55.130MB; +19.782MB] or [-22.377%; +8.029%]

  • unstable throughput [-21.944op/s; +31.246op/s] or [-6.759%; +9.624%]
  • scenario:plugin-graphql-long-with-depth-on-max-26

  • unstable max_rss_usage [-6.774MB; +21.078MB] or [-2.633%; +8.193%]
  • </details>

    chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] commented on Oct 22, 2026 18:08 UTC
    Bot

    <!-- codex-pull-request-review-summary -->
    <!-- codex-review-state:v1 {"code_review":{"commit_sha":"6b88986ede6f8077c1d426fb7a1c658525696c87","has_any_findings":false,"has_unresolved_findings":false,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} -->

    Codex Review Summary

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

    | Review | Status | Commit | Review trigger |
    | --- | --- | --- | --- |
    | 📝 Code Review | ✅ Completed <relative-time datetime="2026-10-26T19:34:41.930913Z">2026-10-26T19:34:41.930913Z</relative-time> | 6b88986 | Draft marked ready |

    <details> <summary>ℹ️ About Codex in GitHub</summary>
    <br/>

    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.

    </details>

    chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] commented on code on Oct 22, 2026 18:13 UTC
    Code Review
    packages/dd-trace/src/config/helper.js:1
    @@ -376,4 +376,33 @@ module.exports = {
           }
         }
       },
    +
    +  /**
    +   * Returns the environment variable name from the highest-priority source whose value is valid.
    +   *
    +   * @param {string} name Environment variable name
    +   * @returns {string|undefined}

    <sub><sub>!P1 Badge</sub></sub> Remove the primitive return annotation

    Remove this @returns tag from the newly added method: its return value is primitive (string|undefined), for which the repository explicitly prohibits @return/@returns annotations; retain the typed @param annotation.

    AGENTS.md reference: AGENTS.md:L105-L108

    Useful? React with 👍 / 👎.

    <!-- codex-code-review-finding:v1 -->

    chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] commented on Oct 22, 2026 18:13 UTC
    Reviewer

    <!-- codex-review-receipt:v1 -->

    💡 Codex Review

    Here are some automated review suggestions for this pull request.

    Reviewed commit: 3e2240ca8d

    <details> <summary>ℹ️ About Codex in GitHub</summary>
    <br/>

    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".

    </details>

    datadog-prod-us1-6[bot] datadog-prod-us1-6[bot] commented on code on Oct 22, 2026 18:21 UTC
    Code Review
    packages/dd-trace/src/opentracing/propagation/text_map.js:1
    @@ -318,16 +330,44 @@ class TextMapPropagator {
         // expect single, legacy `DD_TRACE_PROPAGATION_STYLE` callers expect multi.
         /* istanbul ignore else: v5 fallback */
         if (DD_MAJOR >= 6) {
    +      this.#b3InjectIsSingleHeader = true
           this.#extractB3Context = extractB3SingleContext
         } else {
    -      const envName = getConfiguredEnvName('DD_TRACE_PROPAGATION_STYLE')
    +      const envName = getValidatedConfiguredEnvName('DD_TRACE_PROPAGATION_STYLE')
           // eslint-disable-next-line eslint-rules/eslint-env-aliases
           this.#extractB3Context = envName === 'OTEL_PROPAGATORS'
             ? extractB3SingleContext
             : extractB3MultiContext
    +
    +      this.#refreshB3InjectionStyle()
         }
       }
     
    +  #refreshB3InjectionStyle () {
    +    const origin = this.#config.getOrigin('tracePropagationStyle.inject')

    <!-- datadog-code-review reviewer-id=bad90057-5c12-4101-ad47-d91c9dff0f90 -->
    <!-- datadog-autotest-inline:v1:prod -->
    <!-- datadog-autotest-delivery:v1:prod:cded68282fdcee0eb3e41d90ec1f0dabc250f3dafb10bc48a28846013a322842:inline-0 -->

    <sub><sub>!P2</sub></sub> Update standalone fixtures for the new v5 origin lookup

    <!-- autotest-finding-meta source=static_analysis prod_data_type=none production_evidence_effect=none finding_id=5a2b7f32-ce21-4a6f-b107-19b313f38490 -->
    On v5, construction now unconditionally calls getOrigin(), even when B3 is disabled. Existing extraction and injection tests in packages/dd-trace/test/standalone/index.spec.js pass plain configuration fixtures without that method, so they now throw TypeError before reaching their assertions. A focused base/head comparison confirmed the regression. Update the standalone fixtures to supply the new configuration contract.

    <!-- datadog-autotest-feedback-legend:v1 -->
    React: 👍 useful · 👎 wrong · 😕 unclear · 👀 right, but not acting on it
    <details><summary>What each reaction means</summary>

  • 👍 Useful: correct, and you're fixing it or will.

  • 👎 Wrong: the finding is incorrect, for example the bug can't happen or the code was misread.

  • 😕 Unclear: you can't tell what it means or why it matters.

  • 👀 Right, not acting: correct, but intended, out of scope for this PR, a known risk, or too minor.

  • </details>

    <sub>🤖 Bits Code Review</sub> <sub>· <a href="https://app.datadoghq.com/code/b1751a09-71f9-4931-834c-2be7d27ea920?referrer=autotest-pr-comment">Open Bits AI session</a></sub>

    datadog-prod-us1-6[bot] datadog-prod-us1-6[bot] commented on code on Oct 22, 2026 18:21 UTC
    Code Review
    packages/dd-trace/src/opentracing/propagation/text_map.js:1
    @@ -318,16 +330,44 @@ class TextMapPropagator {
         // expect single, legacy `DD_TRACE_PROPAGATION_STYLE` callers expect multi.
         /* istanbul ignore else: v5 fallback */
         if (DD_MAJOR >= 6) {
    +      this.#b3InjectIsSingleHeader = true
           this.#extractB3Context = extractB3SingleContext
         } else {
    -      const envName = getConfiguredEnvName('DD_TRACE_PROPAGATION_STYLE')
    +      const envName = getValidatedConfiguredEnvName('DD_TRACE_PROPAGATION_STYLE')
           // eslint-disable-next-line eslint-rules/eslint-env-aliases
           this.#extractB3Context = envName === 'OTEL_PROPAGATORS'
             ? extractB3SingleContext
             : extractB3MultiContext
    +
    +      this.#refreshB3InjectionStyle()
         }
       }
     
    +  #refreshB3InjectionStyle () {
    +    const origin = this.#config.getOrigin('tracePropagationStyle.inject')
    +    const experimentalEnabled = this.#config.experimental?.b3 === true
    +    const sharedOrigin = origin === 'calculated'
    +      ? this.#config.getOrigin('DD_TRACE_PROPAGATION_STYLE')
    +      : undefined
    +    if (origin === this.#b3InjectOrigin &&
    +      experimentalEnabled === this.#b3ExperimentalEnabled &&
    +      sharedOrigin === this.#b3SharedOrigin) return

    <!-- datadog-code-review reviewer-id=bad90057-5c12-4101-ad47-d91c9dff0f90 -->
    <!-- datadog-autotest-inline:v1:prod -->
    <!-- datadog-autotest-delivery:v1:prod:cded68282fdcee0eb3e41d90ec1f0dabc250f3dafb10bc48a28846013a322842:inline-1 -->

    <sub><sub>!P2</sub></sub> Remote DD_TRACE_PROPAGATION_STYLE_INJECT=b3 override retains single-header B3 when OTEL_PROPAGATORS=b3 is set

    <!-- autotest-finding-meta source=static_analysis prod_data_type=none production_evidence_effect=none finding_id=b167b6ae-f40f-4d44-9d7e-39017cc12771 -->
    When OTEL_PROPAGATORS=b3 is set at startup on v5, tracePropagationStyle.inject is populated via fallbackConfigurations and recorded in changeTracker.calculated. If config.setRemoteConfig({ DD_TRACE_PROPAGATION_STYLE_INJECT: 'b3' }) is later called, Config.#applyCalculated() runs undo(this, 'calculated'), which reverts every previously calculated key back to changeTracker.baseValuesByPath (discarding the remote_config entry) and re-applies the DD_TRACE_PROPAGATION_STYLE fallback with origin 'calculated'. Because origin remains 'calculated' and sharedOrigin remains 'env_var', #refreshB3InjectionStyle() returns early and continues emitting single-header b3 instead of switching to legacy x-b3-* multi-header injection. The new unit test 'should refresh the injection style after remote configuration' does not catch this because it stubs config.getOrigin('tracePropagationStyle.inject') to return 'remote_config' directly.

    <!-- datadog-autotest-feedback-legend:v1 -->
    React: 👍 useful · 👎 wrong · 😕 unclear · 👀 right, but not acting on it
    <details><summary>What each reaction means</summary>

  • 👍 Useful: correct, and you're fixing it or will.

  • 👎 Wrong: the finding is incorrect, for example the bug can't happen or the code was misread.

  • 😕 Unclear: you can't tell what it means or why it matters.

  • 👀 Right, not acting: correct, but intended, out of scope for this PR, a known risk, or too minor.

  • </details>

    <sub>🤖 Bits Code Review</sub> <sub>· <a href="https://app.datadoghq.com/code/b1751a09-71f9-4931-834c-2be7d27ea920?referrer=autotest-pr-comment">Open Bits AI session</a></sub>

    datadog-prod-us1-6[bot] datadog-prod-us1-6[bot] commented on Oct 22, 2026 18:21 UTC
    Reviewer

    <img src="https://img.shields.io/badge/BITS%20CODE%20REVIEW-FAIL-CC0000?labelColor=632CA6&style=for-the-badge&logo=data:image/svg%2Bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMjggMTI4Ij48cGF0aCBkPSJNNjMuNTUsNzQuMzJhNTUuMiw1NS4yLDAsMCwxLTEwLTguMzJjLS4zMS0uMjMtLjI2LTEuMjUtLjI2LTEuMjVBNTUuODEsNTUuODEsMCwwLDAsNjguOTQsNzMuMWExMi43NCwxMi43NCwwLDAsMCw5LjgxLS44MywyNSwyNSwwLDAsMCw3LjUzLTYuNjRsLjM0LjU5YTE0LjkzLDE0LjkzLDAsMCwxLTEuMjksMy4wNiw4LDgsMCwwLDAsMi4yNC44MWw2LS45M2ExOC4xMiwxOC4xMiwwLDAsMCwyLTE0LjMxYy0uOTMtMy01Ljc5LTkuMS02LjE0LTkuNDMtMS4yMi0xLjE3LjIxLTUuNy0yLjIxLTEwLjY1Qzg0LjY1LDI5LjU0LDc4LDI0LjA5LDc1LjA5LDIxLjcyYy44NS42Miw2LjEsMi43NCw4LjU1LDUuNjkuMjMtLjMuMzItMS44OS41My0yLjI5LTIuMS0yLjc2LTIuMjYtNy42Ni0yLjI2LTlBMTQuODcsMTQuODcsMCwwLDAsODAuNjksMTFhOC4xNiw4LjE2LDAsMCwxLDIuNjUsNC41MywxOC41MSwxOC41MSwwLDAsMCwzLjgyLDguMzRjMy40Myw0LjI2LDYuNTIsNi40NSw4LjA4LDQuODgsMS44OC0xLjktMS44OS0xMC4zNy02LjcxLTE1LjEtNS42Mi01LjUyLTcuMDktNC44MS0xMC4zOS0zLjYzLTIuNjMuOTQtNCw4LjQtMTAuOTEsOC4yNi0xLjE2LS4xNC00LjE1LS4yMS01LjY0LS4yQzYyLjM2LDE3LDYzLDE2LjIxLDYzLDE2LjIxYTM1LjYxLDM1LjYxLDAsMCw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wwLDAsNTguNyw0OGEyNiwyNiwwLDAsMC0yLjg1LDEuMTMsNy4zMiw3LjMyLDAsMCwxLS43My0uNTVBNS41Myw1LjUzLDAsMCwxLDU1LjM0LDM5Ljc1Wm02MC4xMSwyNy44Mi0zMi41MSw1LjlhMTYsMTYsMCwwLDEtMy43NSwzLjMzLDExLjc1LDExLjc1LDAsMCwxLTkuMjkuODUsMjAsMjAsMCwwLDEtMy43MS0xLjE5bC03Ljk1LDEuMSw0LjgzLDQwLjIsNTUuNy0xMFpNNjUuODgsMTEzLjkybC0uNDYtNC4zNyw5LjA5LTEzLjg4LDEwLjMzLDMsOC44OC0xNC44NCwxMC42NSw3LDguMS0xNywyLjg3LDMwLjkxWiIgZmlsbD0iI2ZmZiIvPjwvc3ZnPg%3D%3D" alt="Bits Code Review: FAIL" height="36"/>

    Two distinct issues were found: standalone test fixtures lack the getOrigin() method now required by the v5 construction path, causing TypeErrors before assertions run; and #refreshB3InjectionStyle() fails to switch injection style after a remote config override when OTEL_PROPAGATORS=b3 is set at startup, because the origin stays 'calculated' rather than becoming 'remote_config'.

    <sub>Open Bits AI session</sub>

    <sub>🤖 Bits Code Review · Commit 3e2240c</sub>

    <!-- autotest-meta model=gpt-6.1-sol engine=codex reasoning_effort=high verdict=FAIL ddrs_bucket=unknown session_id=b1751a09-71f9-4931-834c-2be7d27ea920 -->

    <!-- datadog-code-review reviewer-id=bad90057-5c12-4101-ad47-d91c9dff0f90 -->
    <!-- datadog-autotest:v1:prod -->
    <!-- datadog-autotest-delivery:v1:prod:cded68282fdcee0eb3e41d90ec1f0dabc250f3dafb10bc48a28846013a322842:bundle -->

    rochdev rochdev commented on code on Oct 26, 2026 16:33 UTC
    Code Review
    packages/dd-trace/src/opentracing/propagation/text_map.js:1
    @@ -318,16 +330,44 @@ class TextMapPropagator {
         // expect single, legacy `DD_TRACE_PROPAGATION_STYLE` callers expect multi.
         /* istanbul ignore else: v5 fallback */
         if (DD_MAJOR >= 6) {
    +      this.#b3InjectIsSingleHeader = true
           this.#extractB3Context = extractB3SingleContext
         } else {
    -      const envName = getConfiguredEnvName('DD_TRACE_PROPAGATION_STYLE')
    +      const envName = getValidatedConfiguredEnvName('DD_TRACE_PROPAGATION_STYLE')
           // eslint-disable-next-line eslint-rules/eslint-env-aliases
           this.#extractB3Context = envName === 'OTEL_PROPAGATORS'
             ? extractB3SingleContext
             : extractB3MultiContext
    +
    +      this.#refreshB3InjectionStyle()
         }
       }
     
    +  #refreshB3InjectionStyle () {
    +    const origin = this.#config.getOrigin('tracePropagationStyle.inject')
    +    const experimentalEnabled = this.#config.experimental?.b3 === true
    +    const sharedOrigin = origin === 'calculated'
    +      ? this.#config.getOrigin('DD_TRACE_PROPAGATION_STYLE')
    +      : undefined
    +    if (origin === this.#b3InjectOrigin &&
    +      experimentalEnabled === this.#b3ExperimentalEnabled &&
    +      sharedOrigin === this.#b3SharedOrigin) return

    Fixed calculated rollback so it only reverts values still owned by the calculated source, preserving a higher-priority remote_config override. Added a regression test using the real Config path that applies and removes DD_TRACE_PROPAGATION_STYLE_INJECT while OTEL_PROPAGATORS is set. This is included in commit 6b88986ede.

    Generated by Codex.

    rochdev rochdev commented on code on Oct 26, 2026 16:33 UTC
    Code Review
    packages/dd-trace/src/opentracing/propagation/text_map.js:1
    @@ -318,16 +330,44 @@ class TextMapPropagator {
         // expect single, legacy `DD_TRACE_PROPAGATION_STYLE` callers expect multi.
         /* istanbul ignore else: v5 fallback */
         if (DD_MAJOR >= 6) {
    +      this.#b3InjectIsSingleHeader = true
           this.#extractB3Context = extractB3SingleContext
         } else {
    -      const envName = getConfiguredEnvName('DD_TRACE_PROPAGATION_STYLE')
    +      const envName = getValidatedConfiguredEnvName('DD_TRACE_PROPAGATION_STYLE')
           // eslint-disable-next-line eslint-rules/eslint-env-aliases
           this.#extractB3Context = envName === 'OTEL_PROPAGATORS'
             ? extractB3SingleContext
             : extractB3MultiContext
    +
    +      this.#refreshB3InjectionStyle()
         }
       }
     
    +  #refreshB3InjectionStyle () {
    +    const origin = this.#config.getOrigin('tracePropagationStyle.inject')

    Updated the propagator to treat getOrigin as optional and use the legacy v5 fallback for duck-typed configuration objects. Added regression coverage for a configuration without origin tracking. This is included in commit 6b88986ede.

    Generated by Codex.

    rochdev rochdev commented on code on Oct 26, 2026 16:33 UTC
    Code Review
    packages/dd-trace/src/config/helper.js:1
    @@ -376,4 +376,33 @@ module.exports = {
           }
         }
       },
    +
    +  /**
    +   * Returns the environment variable name from the highest-priority source whose value is valid.
    +   *
    +   * @param {string} name Environment variable name
    +   * @returns {string|undefined}

    Removed the primitive @returns annotation while retaining the typed parameter, as requested. This is included in commit 6b88986ede.

    Generated by Codex.

    datadog-prod-us1-6[bot] datadog-prod-us1-6[bot] commented on Oct 26, 2026 19:37 UTC
    Reviewer

    <img src="https://img.shields.io/badge/BITS%20CODE%20REVIEW-PASS-1a7f37?labelColor=632CA6&style=for-the-badge&logo=data:image/svg%2Bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMjggMTI4Ij48cGF0aCBkPSJNNjMuNTUsNzQuMzJhNTUuMiw1NS4yLDAsMCwxLTEwLTguMzJjLS4zMS0uMjMtLjI2LTEuMjUtLjI2LTEuMjVBNTUuODEsNTUuODEsMCwwLDAsNjguOTQsNzMuMWExMi43NCwxMi43NCwwLDAsMCw5LjgxLS44MywyNSwyNSwwLDAsMCw3LjUzLTYuNjRsLjM0LjU5YTE0LjkzLDE0LjkzLDAsMCwxLTEuMjksMy4wNiw4LDgsMCwwLDAsMi4yNC44MWw2LS45M2ExOC4xMiwxOC4xMiwwLDAsMCwyLTE0LjMxYy0uOTMtMy01Ljc5LTkuMS02LjE0LTkuNDMtMS4yMi0xLjE3LjIxLTUuNy0yLjIxLTEwLjY1Qzg0LjY1LDI5LjU0LDc4LDI0LjA5LDc1LjA5LDIxLjcyYy44NS42Miw2LjEsMi43NCw4LjU1LDUuNjkuMjMtLjMuMz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uOCwwLDAsMC0uMzEtLjA3QzgwLjQ3LDM0LjU0LDgyLjQ0LDM0LjM0LDgzLjg1LDM1Wm0tNC42LDIxLjYzYy43Mi0uNTcsNC0xLjYyLDcuMDktMiwxLjYtLjE5LDMuODgtLjI5LDQuMzcsMCwxLC41MywxLDIuMTguMzEsMy43Mi0xLDIuMjItMi4zMyw0LjY3LTMuODgsNC44Ny0yLjUyLjM0LTQuOTEtMS03LjYzLTMuMDZBMi4yMywyLjIzLDAsMCwxLDc5LjI1LDU2LjYyWk01NS4zNCwzOS43NWM0LTIuNzMsOS4xNi0xLjY1LDguMy0uODMtMS42NSwxLjU2LjU0LDEuMS43OCw0YTUsNSwwLDAsMS0xLjEyLDRBMjUuNDksMjUuNDksMCwwLDAsNTguNyw0OGEyNiwyNiwwLDAsMC0yLjg1LDEuMTMsNy4zMiw3LjMyLDAsMCwxLS43My0uNTVBNS41Myw1LjUzLDAsMCwxLDU1LjM0LDM5Ljc1Wm02MC4xMSwyNy44Mi0zMi41MSw1LjlhMTYsMTYsMCwwLDEtMy43NSwzLjMzLDExLjc1LDExLjc1LDAsMCwxLTkuMjkuODUsMjAsMjAsMCwwLDEtMy43MS0xLjE5bC03Ljk1LDEuMSw0LjgzLDQwLjIsNTUuNy0xMFpNNjUuODgsMTEzLjkybC0uNDYtNC4zNyw5LjA5LTEzLjg4LDEwLjMzLDMsOC44OC0xNC44NCwxMC42NSw3LDguMS0xNywyLjg3LDMwLjkxWiIgZmlsbD0iI2ZmZiIvPjwvc3ZnPg%3D%3D" alt="Bits Code Review: PASS" height="36"/>

    <details>
    <summary>More details</summary>

    Static review and isolated checks support the intended B3 format selection across configuration precedence and remote-config rollback. The human PR discussion supplied no reason to change that conclusion.

    </details>
    Was this helpful? React 👍 or 👎

    <sub>Open Bits AI session</sub>

    <sub>🤖 Bits Code Review · Commit 6b88986</sub>

    <!-- autotest-meta model=gpt-6.1-sol engine=codex reasoning_effort=high verdict=PASS ddrs_bucket=unknown session_id=536b5ed7-54cd-4e9a-87a0-f2bfde46748a -->

    <!-- datadog-code-review reviewer-id=bad90057-5c12-4101-ad47-d91c9dff0f90 -->
    <!-- datadog-autotest:v1:prod -->
    <!-- datadog-autotest-delivery:v1:prod:3e0c39a79d3b67f53b8d7cd11e1f43951b34f85fd7dc603d9156a689fb7fcc08:bundle -->

    pabloerhard pabloerhard approved these changes on Oct 27, 2026 17:11 UTC
    Approved Reviewer

    Approved these changes.

    Reviewers
    Assignees
    rochdev rochdev
    Labels
    risk: low confidence: 90.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 49% (MEDIUM) · Higher = larger blast radius
    49%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 90.5% · Lower = rushed or shallow review
    90.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 4.6% · Safe to merge
    4.6%