Class ProbabilityBasedSampler
- java.lang.Object
-
- brave.sampler.Sampler
-
- org.springframework.cloud.sleuth.brave.sampler.ProbabilityBasedSampler
-
public class ProbabilityBasedSampler extends brave.sampler.SamplerThis sampler is appropriate for low-traffic instrumentation (ex servers that each receive less than 100K requests), or those who do not provision random trace ids. It not appropriate for collectors as the sampling decision isn't idempotent (consistent based on trace id). ImplementationTaken from CountingTraceIdSampler class from Zipkin project.
This counts to see how many out of 100 traces should be retained. This means that it is accurate in units of 100 traces.- Since:
- 1.0.0
- Author:
- Marcin Grzejszczak, Adrian Cole
-
-
Constructor Summary
Constructors Constructor Description ProbabilityBasedSampler(Supplier<Float> probability)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisSampled(long traceId)
-