Skip to content

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

Merged
MilanGarnier merged 20 commits into
mainfrom
milan.garnier/otel-tracestate-ot-th
Aug 25, 2026
Merged

feat(tracing): add OpenTelemetry tracestate sampling#354
MilanGarnier merged 20 commits into
mainfrom
milan.garnier/otel-tracestate-ot-th

Conversation

@MilanGarnier

@MilanGarnier MilanGarnier commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds W3C tracestate support for OpenTelemetry ot sampling state.

  • Parses ot separately from Datadog and other vendor state.
  • Retains valid inherited state, drops malformed rv and th values, and writes sampling values for eligible local probability decisions.
  • Carries W3C state only when it belongs to the selected matching trace.

Testing

  • cmake --build .build -j
  • ./.build/test/tests

@pr-commenter

pr-commenter Bot commented Aug 14, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-08-25 17:30:06

Comparing candidate commit 43d047f in PR branch milan.garnier/otel-tracestate-ot-th with baseline commit 0642d9d in branch main.

Found 0 performance improvements and 2 performance regressions! Performance is the same for 6 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/NoPadding

  • 🟥 execution_time [+2.369ns; +2.424ns] or [+4.476%; +4.582%]

scenario:BM_HexPadded_uint64/WorstCasePadding

  • 🟥 execution_time [+2.038ns; +2.193ns] or [+4.278%; +4.603%]

@datadog-datadog-prod-us1

This comment has been minimized.

@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
@MilanGarnier
MilanGarnier force-pushed the milan.garnier/otel-tracestate-ot-th branch from 93fdd98 to cb6e08f Compare August 17, 2026 09:45
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