Skip to content

feat(otel): add OTel consistent probability sampling state to spans exported through OTLP - #19794

Draft
vpellan wants to merge 1 commit into
vpellan/otel-threshold-random-value-supportfrom
vpellan/otlp-th-rv-support
Draft

feat(otel): add OTel consistent probability sampling state to spans exported through OTLP#19794
vpellan wants to merge 1 commit into
vpellan/otel-threshold-random-value-supportfrom
vpellan/otlp-th-rv-support

Conversation

@vpellan

@vpellan vpellan commented Aug 20, 2026

Copy link
Copy Markdown

Description

This is a follow up to #19751 and implements the same behaviour but on OTLP

Testing

Locally tested against DataDog/system-tests#7372 (tests/otel/test_tracing_otlp.py::Test_Otlp_**_Ot)
I will update the manifests once this is merged

Risks

Additional Notes

@vpellan vpellan added the AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos label Aug 20, 2026
@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Pipelines  Tests

Unblock PR with BitsAI

⚠️ Warnings

🚦 10 Pipeline jobs failed

DataDog/apm-reliability/dd-trace-py | build linux serverless: [arm64, cp315-cp315, v113741357-d2b8243-manylinux2014_aarch64, 1] — 🔧 Needs a code fix, caused by this PR

View in Datadog · View in GitLab

DataDog/apm-reliability/dd-trace-py | build linux: [amd64, cp315-cp315, v126532274-233089d-musllinux_1_2_x86_64] — 🔧 Needs a code fix, caused by this PR

View in Datadog · View in GitLab

DataDog/apm-reliability/dd-trace-py | build linux: [arm64, cp315-cp315, v113741357-d2b8243-manylinux2014_aarch64] — 🔧 Needs a code fix, caused by this PR

View in Datadog · View in GitLab

View all 10 failed jobs.

ℹ️ Info

No other issues found (see more)

🧪 All tests passed
❄️ No new flaky tests detected

Useful? React with 👍 / 👎

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

@pr-commenter

pr-commenter Bot commented Aug 20, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-08-20 15:41:46

Comparing candidate commit faa25b0 in PR branch vpellan/otlp-th-rv-support with baseline commit d9fdb65 in branch main.

📊 Benchmarking dashboard

Found 0 performance improvements and 9 performance regressions! Performance is the same for 612 metrics, 10 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 ----------------------------------'

scenario:httppropagationinject-ids_only

  • 🟥 execution_time [+2.121µs; +2.289µs] or [+11.043%; +11.920%]

scenario:iastaspects-casefold_noaspect

  • 🟥 execution_time [+24.804µs; +32.281µs] or [+9.955%; +12.956%]

scenario:iastaspectsospath-ospathbasename_aspect

  • 🟥 execution_time [+118.047µs; +124.479µs] or [+28.592%; +30.150%]

scenario:span-start

  • 🟥 execution_time [+1.528ms; +1.667ms] or [+10.134%; +11.060%]

scenario:span-start-finish

  • 🟥 execution_time [+4.457ms; +4.733ms] or [+8.075%; +8.575%]

scenario:span-start-finish-telemetry

  • 🟥 execution_time [+4.739ms; +4.962ms] or [+8.636%; +9.041%]

scenario:span-start-finish-traceid128

  • 🟥 execution_time [+4.543ms; +4.818ms] or [+7.906%; +8.386%]

scenario:telemetryaddmetric-1-count-metric-1-times

  • 🟥 execution_time [+394.654ns; +441.519ns] or [+14.295%; +15.992%]

scenario:tracer-small

  • 🟥 execution_time [+35.337µs; +37.895µs] or [+10.446%; +11.202%]

Unstable benchmarks

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

scenario:coreapiscenario-context_with_data_listeners

  • unstable execution_time [-906.265ns; +586.677ns] or [-8.039%; +5.204%]

scenario:coreapiscenario-core_dispatch_1_listener

  • unstable execution_time [-12.311ns; +57.933ns] or [-2.006%; +9.441%]

scenario:coreapiscenario-core_dispatch_50_listeners

  • unstable execution_time [-1624.148ns; +1687.134ns] or [-9.519%; +9.888%]

scenario:coreapiscenario-core_dispatch_exception_listeners

  • unstable execution_time [-1924.337ns; +621.354ns] or [-14.096%; +4.551%]

scenario:coreapiscenario-core_dispatch_listeners

  • unstable execution_time [-322.042ns; +329.479ns] or [-8.694%; +8.895%]

scenario:coreapiscenario-core_dispatch_no_args_listeners

  • unstable execution_time [-269.774ns; +242.926ns] or [-9.195%; +8.280%]

scenario:coreapiscenario-core_dispatch_with_results_1_listener

  • unstable execution_time [-108.286ns; +44.670ns] or [-8.978%; +3.704%]

scenario:coreapiscenario-core_dispatch_with_results_50_listeners

  • unstable execution_time [-4664.335ns; +3526.147ns] or [-11.240%; +8.497%]

scenario:coreapiscenario-core_dispatch_with_results_listeners

  • unstable execution_time [-833.297ns; +699.684ns] or [-10.180%; +8.547%]

scenario:packagesupdateimporteddependencies-import_many_stdlib_cached

  • unstable execution_time [-66.104µs; +56.701µs] or [-10.190%; +8.740%]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant