tracing

package
v0.0.0-...-54f4ef6 Latest Latest
Warning

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

Go to latest
Published: May 20, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package tracing wires up the OpenTelemetry tracer provider so callers can use the standard otel.Tracer(...) API to create spans.

Callers do not need to know how spans are exported. When tracing is disabled or no exporter is configured, the global tracer provider stays a no-op so otel.Tracer(...) calls remain safe.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(ctx context.Context, cfg Config) (stop func(), err error)

New registers an OpenTelemetry tracer provider on the global otel package and returns a stop function that flushes pending spans.

New is a no-op when cfg.Enabled is false or when no exporter destination is configured.

Types

type Config

type Config struct {
	Enabled bool `hcl:"enabled" help:"Enable distributed tracing." default:"false"`
}

Config holds tracing configuration.

Jump to

Keyboard shortcuts

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