Interface ComposableSampler
public interface ComposableSampler
A sampler that can be composed to make a final sampling decision.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ComposableSamplerReturns aComposableSamplerthat does not sample any span.static ComposableSampleralwaysOn()Returns aComposableSamplerthat samples all spans.Returns a description of the sampler implementation.getSamplingIntent(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) Returns theSamplingIntentto use to make a sampling decision.static ComposableSamplerparentThreshold(ComposableSampler rootSampler) Returns aComposableSamplerthat respects the sampling decision of the parent span or falls back to the given sampler if it is a root span.static ComposableSamplertraceIdRatioBased(double ratio) Returns aComposableSamplerthat samples each span with a fixed ratio.
-
Method Details
-
alwaysOff
Returns aComposableSamplerthat does not sample any span. -
alwaysOn
Returns aComposableSamplerthat samples all spans. -
traceIdRatioBased
Returns aComposableSamplerthat samples each span with a fixed ratio. -
parentThreshold
Returns aComposableSamplerthat respects the sampling decision of the parent span or falls back to the given sampler if it is a root span. -
getSamplingIntent
SamplingIntent getSamplingIntent(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) Returns theSamplingIntentto use to make a sampling decision. -
getDescription
String getDescription()Returns a description of the sampler implementation.
-