mirror of https://github.com/linkerd/linkerd2.git
Unregister prom gauges when recycling cluster watcher Fixes #11839 When in `restartClusterWatcher` we fail to connect to the target cluster for whatever reason, the function gets called again 10s later, and tries to register the same prometheus metrics without unregistering them first, which generates warnings. The problem lies in `NewRemoteClusterServiceWatcher`, which instantiates the remote kube-api client and registers the metrics, returning a nil object if the client can't connect. `cleanupWorkers` at the beginning of `restartClusterWatcher` won't unregister those metrics because of that nil object. To fix this, gauges are unregistered on error. |
||
|---|---|---|
| .. | ||
| cluster_watcher.go | ||
| cluster_watcher_headless.go | ||
| cluster_watcher_mirroring_test.go | ||
| cluster_watcher_test_util.go | ||
| events_formatting.go | ||
| jittered_ticker.go | ||
| metrics.go | ||
| probe_worker.go | ||