Class SessionIdRatioBasedSampler

  • All Implemented Interfaces:
    io.opentelemetry.sdk.trace.samplers.Sampler , java.io.Closeable , java.lang.AutoCloseable

    
    public final class SessionIdRatioBasedSampler
     implements Sampler
                        

    Session ID ratio based sampler. Uses Sampler.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 io.opentelemetry.api.trace.TraceId.fromLongs internally to generate random session IDs.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • 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

        close, shutdown
      • Methods inherited from class java.lang.Object

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

      • SessionIdRatioBasedSampler

        SessionIdRatioBasedSampler(Double ratio, SessionProvider sessionProvider)