Package brave.http

Class HttpRuleSampler.Builder

  • Enclosing class:
    HttpRuleSampler

    public static final class HttpRuleSampler.Builder
    extends Object
    Since:
    4.4
    • Method Detail

      • putRule

        public HttpRuleSampler.Builder putRule​(brave.sampler.Matcher<HttpRequest> matcher,
                                               brave.sampler.Sampler sampler)
        Adds or replaces the sampler for the matcher.

        Ex.

        
         import static brave.http.HttpRequestMatchers.pathStartsWith;
        
         builder.putRule(pathStartsWith("/api"), RateLimitingSampler.create(10));
         
        Since:
        5.8