What are you trying to achieve?**
This issue is to clarify the behavior of the ProbabilitySampler when a TraceID does not have the "Random Trace ID Flag" set and no explicit rv (Random Value) is present in the tracestate.
What did you expect to see?
The specification of ProbabilitySampler should be rectified to not include ot.th if randomness indication is absent.
The Problem
As discussed in the OpenTelemetry-Go repository, there is a discrepancy between the current SDK specification and the intended statistical requirements for proper span metrics extrapolation.
Currently, the ProbabilitySampler SDK specification does not explicitly mandate erasing the threshold (th) when randomness cannot be verified. If a sampler propagates a th value for a non-random TraceID, downstream consumers (like the spanmetricsconnector) may incorrectly apply extrapolation logic (sampling_method=extrapolated), leading to skewed or statistically invalid metrics.
Proposed Change
The specification should be updated to require that the ProbabilitySampler:
- Presume TraceID randomness by default unless an explicit
rv value is provided in the tracestate.
- Explicitly erase/omit the
th value from the tracestate if:
- The TraceID lacks the W3C Random Trace ID Flag.
- AND no
rv value is present in the incoming tracestate.
This ensures that downstream systems has clarity on the statistical nature of the sampled spans and take appropriate action such as treating these spans as simple counts (sampling_method=counted) rather than representative samples.
Additional Context
What are you trying to achieve?**
This issue is to clarify the behavior of the
ProbabilitySamplerwhen a TraceID does not have the "Random Trace ID Flag" set and no explicitrv(Random Value) is present in thetracestate.What did you expect to see?
The specification of
ProbabilitySamplershould be rectified to not includeot.thif randomness indication is absent.The Problem
As discussed in the OpenTelemetry-Go repository, there is a discrepancy between the current SDK specification and the intended statistical requirements for proper span metrics extrapolation.
Currently, the ProbabilitySampler SDK specification does not explicitly mandate erasing the threshold (
th) when randomness cannot be verified. If a sampler propagates athvalue for a non-random TraceID, downstream consumers (like thespanmetricsconnector) may incorrectly apply extrapolation logic (sampling_method=extrapolated), leading to skewed or statistically invalid metrics.Proposed Change
The specification should be updated to require that the
ProbabilitySampler:rvvalue is provided in thetracestate.thvalue from thetracestateif:rvvalue is present in the incomingtracestate.This ensures that downstream systems has clarity on the statistical nature of the sampled spans and take appropriate action such as treating these spans as simple counts (
sampling_method=counted) rather than representative samples.Additional Context