From ed40304dd8eafd367acdc5b3cd24f5d4d0246a8e Mon Sep 17 00:00:00 2001 From: Mikolaj Pawlikowski Date: Fri, 19 Mar 2021 14:45:58 +0000 Subject: [PATCH] 1 when healthy, 0 when unhealthy (bool, not return code) Signed-off-by: Mikolaj Pawlikowski --- pkg/goldpinger/stats.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/goldpinger/stats.go b/pkg/goldpinger/stats.go index 65dd9ef..9798caa 100644 --- a/pkg/goldpinger/stats.go +++ b/pkg/goldpinger/stats.go @@ -149,7 +149,7 @@ func CountHealthyUnhealthyNodes(healthy, unhealthy float64) { // SetClusterHealth sets the cluster health gauge to 1 (healthy) or 0 (unhealthy) func SetClusterHealth(healthy bool) { value := 1.0 - if healthy { + if !healthy { value = 0 } goldpingerClusterHealthGauge.WithLabelValues(