Constructor and Description |
---|
Sampler() |
Modifier and Type | Method and Description |
---|---|
abstract String |
getDescription()
Returns the description of this
Sampler . |
abstract boolean |
shouldSample(SpanContext parentContext,
Boolean hasRemoteParent,
TraceId traceId,
SpanId spanId,
String name,
List<Span> parentLinks)
Called during
Span creation to make a sampling decision. |
public abstract boolean shouldSample(@Nullable SpanContext parentContext, @Nullable Boolean hasRemoteParent, TraceId traceId, SpanId spanId, String name, List<Span> parentLinks)
Span
creation to make a sampling decision.parentContext
- the parent span's SpanContext
. null
if this is a root
span.hasRemoteParent
- true
if the parent Span
is remote. null
if this
is a root span.traceId
- the TraceId
for the new Span
. This will be identical to that in
the parentContext, unless this is a root span.spanId
- the SpanId
for the new Span
.name
- the name of the new Span
.parentLinks
- the parentLinks associated with the new Span
.true
if the Span
is sampled.public abstract String getDescription()
Sampler
. This may be displayed on debug pages or in the
logs.
Example: "ProbabilitySampler{0.000100}"
Sampler
.