Package brave.sampler

Class ParameterizedSampler<P>

  • Type Parameters:
    P - The type that encloses parameters associated with a sample rate. For example, this could be a pair of http and method.
    All Implemented Interfaces:
    SamplerFunction<P>

    public final class ParameterizedSampler<P>
    extends Object
    implements SamplerFunction<P>
    This is an implementation of how to decide whether to trace a request using ordered rules. For example, you could write rules to look at an HTTP method and path, or a RabbitMQ routing key and queue name.

    This looks at runtime parameters to see if they match a rule. If all calls to a java method should have the same sample rate, consider DeclarativeSampler instead.

    Since:
    4.4
    See Also:
    Matcher