Enum AlwaysOffSampler

java.lang.Object
java.lang.Enum<AlwaysOffSampler>
io.opentelemetry.sdk.trace.samplers.AlwaysOffSampler
All Implemented Interfaces:
Sampler, Serializable, Comparable<AlwaysOffSampler>, java.lang.constant.Constable

@Immutable enum AlwaysOffSampler extends Enum<AlwaysOffSampler> implements Sampler
  • Enum Constant Details

  • Constructor Details

    • AlwaysOffSampler

      private AlwaysOffSampler()
  • Method Details

    • values

      public static AlwaysOffSampler[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static AlwaysOffSampler valueOf(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:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • shouldSample

      public SamplingResult shouldSample(Context parentContext, String traceId, String name, SpanKind spanKind, Attributes attributes, List<LinkData> parentLinks)
      Description copied from interface: Sampler
      Called during Span creation to make a sampling samplingResult.
      Specified by:
      shouldSample in interface Sampler
      Parameters:
      parentContext - the parent span's SpanContext. This can be SpanContext.INVALID 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.
      name - the name of the new Span.
      spanKind - the SpanKind of the Span.
      attributes - Attributes associated with the span.
      parentLinks - the parentLinks associated with the new Span.
      Returns:
      sampling samplingResult whether span should be sampled or not.
    • getDescription

      public String getDescription()
      Description copied from interface: Sampler
      Returns the description of this Sampler. This may be displayed on debug pages or in the logs.

      Example: "TraceIdRatioBased{0.000100}"

      Specified by:
      getDescription in interface Sampler
      Returns:
      the description of this Sampler.
    • toString

      public String toString()
      Overrides:
      toString in class Enum<AlwaysOffSampler>