Interface ComposableSampler


public interface ComposableSampler
A sampler that can be composed to make a final sampling decision.
  • Method Details

    • alwaysOff

      static ComposableSampler alwaysOff()
      Returns a ComposableSampler that does not sample any span.
    • alwaysOn

      static ComposableSampler alwaysOn()
      Returns a ComposableSampler that samples all spans.
    • traceIdRatioBased

      static ComposableSampler traceIdRatioBased(double ratio)
      Returns a ComposableSampler that samples each span with a fixed ratio.
    • parentThreshold

      static ComposableSampler parentThreshold(ComposableSampler rootSampler)
      Returns a ComposableSampler that respects the sampling decision of the parent span or falls back to the given sampler if it is a root span.
    • getSamplingIntent

      SamplingIntent getSamplingIntent(io.opentelemetry.context.Context parentContext, String traceId, String name, io.opentelemetry.api.trace.SpanKind spanKind, io.opentelemetry.api.common.Attributes attributes, List<io.opentelemetry.sdk.trace.data.LinkData> parentLinks)
      Returns the SamplingIntent to use to make a sampling decision.
    • getDescription

      String getDescription()
      Returns a description of the sampler implementation.