Skip to content

fix(propagation): enforce tracestate limits and bound pruning work - #10473

Merged
BridgeAR merged 2 commits into
vpellan/otel-threshold-random-valuefrom
BridgeAR/2026-09-23-pr10117-stacked
Sep 25, 2026
Merged

BridgeAR merged 2 commits into
vpellan/otel-threshold-random-valuefrom
BridgeAR/2026-09-23-pr10117-stacked

Conversation

@BridgeAR

Copy link
Copy Markdown
Member

Preserve unknown OTel fields when sampling updates exceed the tracestate member limit. Remove optional Datadog fields before required fields.

Avoid repeated optional-field classification during overflow pruning. Measured LLMObs overflow injection improves by 10–13% on Node.js 22.23.2.

Tracestate permits 32 vendor members, not 32 fields within each member.
Preserve unknown OTel fields when sampling updates exceed the 256-character
member limit, and remove optional Datadog fields before required fields.

Repeated optional-field classification makes overflow pruning quadratic.
On Node.js 22.23.2, full injection with LLMObs overflow falls from
2.36–2.39 microseconds to 2.09–2.13 microseconds across two fresh processes.
@dd-octo-sts

dd-octo-sts Bot commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

Overall package size

Self size: 8.96 MB
Deduped: 9.69 MB
No deduping: 9.69 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.5.1 | 127.66 kB | 513.61 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

@codecov

codecov Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.71%. Comparing base (b3bb057) to head (3c8ade3).
⚠️ Report is 1 commits behind head on vpellan/otel-threshold-random-value.

Additional details and impacted files
@@                           Coverage Diff                           @@
##           vpellan/otel-threshold-random-value   #10473      +/-   ##
=======================================================================
+ Coverage                                93.00%   98.71%   +5.71%     
=======================================================================
  Files                                     1031     1027       -4     
  Lines                                   162050   160615    -1435     
  Branches                                    74       74              
=======================================================================
+ Hits                                    150714   158554    +7840     
+ Misses                                   11336     2061    -9275     
Flag Coverage Δ
ai-guard 65.19% <59.45%> (+0.37%) ⬆️
apm-capabilities 63.72% <100.00%> (+0.10%) ⬆️
apm-integrations 81.63% <81.08%> (?)
appsec 58.94% <81.08%> (+0.15%) ⬆️
debugger 70.07% <37.61%> (-0.10%) ⬇️
instrumentation 54.42% <81.08%> (-0.06%) ⬇️
llmobs 79.10% <100.00%> (+0.46%) ⬆️
master-coverage ?
openfeature 66.38% <59.45%> (+0.05%) ⬆️
platform 69.43% <65.76%> (+0.09%) ⬆️
profiling 66.65% <37.61%> (-0.06%) ⬇️
serverless 65.99% <81.08%> (+0.26%) ⬆️
test-optimization 82.50% <81.98%> (+0.21%) ⬆️

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.

@datadog-official

datadog-official Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Tests

🎉 All green!

❄️ No new flaky tests detected

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

🎯 Code Coverage (details)
• Patch Coverage: 100.00%
• Overall Coverage: 98.21% (-0.01%)

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

@pr-commenter

pr-commenter Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-09-24 12:22:27

Comparing candidate commit 3c8ade3 in PR branch BridgeAR/2026-09-23-pr10117-stacked with baseline commit b3bb057 in branch vpellan/otel-threshold-random-value.

📊 Benchmarking dashboard

Found 0 performance improvements and 0 performance regressions! Performance is the same for 2323 metrics, 8 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-with-attacks-20

  • unstable max_rss_usage [-16.121MB; +24.080MB] or [-9.426%; +14.080%]

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

  • unstable max_rss_usage [-16.900MB; +20.815MB] or [-4.826%; +5.944%]

scenario:encoders-0.4-immediate-flush-20

  • unstable max_rss_usage [-10.218MB; +1.380MB] or [-13.964%; +1.886%]

scenario:llmobs-encode-unicode-mixed-20

  • unstable max_rss_usage [-10.811MB; +7.621MB] or [-13.850%; +9.763%]

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

  • unstable max_rss_usage [-28769.199KB; +28097.599KB] or [-12.010%; +11.729%]
  • unstable throughput [-15.945op/s; +17.422op/s] or [-4.924%; +5.380%]

scenario:sampling-rule-match-26

  • unstable cpu_user_time [-93.653ms; +103.277ms] or [-5.272%; +5.814%]
  • unstable execution_time [-92.733ms; +100.312ms] or [-5.178%; +5.601%]

Standalone AppSec uses the propagated trace source to retain a keep decision downstream. When an optional tag overflows W3C tracestate, pruning that source resets the extracted sampling priority and can drop the security trace.

LLMObs application and session attribution must remain together. Pruning only one would change downstream grouping.
Comment thread packages/dd-trace/src/opentracing/propagation/tracestate.js

@vpellan vpellan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM with a comment

@BridgeAR
BridgeAR marked this pull request as ready for review September 25, 2026 11:17
@BridgeAR
BridgeAR requested review from a team as code owners September 25, 2026 11:17
@BridgeAR
BridgeAR requested review from khanayan123 and removed request for a team September 25, 2026 11:17
@BridgeAR
BridgeAR merged commit 5ae63fe into vpellan/otel-threshold-random-value Sep 25, 2026
767 of 771 checks passed
@BridgeAR
BridgeAR deleted the BridgeAR/2026-09-23-pr10117-stacked branch September 25, 2026 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants