obs

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package obs centralizes process observability bootstrap: structured logs, redaction, and the global OpenTelemetry tracer provider.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(ctx context.Context, cfg Config) (func(context.Context) error, error)

Init installs a JSON slog logger with stable service metadata and wires the global OTel tracer provider. String log attributes are redacted before they hit the sink so DSNs and tokens do not leak through operational logs.

Types

type Config

type Config struct {
	Service      string
	Version      string
	OtelExporter string
	OtelEndpoint string
	LogWriter    io.Writer
}

Config carries the process-level observability knobs resolved by the binary edge. LogWriter is injectable so tests can assert the JSON log shape.

type ShutdownFunc

type ShutdownFunc func(context.Context) error

ShutdownFunc adapts Init's shutdown function to agent.TracerProvider for older callsites that still hold the narrow provider interface.

func (ShutdownFunc) Shutdown

func (f ShutdownFunc) Shutdown(ctx context.Context) error

Shutdown flushes and releases the wrapped observability provider.

Jump to

Keyboard shortcuts

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