Help us shape the future of Go! Take the 2026 Go Developer Survey

telemetry

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildLogger added in v0.2.1

func BuildLogger(cfg manifest.Telemetry) *slog.Logger

BuildLogger creates a slog.Logger configured with log level thresholds, output format, sensitive attribute redaction, and OpenTelemetry trace correlation.

Types

type Telemetry

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

Telemetry coordinates structured logging, OpenTelemetry distributed tracing, attribute redaction, and HTTP middleware instrumentation.

func New

func New(cfg manifest.Telemetry) *Telemetry

New initializes an agnostic Telemetry instance from the manifest configuration. It configures a structured logger with trace correlation, binds an OpenTelemetry tracer, and installs W3C TraceContext and Baggage as global text map propagators.

func (*Telemetry) Logger

func (t *Telemetry) Logger() *slog.Logger

Logger returns the configured structured logger.

func (*Telemetry) Middleware

func (t *Telemetry) Middleware(next http.Handler) http.Handler

Middleware wraps an http.Handler with request-level panic recovery, distributed trace propagation, and structured access logging.

func (*Telemetry) StartStepSpan

func (t *Telemetry) StartStepSpan(ctx context.Context, stepType, stepName string) (context.Context, func(err error))

StartStepSpan starts an OpenTelemetry span for an executing pipeline step and returns an updated context.Context along with an end closure to record completion or error status.

func (*Telemetry) Tracer

func (t *Telemetry) Tracer() trace.Tracer

Tracer returns the OpenTelemetry tracer instance.

Jump to

Keyboard shortcuts

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