Class ProbabilisticSampler
java.lang.Object
org.opensearch.telemetry.tracing.sampler.ProbabilisticSampler
- All Implemented Interfaces:
io.opentelemetry.sdk.trace.samplers.Sampler
public class ProbabilisticSampler
extends Object
implements io.opentelemetry.sdk.trace.samplers.Sampler
ProbabilisticSampler implements a probability sampling strategy based on configured sampling ratio.
-
Method Summary
Modifier and TypeMethodDescriptionstatic io.opentelemetry.sdk.trace.samplers.Samplercreate(TelemetrySettings telemetrySettings, Settings settings, io.opentelemetry.sdk.trace.samplers.Sampler fallbackSampler) Create probabilistic sampler.io.opentelemetry.sdk.trace.samplers.SamplingResultshouldSample(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) toString()
-
Method Details
-
create
public static io.opentelemetry.sdk.trace.samplers.Sampler create(TelemetrySettings telemetrySettings, Settings settings, io.opentelemetry.sdk.trace.samplers.Sampler fallbackSampler) Create probabilistic sampler.- Parameters:
telemetrySettings- the telemetry settingssettings- the settingsfallbackSampler- the fallback sampler- Returns:
- the probabilistic sampler
-
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:
shouldSamplein interfaceio.opentelemetry.sdk.trace.samplers.Sampler
-
getDescription
- Specified by:
getDescriptionin interfaceio.opentelemetry.sdk.trace.samplers.Sampler
-
toString
-