consistent

package module
v0.20.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 10 Imported by: 5

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

func SemVersion() string

SemVersion is the semantic version to be supplied to tracer/meter creation.

Deprecated: Use Version instead.

func Version

func Version() string

Version is the current release version of the consistent probability sampler.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL