Skip to content

Implementation of new composable samplers #7485

@jmacd

Description

@jmacd

Problem Statement

#5645 contained the first Go prototype that was used in developing the specification. https://github.com/jmacd/go-sampler contained a second prototype, including the composable samplers.

Proposed Solution

The PR above serves as a reference. 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

If there is interest, I can re-submit this work as a series of PRs.

Prior Art

A prior Sampler implementation,

https://github.com/open-telemetry/opentelemetry-go-contrib/tree/main/samplers/probability/consistent

should be removed as deprecated, is no longer specified. This code contains a functional OpenTelemetry tracestate implementation that we could keep, however note that I took a simpler approach in #5645.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions