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

+6 -1
View File
@@ -21,10 +21,15 @@ import (
// startGRPC serves a grpc.health.v1 service backed by h over an in-memory
// connection, with both server and client instrumented by ic.
func startGRPC(t *testing.T, h *Health, ic *GRPCInterceptors) healthpb.HealthClient {
t.Helper()
return startGRPCServer(t, h.GRPCServer(), ic)
}
func startGRPCServer(t *testing.T, impl healthpb.HealthServer, ic *GRPCInterceptors) healthpb.HealthClient {
t.Helper()
ln := bufconn.Listen(1 << 20)
srv := grpc.NewServer(ic.ServerOptions()...)
healthpb.RegisterHealthServer(srv, h.GRPCServer())
healthpb.RegisterHealthServer(srv, impl)
go func() { _ = srv.Serve(ln) }()
t.Cleanup(srv.Stop)