Skip to content

feat(tracing): add OpenTelemetry tracestate sampling - #354

Draft
MilanGarnier wants to merge 1 commit into
mainfrom
milan.garnier/otel-tracestate-ot-th
Draft

feat(tracing): add OpenTelemetry tracestate sampling#354
MilanGarnier wants to merge 1 commit into
mainfrom
milan.garnier/otel-tracestate-ot-th

Conversation

@MilanGarnier

@MilanGarnier MilanGarnier commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Description (TODO)

Add ot tracestate support for OpenTelemetry consistent probability sampling.

Motivation

Maintain compatible sampling decisions across services.

Additional Notes

Valid inherited sampling values are preserved; malformed values are dropped.

Jira ticket: APMAPI-2180

@pr-commenter

pr-commenter Bot commented Aug 14, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-08-14 12:53:30

Comparing candidate commit 3c6394e in PR branch milan.garnier/otel-tracestate-ot-th with baseline commit 765983d in branch main.

Found 3 performance improvements and 2 performance regressions! Performance is the same for 3 metrics, 0 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:BM_HexPadded_uint64/WorstCasePadding

  • 🟥 execution_time [+1.322ns; +1.402ns] or [+2.755%; +2.921%]

scenario:BM_TraceID_HexPadded/NoPadding

  • 🟥 execution_time [+4.134ns; +5.084ns] or [+2.102%; +2.585%]

scenario:BM_TraceID_ParseHex/128bit

  • 🟩 execution_time [-50.915ns; -50.866ns] or [-29.478%; -29.450%]

scenario:BM_TraceID_ParseHex/64bit

  • 🟩 execution_time [-22.488ns; -22.473ns] or [-24.512%; -24.497%]

scenario:BM_TraceTinyCCSource

  • 🟩 execution_time [-2.254ms; -2.000ms] or [-2.899%; -2.573%]

@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Aug 14, 2026

Copy link
Copy Markdown

🎯 Code Coverage (details)
Patch Coverage: 96.32%
Overall Coverage: 84.76% (+0.28%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 3c6394e | Docs | Datadog PR Page | Give us feedback!

@MilanGarnier
MilanGarnier force-pushed the milan.garnier/otel-tracestate-ot-th branch 2 times, most recently from 0bbacfe to e6c71eb Compare August 14, 2026 12:42
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.

1 participant