From ff5b65644bcaa7336815e3e9d762f5fb951c25bf Mon Sep 17 00:00:00 2001 From: Spencer Amann Date: Tue, 11 Jul 2023 09:16:05 -0400 Subject: [PATCH] Update comment to reflect requirements of healthz check --- pkg/monitor/cluster/cluster.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/monitor/cluster/cluster.go b/pkg/monitor/cluster/cluster.go index 806d666b129..87d5d50a33e 100644 --- a/pkg/monitor/cluster/cluster.go +++ b/pkg/monitor/cluster/cluster.go @@ -137,7 +137,7 @@ func (mon *Monitor) Monitor(ctx context.Context) (errs []error) { }) } - // If API is not returning 200, fallback to checking ping and short circuit the rest of the checks + //this API server healthz check must be first, our geneva monitor relies on this metric to always be emitted. statusCode, err := mon.emitAPIServerHealthzCode(ctx) if err != nil { errs = append(errs, err) @@ -145,6 +145,7 @@ func (mon *Monitor) Monitor(ctx context.Context) (errs []error) { mon.log.Printf("%s: %s", friendlyFuncName, err) mon.emitGauge("monitor.clustererrors", 1, map[string]string{"monitor": friendlyFuncName}) } + // If API is not returning 200, fallback to checking ping and short circuit the rest of the checks if statusCode != http.StatusOK { err := mon.emitAPIServerPingCode(ctx) if err != nil {