Skip to content

New component: pkg/sampling #29738

@jmacd

Description

@jmacd

The purpose and use-cases of the new component

New pkg/sampling component will contain common library code for:

  1. Parsing a W3C tracestate header
  2. APIs for extracting modifying, interpreting an OpenTelemetry tracestate header
  3. APIs for Threshold, Randomness, conversion to/from probability values
  4. Consistent probability sampling mechanism using all of the above.

Example configuration for the component

No direct configuration in yaml. This module supports a strictly defined translation between IEEE 754 floating point values and so-called "Threshold" values.

A simple component that uses this library (e.g., probabilisticsamplerprocessor) will extract probabilities from yaml configuration and convert them into a Threshold value using one of two methods:

  1. ProbabilityToThreshold: exact translation from floating point to threshold, preserves all significant bits, in which case Threshold-to-Probability is an exact round trip.
  2. ProbabilityToThresholdWithPrecision: approximate translation from floating point to threshold, will round probability value to limit the encoding size, in which case Threshold-to-Probability is not a round trip.

Telemetry data types supported

Tracing receives direct support, in the sense that Randomness can be extracted from pcommon.TraceID. However, the Randomness type can be used directly and this package may be extended to apply consistent probability sampling to other data types.

Is this a vendor-specific component?

  • This is a vendor-specific component
  • If this is a vendor-specific component, I am proposing to contribute and support it as a representative of the vendor.

Code Owner(s)

jmacd, kentquirk

Sponsor (optional)

codeboten

Additional context

This implements the draft specification proposal in open-telemetry/oteps#235
This implements the already-specified rules for tracestate handling: https://opentelemetry.io/docs/specs/otel/trace/tracestate-handling/

This is one step in an umbrella issue, the overall goal is stated here: open-telemetry/opentelemetry-specification#1413

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions