tracing

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 21 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	OTLPGRPC = "otlpgrpc"
	OTLPHTTP = "otlphttp"
	Stdout   = "stdout"
)

Exporter names; each is registered by the matching exporters/ subpackage's init().

Variables

This section is empty.

Functions

func Register

func Register(name string, f Factory)

Register panics on a duplicate name; call it from init().

Types

type Factory

type Factory func(ctx context.Context, config []byte) (sdktrace.SpanExporter, error)

Factory strict-decodes its own config block (raw YAML, nil when absent) and must fail on unknown keys.

type Manager

type Manager interface {
	model.Tracer
	// no common.Readiness on purpose: a dead collector must not gate dependents
	common.Liveness
	common.Initializable
	common.Daemon
	common.Debuggable
}

func New

func New(opts ...Option) Manager

type Option

type Option func(*manager)

func WithEnabled

func WithEnabled(enabled bool) Option

WithEnabled is overridden by tracing.enabled on every Init.

func WithExporter

func WithExporter(name string, config map[string]any) Option

WithExporter does not enable tracing. Init replaces it with tracing.exporter and tracing.config, so a key the config leaves out clears it.

func WithLogger

func WithLogger(logger log.Logger) Option

func WithName

func WithName(name string) Option

WithName also sets the config root Init reads (default tracing.*).

func WithSampleRatio

func WithSampleRatio(ratio float64) Option

WithSampleRatio treats zero as unset; a remote parent's decision still wins.

Directories

Path Synopsis
exporters
model
Package model is the tracing exporter factories' config vocabulary.
Package model is the tracing exporter factories' config vocabulary.
otlpgrpc
Package otlpgrpc registers tracing.OTLPGRPC when blank-imported, keeping grpc out of other binaries.
Package otlpgrpc registers tracing.OTLPGRPC when blank-imported, keeping grpc out of other binaries.
otlphttp
Package otlphttp registers tracing.OTLPHTTP when blank-imported.
Package otlphttp registers tracing.OTLPHTTP when blank-imported.
stdout
Package stdout registers tracing.Stdout when blank-imported, for local development.
Package stdout registers tracing.Stdout when blank-imported, for local development.

Jump to

Keyboard shortcuts

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