java.lang.Object
io.opentelemetry.sdk.extension.incubator.trace.samplers.CompositeSampler
All Implemented Interfaces:
io.opentelemetry.sdk.trace.samplers.Sampler, Closeable, AutoCloseable

public final class CompositeSampler extends Object implements io.opentelemetry.sdk.trace.samplers.Sampler
A sampler that uses a ComposableSampler to make its sampling decisions while handlign tracestate.
  • Method Summary

    Modifier and Type
    Method
    Description
     
    io.opentelemetry.sdk.trace.samplers.SamplingResult
    shouldSample(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)
     
     
    static io.opentelemetry.sdk.trace.samplers.Sampler
    Returns a new composite Sampler that delegates to the given ComposableSampler.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface io.opentelemetry.sdk.trace.samplers.Sampler

    close, shutdown
  • Method Details

    • wrap

      public static io.opentelemetry.sdk.trace.samplers.Sampler wrap(ComposableSampler delegate)
      Returns a new composite Sampler that delegates to the given ComposableSampler.
    • shouldSample

      public io.opentelemetry.sdk.trace.samplers.SamplingResult shouldSample(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)
      Specified by:
      shouldSample in interface io.opentelemetry.sdk.trace.samplers.Sampler
    • getDescription

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

      public String toString()
      Overrides:
      toString in class Object