Documentation ¶
Overview ¶
Package consistent provides a consistent probability based sampler.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParentProbabilityBased ¶
func ParentProbabilityBased(root sdktrace.Sampler, samplers ...sdktrace.ParentBasedSamplerOption) sdktrace.Sampler
ParentProbabilityBased is an implementation of the OpenTelemetry Trace Sampler interface that provides additional checks for tracestate Probability Sampling fields.
func ProbabilityBased ¶
func ProbabilityBased(fraction float64, opts ...ProbabilityBasedOption) sdktrace.Sampler
ProbabilityBased samples a given fraction of traces. Based on the OpenTelemetry specification, this Sampler supports only power-of-two fractions. When the input fraction is not a power of two, it will be rounded down. - Fractions >= 1 will always sample. - Fractions < 2^-62 are treated as zero.
This Sampler sets the OpenTelemetry tracestate p-value and/or r-value.
To respect the parent trace's `SampledFlag`, this sampler should be used as the root delegate of a `Parent` sampler.
func SemVersion
deprecated
Types ¶
type ProbabilityBasedOption ¶
type ProbabilityBasedOption interface {
// contains filtered or unexported methods
}
ProbabilityBasedOption is an option to the ConssitentProbabilityBased sampler.
func WithRandomSource ¶
func WithRandomSource(source rand.Source) ProbabilityBasedOption
WithRandomSource sets the source of the randomness used by the Sampler.