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