Module brave.http
Package brave.http

Class HttpRuleSampler


  • public final class HttpRuleSampler
    extends HttpSampler
    Assigns sample rates to http routes.

    Ex. Here's a sampler that traces 80% requests to /foo and 10% of POST requests to /bar. Other requests will use a global rate provided by the tracing component.

    
     httpTracingBuilder.serverSampler(HttpRuleSampler.newBuilder()
       .addRule(null, "/foo", 0.8f)
       .addRule("POST", "/bar", 0.1f)
       .build());
     

    Note that the path is a prefix, so "/foo" will match "/foo/abcd".