opentelemetry-rust icon indicating copy to clipboard operation
opentelemetry-rust copied to clipboard

[Feature] New consistent samplers implementation

Open jmacd opened this issue 2 months ago • 2 comments

Problem Statement

https://github.com/jmacd/rust-sampler contains a prototype implementation of the OTEP-235 and OTEP-250 drafts which are now SDK sampling specifications.

Proposed Solution

The PR above serves as a reference for the complete scope of work. It's too large to submit as one PR, there are 4+ separate topic areas:

  • randomness handling
  • tracestate handling
  • consistent probability sampler
  • composable samplers

Alternatives

This work is available for contributors to pick up.

Prior Art

There are Java, Golang, Python, Javascript implementations as well that we can study.

Additional Context

The probability sampling specification: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/tracestate-probability-sampling.md

Tracestate handling: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/tracestate-handling.md

New probability sampler: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/sdk.md#probabilitysampler

Composite/composable samplers: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/sdk.md#compositesampler

jmacd avatar Oct 09 '25 16:10 jmacd

Hey @jmacd thanks for raising this! @cijothomas figure this'll be a big piece of work to impl and to integrate; what's your view on how we handle this?

scottgerring avatar Oct 16 '25 07:10 scottgerring

This should be pretty much additive components (new sampler). I don't see any integration challenges given these are new components.

cijothomas avatar Oct 30 '25 17:10 cijothomas