Add Observer as a single entry point

obsx.New wires logger, tracer provider, metrics, health checks and the
admin server (/metrics, /healthz, /readyz, /buildinfo, /loglevel,
pprof). Adds Track for arbitrary operations, Config.WithEnv overrides,
godoc examples and a runnable example service.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
M.ShakhmatovandClaude Opus 5.5 committed 2026-11-15 16:40:05 +03:00
1 parent 8398e81bc7
commit be4330a9ee
7 files changed
+1087 -1

No files matched your search

+5 -1
View File
@@ -79,11 +79,15 @@ func SetupTracer(ctx context.Context, cfg TracerConfig) (shutdown func(context.C
if err != nil {
return nil, err
}
setGlobalTracing(tp)
return shutdown, nil
}
func setGlobalTracing(tp trace.TracerProvider) {
otel.SetTracerProvider(tp)
otel.SetTextMapPropagator(propagation.NewCompositeTextMapPropagator(
propagation.TraceContext{}, propagation.Baggage{},
))
return shutdown, nil
}
func newTracerProvider(ctx context.Context, cfg TracerConfig) (trace.TracerProvider, func(context.Context) error, error) {