Harden instrumentation, health checks and the admin server
CI / test (push) Failing after 43s

- Admin pprof is opt-in (AdminConfig.EnablePprof)
- Client spans drop the URL query string; HostFunc bounds the host label
- Config.HTTP/HTTPClient/GRPC configure the Observer's instrumentation
- A panic after a partial HTTP response counts as 500
- GaugeFunc, CounterFunc and RegisterDBStats panic on duplicates
- Abandoned client gRPC streams are recorded as Canceled
- OTEL_EXPORTER_OTLP_PROTOCOL selects the protocol when unset
- Health reports are cached for 1s; hung checks are not restarted
- Environment is exported as deployment.environment.name

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
M.ShakhmatovandClaude Fable 5.2 committed 2026-11-15 16:56:39 +03:00
1 parent 8647fdf1bb
commit c92fd9826b
21 files changed
+457 -101

No files matched your search

+3 -3
View File
@@ -16,9 +16,9 @@ import (
// GET /buildinfo service name, version, revision, uptime
// GET /loglevel current log level
// PUT /loglevel change log level: body or ?level= "debug", "info", ...
// /debug/pprof/ Go profiling (unless Admin.DisablePprof)
// /debug/pprof/ Go profiling (only with Admin.EnablePprof)
//
// Expose it on an internal port only.
// The handler has no authentication: expose it on an internal address only.
func (o *Observer) AdminHandler() http.Handler {
mux := http.NewServeMux()
mux.Handle("GET /metrics", o.metrics.Handler())
@@ -30,7 +30,7 @@ func (o *Observer) AdminHandler() http.Handler {
})
mux.Handle("/loglevel", LogLevelHandler(o.level, o.logger))
if !o.cfg.Admin.DisablePprof {
if o.cfg.Admin.EnablePprof {
mux.HandleFunc("/debug/pprof/", pprof.Index)
mux.HandleFunc("/debug/pprof/cmdline", pprof.Cmdline)
mux.HandleFunc("/debug/pprof/profile", pprof.Profile)