public final class HttpRuleSampler extends HttpSampler
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".
| Modifier and Type | Class | Description |
|---|---|---|
static class |
HttpRuleSampler.Builder |
NEVER_SAMPLE, TRACE_ID| Modifier and Type | Method | Description |
|---|---|---|
static HttpRuleSampler.Builder |
newBuilder() |
|
<Req> java.lang.Boolean |
trySample(HttpAdapter<Req,?> adapter,
Req request) |
Returns an overriding sampling decision for a new trace.
|
public static HttpRuleSampler.Builder newBuilder()
public <Req> java.lang.Boolean trySample(HttpAdapter<Req,?> adapter, Req request)
HttpSamplertrace ID sampler.trySample in class HttpSamplerCopyright © 2018 OpenZipkin. All rights reserved.