Class ImmutableSamplingResult
- java.lang.Object
-
- io.opentelemetry.sdk.trace.samplers.ImmutableSamplingResult
-
- All Implemented Interfaces:
SamplingResult
- Direct Known Subclasses:
AutoValue_ImmutableSamplingResult
@Immutable abstract class ImmutableSamplingResult extends java.lang.Object implements SamplingResult
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static SamplingResult
EMPTY_NOT_SAMPLED_OR_RECORDED_SAMPLING_RESULT
(package private) static SamplingResult
EMPTY_RECORDED_AND_SAMPLED_SAMPLING_RESULT
(package private) static SamplingResult
EMPTY_RECORDED_SAMPLING_RESULT
-
Constructor Summary
Constructors Constructor Description ImmutableSamplingResult()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description (package private) static SamplingResult
createSamplingResult(SamplingDecision decision, Attributes attributes)
private static SamplingResult
createWithoutAttributes(SamplingDecision decision)
abstract Attributes
getAttributes()
Return tags which will be attached to the span.abstract SamplingDecision
getDecision()
Return decision on whether a span should be recorded, recorded and sampled or not recorded.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.opentelemetry.sdk.trace.samplers.SamplingResult
getUpdatedTraceState
-
-
-
-
Field Detail
-
EMPTY_RECORDED_AND_SAMPLED_SAMPLING_RESULT
static final SamplingResult EMPTY_RECORDED_AND_SAMPLED_SAMPLING_RESULT
-
EMPTY_NOT_SAMPLED_OR_RECORDED_SAMPLING_RESULT
static final SamplingResult EMPTY_NOT_SAMPLED_OR_RECORDED_SAMPLING_RESULT
-
EMPTY_RECORDED_SAMPLING_RESULT
static final SamplingResult EMPTY_RECORDED_SAMPLING_RESULT
-
-
Method Detail
-
createSamplingResult
static SamplingResult createSamplingResult(SamplingDecision decision, Attributes attributes)
-
createWithoutAttributes
private static SamplingResult createWithoutAttributes(SamplingDecision decision)
-
getDecision
public abstract SamplingDecision getDecision()
Description copied from interface:SamplingResult
Return decision on whether a span should be recorded, recorded and sampled or not recorded.- Specified by:
getDecision
in interfaceSamplingResult
- Returns:
- sampling result.
-
getAttributes
public abstract Attributes getAttributes()
Description copied from interface:SamplingResult
Return tags which will be attached to the span.- Specified by:
getAttributes
in interfaceSamplingResult
- Returns:
- attributes added to span. These attributes should be added to the span only when
the sampling decision is
SamplingDecision.RECORD_ONLY
orSamplingDecision.RECORD_AND_SAMPLE
.
-
-