Skip to content

feat(sampling): Support for OpenTelemetry consistent tracestate sampling - #12397

Draft
MilanGarnier wants to merge 4 commits into
milan.garnier/otel-tracestate-refactorfrom
milan.garnier/ot.th
Draft

feat(sampling): Support for OpenTelemetry consistent tracestate sampling#12397
MilanGarnier wants to merge 4 commits into
milan.garnier/otel-tracestate-refactorfrom
milan.garnier/ot.th

Conversation

@MilanGarnier

@MilanGarnier MilanGarnier commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

What Does This Do

Adds OpenTelemetry consistent probability-sampling behavior on top of the
ot tracestate parsing introduced by #12405.

  • Validates and normalizes rv and th.
  • Generates probability state for loaded agent rates and sampling rules.
  • Preserves inherited randomness and unknown fields across overrides.
  • Keeps limiter outcomes distinct from raw probability decisions.
  • Adds focused parsing, propagation, continuation, and sampling tests.

Motivation

Make Java tracer sampling decisions interoperable with OpenTelemetry
consistent probability sampling and provide the state needed for downstream
tracestate propagation.

Additional Notes

This is the second PR in a two-PR stack and depends on #12405.

This PR covers propagation and sampling only. OTLP export will follow in a
separate change.

Validation after rebasing the stack onto the current master:

  • Focused dd-trace-core propagation and sampling tests passed.
  • :dd-trace-core:compileTraceAgentTestJava passed.
  • :dd-trace-core:spotlessCheck and git diff --check passed.

Prior validation of the feature branch:

  • Java parametric system tests passed with 669 tests passed and 38 skipped.
  • Java default system tests passed all 11 tests.
  • The full :dd-trace-core:test run passed 4,277 of 4,278 tests. The remaining
    timing-sensitive PendingTraceBufferTest case passed in isolation.

Contributor Checklist

  • Format the title according to the contribution guidelines.
  • Assign the required type: and comp: labels.
  • Keep OTLP export outside this propagation-only change.

Jira ticket: APMAPI-2171

@MilanGarnier MilanGarnier added type: feature Enhancements and improvements comp: context propagation Trace context propagation tag: ai generated Largely based on code generated by an AI or LLM labels Sep 3, 2026
@MilanGarnier MilanGarnier changed the title Support OpenTelemetry tracestate sampling feat(sampling): Support for OpenTelemetry consistent tracestate sampling Sep 3, 2026
@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

🎯 Code Coverage (details)
Patch Coverage: 90.12%
Overall Coverage: 57.54% (-1.49%)

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

@dd-octo-sts

dd-octo-sts Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

🟢 Java Benchmark SLOs — All performance SLOs passed

Suite Status
Startup 🟢 pass

SLO thresholds are defined here based on automatically generated metrics. A warning is raised when results are within 5% of the threshold.

PR vs. master results
Scenario Candidate master Δ (95% CI of mean)
startup:insecure-bank:iast:Agent 14.77 s 14.59 s [+0.4%; +2.0%] (maybe worse)
startup:insecure-bank:tracing:Agent 13.61 s 13.70 s [-1.5%; +0.2%] (no difference)
startup:petclinic:appsec:Agent 17.01 s 16.85 s [-0.1%; +2.0%] (no difference)
startup:petclinic:iast:Agent 16.56 s 16.91 s [-6.3%; +2.1%] (no difference)
startup:petclinic:profiling:Agent 16.72 s 16.80 s [-1.6%; +0.6%] (no difference)
startup:petclinic:sca:Agent 17.00 s 16.65 s [+1.1%; +3.0%] (significantly worse)
startup:petclinic:tracing:Agent 15.77 s 15.65 s [-5.1%; +6.7%] (unstable)

Commit: a1686278 · CI Pipeline · Benchmarking Platform UI


Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion.

@MilanGarnier
MilanGarnier changed the base branch from master to milan.garnier/preserve-deterministic-sampler-rate September 3, 2026 13:59
Base automatically changed from milan.garnier/preserve-deterministic-sampler-rate to master September 3, 2026 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: context propagation Trace context propagation tag: ai generated Largely based on code generated by an AI or LLM type: feature Enhancements and improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant