public class MinConditionalSampler extends CompositeSampler
CompositeSampler that runs a pre-check to determine if a span is
eligible for sampling. This implementation needs span to meet the minimum duration threshold
to be considered for sampling, otherwise span is discarded.| Constructor and Description |
|---|
MinConditionalSampler(java.util.List<Sampler> samplers,
long minimumDurationMillis)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
sample(java.lang.String operationName,
long traceId,
long duration)
Gets whether a span should be allowed given it's operation and trace id.
|
void |
setMinimumDurationMillis(long minimumDurationMillis)
Sets the minimum duration for this sampler.
|
isEarlypublic MinConditionalSampler(java.util.List<Sampler> samplers, long minimumDurationMillis)
samplers - The list of samplers to delegate to if the minimum duration
condition is met.minimumDurationMillis - The minimum duration in milliseconds. Spans with durations lesser
than this are discarded.public boolean sample(java.lang.String operationName,
long traceId,
long duration)
sample in interface Samplersample in class CompositeSampleroperationName - The operation name of the spantraceId - The traceId of the spanduration - The duration of the span in millisecondspublic void setMinimumDurationMillis(long minimumDurationMillis)
minimumDurationMillis - The minimum duration in milliseconds.Copyright © 2023. All rights reserved.