java.lang.Object
org.eclipse.microprofile.telemetry.tracing.tck.spi.TestSampler
All Implemented Interfaces:
io.opentelemetry.sdk.trace.samplers.Sampler

public class TestSampler extends Object implements io.opentelemetry.sdk.trace.samplers.Sampler
A test sampler which looks for the "test.sample.me" attribute to decide whether a span should be sampled
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final io.opentelemetry.api.common.AttributeKey<Boolean>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    io.opentelemetry.sdk.trace.samplers.SamplingResult
    shouldSample(io.opentelemetry.context.Context context, String traceId, String name, io.opentelemetry.api.trace.SpanKind spanKind, io.opentelemetry.api.common.Attributes attributes, List<io.opentelemetry.sdk.trace.data.LinkData> parentLinks)

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • SAMPLE_ME

      public static final io.opentelemetry.api.common.AttributeKey<Boolean> SAMPLE_ME
  • Constructor Details

    • TestSampler

      public TestSampler()
  • Method Details

    • getDescription

      public String getDescription()
      Specified by:
      getDescription in interface io.opentelemetry.sdk.trace.samplers.Sampler
    • shouldSample

      public io.opentelemetry.sdk.trace.samplers.SamplingResult shouldSample(io.opentelemetry.context.Context context, String traceId, String name, io.opentelemetry.api.trace.SpanKind spanKind, io.opentelemetry.api.common.Attributes attributes, List<io.opentelemetry.sdk.trace.data.LinkData> parentLinks)
      Specified by:
      shouldSample in interface io.opentelemetry.sdk.trace.samplers.Sampler