Class RuleBasedRoutingSamplerBuilder

java.lang.Object
io.opentelemetry.contrib.sampler.RuleBasedRoutingSamplerBuilder

public final class RuleBasedRoutingSamplerBuilder extends Object
  • Method Details

    • drop

      @CanIgnoreReturnValue public RuleBasedRoutingSamplerBuilder drop(io.opentelemetry.api.common.AttributeKey<String> attributeKey, String pattern)
      Drop all spans when the value of the provided AttributeKey matches the provided pattern.
    • customize

      @CanIgnoreReturnValue public RuleBasedRoutingSamplerBuilder customize(io.opentelemetry.api.common.AttributeKey<String> attributeKey, String pattern, io.opentelemetry.sdk.trace.samplers.Sampler sampler)
      Use the provided sampler when the value of the provided AttributeKey matches the provided pattern.
    • recordAndSample

      @CanIgnoreReturnValue public RuleBasedRoutingSamplerBuilder recordAndSample(io.opentelemetry.api.common.AttributeKey<String> attributeKey, String pattern)
      Record and sample all spans when the value of the provided AttributeKey matches the provided pattern.
    • build

      public RuleBasedRoutingSampler build()
      Build the sampler based on the rules provided.