pkg/proxy: add last-queued-timestamp metric

This adds a metric, kubeproxy_sync_proxy_rules_last_queued_timestamp,
that captures the last time a change was queued to be applied to the
proxy. This matches the healthz logic, which fails if a pending change
is stale.

This allows us to write alerts that mirror healthz.

Signed-off-by: Casey Callendrello <cdc@redhat.com>
This commit is contained in:
Casey Callendrello
2020-04-15 16:40:45 +02:00
parent 72cdc8c211
commit 2e1a884bf3
4 changed files with 16 additions and 0 deletions

View File

@@ -736,6 +736,7 @@ func getHnsNetworkInfo(hnsNetworkName string) (*hnsNetworkInfo, error) {
func (proxier *Proxier) Sync() {
if proxier.healthzServer != nil {
proxier.healthzServer.QueuedUpdate()
metrics.SyncProxyRulesLastQueuedTimestamp.SetToCurrentTime()
}
proxier.syncRunner.Run()
}