Package io.opentelemetry.contrib.sampler
Class LinksBasedSampler
java.lang.Object
io.opentelemetry.contrib.sampler.LinksBasedSampler
- All Implemented Interfaces:
io.opentelemetry.sdk.trace.samplers.Sampler
public final class LinksBasedSampler
extends Object
implements io.opentelemetry.sdk.trace.samplers.Sampler
A Sampler that uses the sampled flag of the span links if present. If at least one span link is
sampled, then this span will be sampled. Otherwise, it is not sampled. If the span has no span
links, this Sampler will use the "root" sampler that it is built with.
-
Method Summary
Modifier and TypeMethodDescriptionstatic LinksBasedSamplercreate(io.opentelemetry.sdk.trace.samplers.Sampler root) 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
-
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
-