From fed7319e77aa5ada89e226ec6fe97cd1fe21302f Mon Sep 17 00:00:00 2001 From: Russell Troxel Date: Wed, 22 Mar 2023 15:22:35 -0700 Subject: [PATCH] Shared System Health collector should export zero when no health issues are present (#135) Signed-off-by: Russell Troxel --- internal/collector/shared/health.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/collector/shared/health.go b/internal/collector/shared/health.go index 792df8e..2b7b36b 100644 --- a/internal/collector/shared/health.go +++ b/internal/collector/shared/health.go @@ -59,5 +59,7 @@ func (collector *systemHealthCollector) Collect(ch chan<- prometheus.Metric) { s.Source, s.Type, s.Message, s.WikiURL, ) } + } else { + ch <- prometheus.MustNewConstMetric(collector.systemHealthMetric, prometheus.GaugeValue, float64(0), "", "", "", "") } }