Skip to content

Commit

Permalink
improved java doc, explicit passing of invalid p-value to root sampler (
Browse files Browse the repository at this point in the history
  • Loading branch information
oertl committed Sep 25, 2023
1 parent 5ad1035 commit 105e50c
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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;
}
Expand Down

0 comments on commit 105e50c

Please sign in to comment.