public abstract class CollectorSampler extends Object
Debug
spans are always stored.
Accepts a percentage of trace ids by comparing their absolute value against a potentially
dynamic boundary. eg isSampled == abs(traceId) <= boundary
While idempotent, this implementation's sample rate won't exactly match the input rate because
trace ids are not perfectly distributed across 64bits. For example, tests have shown an error
rate of 3% when 100K trace ids are random
.
Modifier and Type | Field and Description |
---|---|
static CollectorSampler |
ALWAYS_SAMPLE |
Modifier | Constructor and Description |
---|---|
protected |
CollectorSampler() |
Modifier and Type | Method and Description |
---|---|
protected abstract long |
boundary() |
static CollectorSampler |
create(float rate) |
boolean |
isSampled(Span span)
Returns true if the span should be recorded to storage.
|
String |
toString() |
public static final CollectorSampler ALWAYS_SAMPLE
public static CollectorSampler create(float rate)
rate
- minimum sample rate is 0.0001, or 0.01% of tracesprotected abstract long boundary()
public boolean isSampled(Span span)
Zipkin v1 allows storage-layer sampling, which can help prevent spikes in traffic from
overloading the system. Debug
spans are always stored.
Copyright © 2015–2016 OpenZipkin. All rights reserved.