Package brave.sampler
Class BoundarySampler
java.lang.Object
brave.sampler.Sampler
brave.sampler.BoundarySampler
public final class BoundarySampler extends Sampler
This sampler is appropriate for high-traffic instrumentation (ex edge web servers that each
receive >100K requests) who provision random trace ids, and make the sampling decision only once.
It defends against nodes in the cluster selecting exactly the same ids.
Implementation
This uses modulo 10000 arithmetic, which allows a minimum probability of 0.01%. Trace id collision was noticed in practice in the Twitter front-end cluster. A random salt is here to defend against nodes in the same cluster sampling exactly the same subset of trace ids. The goal was full 64-bit coverage of trace IDs on multi-host deployments.
Based on https://github.com/twitter/finagle/blob/b6b1d0414fa24ed0c8bb5112985a4e9c9bcd3c9e/finagle-zipkin-core/src/main/scala/com/twitter/finagle/zipkin/core/Sampler.scala#L68