Package io.opentelemetry.contrib.sampler
Class RuleBasedRoutingSamplerBuilder
java.lang.Object
io.opentelemetry.contrib.sampler.RuleBasedRoutingSamplerBuilder
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Build the sampler based on the rules provided.customize(io.opentelemetry.api.common.AttributeKey<String> attributeKey, String pattern, io.opentelemetry.sdk.trace.samplers.Sampler sampler) Use the provided sampler when the value of the providedAttributeKeymatches the provided pattern.Drop all spans when the value of the providedAttributeKeymatches the provided pattern.recordAndSample(io.opentelemetry.api.common.AttributeKey<String> attributeKey, String pattern) Record and sample all spans when the value of the providedAttributeKeymatches the provided pattern.
-
Method Details
-
drop
@CanIgnoreReturnValue public RuleBasedRoutingSamplerBuilder drop(io.opentelemetry.api.common.AttributeKey<String> attributeKey, String pattern) Drop all spans when the value of the providedAttributeKeymatches the provided pattern. -
customize
@CanIgnoreReturnValue public RuleBasedRoutingSamplerBuilder customize(io.opentelemetry.api.common.AttributeKey<String> attributeKey, String pattern, io.opentelemetry.sdk.trace.samplers.Sampler sampler) Use the provided sampler when the value of the providedAttributeKeymatches the provided pattern. -
recordAndSample
@CanIgnoreReturnValue public RuleBasedRoutingSamplerBuilder recordAndSample(io.opentelemetry.api.common.AttributeKey<String> attributeKey, String pattern) Record and sample all spans when the value of the providedAttributeKeymatches the provided pattern. -
build
Build the sampler based on the rules provided.
-