Package 

Class SessionIdRatioBasedSampler

  • All Implemented Interfaces:
    io.opentelemetry.sdk.trace.samplers.Sampler

    
    public class SessionIdRatioBasedSampler
     implements Sampler
                        

    Session ID ratio based sampler. Uses traceIdRatioBased sampler internally, but passes sessionId instead of traceId to the underlying sampler in order to use the same ratio logic but on sessionId instead. This is valid as sessionId uses internally to generate random session IDs.

    • Method Summary

      Modifier and Type Method Description
      SamplingResult shouldSample(Context parentContext, String traceId, String name, SpanKind spanKind, Attributes attributes, List<LinkData> parentLinks)
      String getDescription()
      • Methods inherited from class io.opentelemetry.sdk.trace.samplers.Sampler

        alwaysOff, alwaysOn, getDescription, parentBased, parentBasedBuilder, shouldSample, traceIdRatioBased
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SessionIdRatioBasedSampler

        SessionIdRatioBasedSampler(double ratio, SessionId sessionId)