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

Former-commit-id: 20ddbb53823b1a66031a2844b98f0e151dc2644b
This commit is contained in:
Marc Schäfer
2025-10-08 08:12:20 +02:00
parent c5e25d7c36
commit 20fa84208d
+3 -1
View File
@@ -224,7 +224,9 @@ func SetProxyObservableCallback(cb func(context.Context, metric.Observer) error)
reg, e := meter.RegisterCallback(cb, mProxyActiveConns, mProxyBufferBytes, mProxyAsyncBacklogByte)
if e != nil {
otel.Handle(e)
proxyStopper = func() {}
proxyStopper = func() {
// no-op: registration failed; keep stopper callable
}
return
}
// Provide a functional stopper to unregister later if needed