Package io.opencensus.trace.samplers
Class AlwaysSampleSampler
- java.lang.Object
-
- io.opencensus.trace.Sampler
-
- io.opencensus.trace.samplers.AlwaysSampleSampler
-
-
Constructor Summary
Constructors Constructor Description AlwaysSampleSampler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getDescription()
Returns the description of thisSampler
.boolean
shouldSample(SpanContext parentContext, java.lang.Boolean hasRemoteParent, TraceId traceId, SpanId spanId, java.lang.String name, java.util.List<Span> parentLinks)
Called duringSpan
creation to make a sampling decision.java.lang.String
toString()
-
-
-
Method Detail
-
shouldSample
public boolean shouldSample(@Nullable SpanContext parentContext, @Nullable java.lang.Boolean hasRemoteParent, TraceId traceId, SpanId spanId, java.lang.String name, java.util.List<Span> parentLinks)
Description copied from class:Sampler
Called duringSpan
creation to make a sampling decision.- Specified by:
shouldSample
in classSampler
- Parameters:
parentContext
- the parent span'sSpanContext
.null
if this is a root span.hasRemoteParent
-true
if the parentSpan
is remote.null
if this is a root span.traceId
- theTraceId
for the newSpan
. This will be identical to that in the parentContext, unless this is a root span.spanId
- theSpanId
for the newSpan
.name
- the name of the newSpan
.parentLinks
- the parentLinks associated with the newSpan
.- Returns:
true
if theSpan
is sampled.
-
getDescription
public java.lang.String getDescription()
Description copied from class:Sampler
Returns the description of thisSampler
. This may be displayed on debug pages or in the logs.Example: "ProbabilitySampler{0.000100}"
- Specified by:
getDescription
in classSampler
- Returns:
- the description of this
Sampler
.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-