Files
obsx/doc.go
T
Aleksey ShakhmatovandClaude 2c83b28342
CI / test (push) Successful in 1m17s
Publish / publish (push) Successful in 1m24s
Release v1.0.0: HTTP instrumentation, slog correlation, TLS by default
Add HTTPMiddleware, HTTPTransport and LogHandler; extend TracerConfig with
Insecure, Headers and Attributes; install W3C propagators; parent-based
sampling; end-to-end OTLP export tests; update dependencies (Go 1.26).

Breaking since v0.2.0: the OTLP connection uses TLS unless Insecure is set.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-11-10 20:20:09 +03:00

29 lines
949 B
Go

// Package obsx wires observability into a Go service: tracing (OpenTelemetry),
// metrics (Prometheus) and trace-correlated logs (log/slog).
//
// # Quick Start
//
// // Tracing: global tracer provider + W3C propagation
// shutdown, err := obsx.SetupTracer(ctx, obsx.TracerConfig{
// ServiceName: "my-service",
// Endpoint: "localhost:4317",
// Insecure: true,
// })
// defer shutdown(ctx)
//
// // Logs carry trace_id / span_id
// slog.SetDefault(slog.New(obsx.LogHandler(slog.NewJSONHandler(os.Stderr, nil))))
//
// // Metrics
// metrics := obsx.NewMetrics(obsx.MetricsConfig{Namespace: "myapp"})
// mux.Handle("GET /metrics", metrics.Handler())
//
// // HTTP server spans + request metrics, and traced outgoing calls
// handler := obsx.HTTPMiddleware(metrics)(mux)
// client := &http.Client{Transport: obsx.HTTPTransport(nil)}
//
// # Stability
//
// The package follows semantic versioning; the v1 API is stable.
package obsx