Class RequestSampler

java.lang.Object
org.opensearch.telemetry.tracing.sampler.RequestSampler
All Implemented Interfaces:
io.opentelemetry.sdk.trace.samplers.Sampler

public class RequestSampler extends Object implements io.opentelemetry.sdk.trace.samplers.Sampler
RequestSampler based on HeadBased sampler
  • Constructor Summary

    Constructors
    Constructor
    Description
    RequestSampler(io.opentelemetry.sdk.trace.samplers.Sampler fallbackSampler)
    Creates request sampler which applies based on all applicable sampler
  • 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)
     
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • RequestSampler

      public RequestSampler(io.opentelemetry.sdk.trace.samplers.Sampler fallbackSampler)
      Creates request sampler which applies based on all applicable sampler
      Parameters:
      fallbackSampler - Sampler
  • Method Details

    • 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