Skip to content

Commit aaac96c

Browse files
author
Han Kang
committed
Two bug fixes: (1) at least log something out if we fail to register our health check, (2) actually register a prometheus metric. I delete the deprecated metric in this block because there isn't any point to it, since no one can be broken by changing a metric that doesn't get collected
1 parent 6a4216b commit aaac96c

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

pkg/master/master.go

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -469,15 +469,10 @@ func (m *Master) InstallLegacyAPI(c *completedConfig, restOptionsGetter generic.
469469

470470
func (m *Master) installTunneler(nodeTunneler tunneler.Tunneler, nodeClient corev1client.NodeInterface) {
471471
nodeTunneler.Run(nodeAddressProvider{nodeClient}.externalAddresses)
472-
m.GenericAPIServer.AddHealthChecks(healthz.NamedCheck("SSH Tunnel Check", tunneler.TunnelSyncHealthChecker(nodeTunneler)))
473-
prometheus.NewGaugeFunc(prometheus.GaugeOpts{
474-
Name: "apiserver_proxy_tunnel_sync_duration_seconds",
475-
Help: "The time since the last successful synchronization of the SSH tunnels for proxy requests.",
476-
}, func() float64 { return float64(nodeTunneler.SecondsSinceSync()) })
477-
prometheus.NewGaugeFunc(prometheus.GaugeOpts{
478-
Name: "apiserver_proxy_tunnel_sync_latency_secs",
479-
Help: "(Deprecated) The time since the last successful synchronization of the SSH tunnels for proxy requests.",
480-
}, func() float64 { return float64(nodeTunneler.SecondsSinceSync()) })
472+
err := m.GenericAPIServer.AddHealthChecks(healthz.NamedCheck("SSH Tunnel Check", tunneler.TunnelSyncHealthChecker(nodeTunneler)))
473+
if err != nil {
474+
klog.Errorf("Failed adding ssh tunnel health check %v\n", err)
475+
}
481476
}
482477

483478
// RESTStorageProvider is a factory type for REST storage.

0 commit comments

Comments
 (0)