-
- All Implemented Interfaces:
-
io.opentelemetry.sdk.trace.samplers.Sampler
public class SessionIdRatioBasedSampler implements SamplerSession 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.
-
-
Constructor Summary
Constructors Constructor Description SessionIdRatioBasedSampler(double ratio, SessionId sessionId)
-
Method Summary
Modifier and Type Method Description SamplingResultshouldSample(Context parentContext, String traceId, String name, SpanKind spanKind, Attributes attributes, List<LinkData> parentLinks)StringgetDescription()-
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
-
-
Method Detail
-
shouldSample
SamplingResult shouldSample(Context parentContext, String traceId, String name, SpanKind spanKind, Attributes attributes, List<LinkData> parentLinks)
-
getDescription
String getDescription()
-
-
-
-