Class ProbabilityBasedSampler


  • public class ProbabilityBasedSampler
    extends brave.sampler.Sampler
    This 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). Implementation

    Taken 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 Detail

      • ProbabilityBasedSampler

        public ProbabilityBasedSampler​(Supplier<Float> probability)
    • Method Detail

      • isSampled

        public boolean isSampled​(long traceId)
        Specified by:
        isSampled in class brave.sampler.Sampler