otel

package
v1.4.0 Latest Latest
Warning

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

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

Documentation

Overview

Package otel wires the reference observability stack (tech baseline §15): OTLP trace/metric/log exporters configured through the standard OTEL_* environment variables, plus a bounded async slog → OTel log bridge. Without an OTLP endpoint the providers stay no-ops, so every binary can initialize unconditionally and only emit telemetry when the reference stack is up.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Shutdown

type Shutdown func(context.Context) error

Shutdown flushes and closes all exporters.

func Init

func Init(ctx context.Context) (Shutdown, error)

Init configures the global tracer/meter/logger providers from the standard environment:

OTEL_EXPORTER_OTLP_ENDPOINT  OTLP/gRPC endpoint (e.g. 127.0.0.1:4317)
OTEL_SERVICE_NAME            service name (default: fenced)
OTEL_SDK_DISABLED            set to disable telemetry entirely

When the endpoint is unset the providers remain the SDK no-ops and slog keeps its console handler; the returned shutdown is then a no-op.

Jump to

Keyboard shortcuts

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