fix(telemetry): update proxyStopper to be a no-op function when registration fails

This commit is contained in:
Marc Schäfer
2025-10-08 08:12:20 +02:00
parent 5cbda35637
commit 20ddbb5382

View File

@@ -224,7 +224,9 @@ func SetProxyObservableCallback(cb func(context.Context, metric.Observer) error)
reg, e := meter.RegisterCallback(cb, mProxyActiveConns, mProxyBufferBytes, mProxyAsyncBacklogByte) reg, e := meter.RegisterCallback(cb, mProxyActiveConns, mProxyBufferBytes, mProxyAsyncBacklogByte)
if e != nil { if e != nil {
otel.Handle(e) otel.Handle(e)
proxyStopper = func() {} proxyStopper = func() {
// no-op: registration failed; keep stopper callable
}
return return
} }
// Provide a functional stopper to unregister later if needed // Provide a functional stopper to unregister later if needed