sampling

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAdaptiveSampler

func NewAdaptiveSampler(opts ...AdaptiveSamplerOption) trace.Sampler

NewAdaptiveSampler creates a new adaptive sampler.

Types

type AdaptiveSampler

type AdaptiveSampler struct {
	// contains filtered or unexported fields
}

AdaptiveSampler implements adaptive sampling based on span status and duration.

func (*AdaptiveSampler) Description

func (s *AdaptiveSampler) Description() string

Description returns sampler description.

func (*AdaptiveSampler) ShouldSample

ShouldSample implements trace.Sampler interface.

type AdaptiveSamplerOption

type AdaptiveSamplerOption func(*AdaptiveSampler)

AdaptiveSamplerOption configures an adaptive sampler.

func WithBaselineRate

func WithBaselineRate(rate float64) AdaptiveSamplerOption

WithBaselineRate sets the baseline sampling rate (0.0 to 1.0).

func WithErrorRate

func WithErrorRate(rate float64) AdaptiveSamplerOption

WithErrorRate sets the error sampling rate (default 1.0 = 100%).

func WithSlowRate

func WithSlowRate(rate float64) AdaptiveSamplerOption

WithSlowRate sets the slow operation sampling rate (default 1.0 = 100%).

func WithSlowThreshold

func WithSlowThreshold(thresholdNano int64) AdaptiveSamplerOption

WithSlowThreshold sets the slow operation threshold in nanoseconds.

Jump to

Keyboard shortcuts

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