diff --git a/consistent-sampling/src/main/java/io/opentelemetry/contrib/sampler/consistent/ConsistentParentBasedSampler.java b/consistent-sampling/src/main/java/io/opentelemetry/contrib/sampler/consistent/ConsistentParentBasedSampler.java index 94d70b187..0a3c93c28 100644 --- a/consistent-sampling/src/main/java/io/opentelemetry/contrib/sampler/consistent/ConsistentParentBasedSampler.java +++ b/consistent-sampling/src/main/java/io/opentelemetry/contrib/sampler/consistent/ConsistentParentBasedSampler.java @@ -10,9 +10,8 @@ import javax.annotation.concurrent.Immutable; /** - * A consistent sampler that makes the same sampling decision as the parent and optionally falls - * back to an alternative consistent sampler, if the parent p-value is invalid (like for root - * spans). + * A consistent sampler that makes the same sampling decision as the parent. For root spans, the + * sampling decision is delegated to the root sampler. */ @Immutable final class ConsistentParentBasedSampler extends ConsistentSampler { @@ -38,7 +37,7 @@ final class ConsistentParentBasedSampler extends ConsistentSampler { @Override protected int getP(int parentP, boolean isRoot) { if (isRoot) { - return rootSampler.getP(parentP, isRoot); + return rootSampler.getP(OtelTraceState.getInvalidP(), isRoot); } else { return parentP; }