OpenTelemetry - is TraceIdRatioBased sampler valid as ParentBased child sampler or not?
11:48 09 Feb 2026

Recently Java's OTEL SDK started showing warnings when TraceIdRatioBased sampler is used for anything in ParentBased sampler (https://github.com/open-telemetry/opentelemetry-java/pull/7937)

However, spec (https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/sdk.md#traceidratiobased) permits that:

It is recommended to use this sampler algorithm only for root spans (in combination with ParentBased) because different language SDKs or even different versions of the same language SDKs may produce inconsistent results for the same input.

Only way to use TraceIdRatioBased in combination with ParentBased is to use it as a child of ParentBased. While using it as remoteParentSampled or localParentSampled may not be the best idea due to insistent results, why using it as root is discouraged?

open-telemetry