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 SamplingResultEMPTY_NOT_SAMPLED_OR_RECORDED_SAMPLING_RESULT(package private) static SamplingResultEMPTY_RECORDED_AND_SAMPLED_SAMPLING_RESULT(package private) static SamplingResultEMPTY_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 SamplingResultcreateSamplingResult(SamplingDecision decision, Attributes attributes)private static SamplingResultcreateWithoutAttributes(SamplingDecision decision)abstract AttributesgetAttributes()Return tags which will be attached to the span.abstract SamplingDecisiongetDecision()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:SamplingResultReturn decision on whether a span should be recorded, recorded and sampled or not recorded.- Specified by:
getDecisionin interfaceSamplingResult- Returns:
- sampling result.
-
getAttributes
public abstract Attributes getAttributes()
Description copied from interface:SamplingResultReturn tags which will be attached to the span.- Specified by:
getAttributesin interfaceSamplingResult- Returns:
- attributes added to span. These attributes should be added to the span only when
the sampling decision is
SamplingDecision.RECORD_ONLYorSamplingDecision.RECORD_AND_SAMPLE.
-
-