trace

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package trace defines stable trace configuration and sampling policies.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSampler

func NewSampler(config Config) (trace.Sampler, error)

NewSampler constructs a standard OpenTelemetry SDK sampler.

Types

type Config

type Config struct {
	Mode        Mode
	Ratio       float64
	ParentBased bool
}

Config describes a sampler without replacing the OpenTelemetry sampler API.

type Mode

type Mode string

Mode selects the root-span sampling strategy.

const (
	// ModeAlwaysOn samples every root span.
	ModeAlwaysOn Mode = "always_on"
	// ModeAlwaysOff drops every root span.
	ModeAlwaysOff Mode = "always_off"
	// ModeRatio deterministically samples a ratio of trace IDs.
	ModeRatio Mode = "ratio"
)

Jump to

Keyboard shortcuts

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