Enum AlwaysOnSampler
- java.lang.Object
-
- java.lang.Enum<AlwaysOnSampler>
-
- io.opentelemetry.sdk.trace.samplers.AlwaysOnSampler
-
- All Implemented Interfaces:
Sampler,java.io.Serializable,java.lang.Comparable<AlwaysOnSampler>
@Immutable enum AlwaysOnSampler extends java.lang.Enum<AlwaysOnSampler> implements Sampler
-
-
Enum Constant Summary
Enum Constants Enum Constant Description INSTANCE
-
Constructor Summary
Constructors Modifier Constructor Description privateAlwaysOnSampler()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetDescription()Returns the description of thisSampler.SamplingResultshouldSample(Context parentContext, java.lang.String traceId, java.lang.String name, SpanKind spanKind, Attributes attributes, java.util.List<LinkData> parentLinks)Called duringSpancreation to make a sampling samplingResult.java.lang.StringtoString()static AlwaysOnSamplervalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static AlwaysOnSampler[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
INSTANCE
public static final AlwaysOnSampler INSTANCE
-
-
Method Detail
-
values
public static AlwaysOnSampler[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (AlwaysOnSampler c : AlwaysOnSampler.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static AlwaysOnSampler valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
shouldSample
public SamplingResult shouldSample(Context parentContext, java.lang.String traceId, java.lang.String name, SpanKind spanKind, Attributes attributes, java.util.List<LinkData> parentLinks)
Description copied from interface:SamplerCalled duringSpancreation to make a sampling samplingResult.- Specified by:
shouldSamplein interfaceSampler- Parameters:
parentContext- the parent span'sSpanContext. This can beSpanContext.INVALIDif this is a root span.traceId- theTraceIdfor the newSpan. This will be identical to that in the parentContext, unless this is a root span.name- the name of the newSpan.spanKind- theSpanKindof theSpan.attributes-Attributesassociated with the span.parentLinks- the parentLinks associated with the newSpan.- Returns:
- sampling samplingResult whether span should be sampled or not.
-
getDescription
public java.lang.String getDescription()
Description copied from interface:SamplerReturns the description of thisSampler. This may be displayed on debug pages or in the logs.Example: "TraceIdRatioBased{0.000100}"
- Specified by:
getDescriptionin interfaceSampler- Returns:
- the description of this
Sampler.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Enum<AlwaysOnSampler>
-
-