diff --git a/pkg/cvo/metrics.go b/pkg/cvo/metrics.go index db0332869..9385a11eb 100644 --- a/pkg/cvo/metrics.go +++ b/pkg/cvo/metrics.go @@ -259,9 +259,8 @@ func (m *operatorMetrics) Collect(ch chan<- prometheus.Metric) { break } g := m.clusterOperatorUp.WithLabelValues(op.Name, firstVersion) - failing := resourcemerge.IsOperatorStatusConditionTrue(op.Status.Conditions, configv1.OperatorDegraded) available := resourcemerge.IsOperatorStatusConditionTrue(op.Status.Conditions, configv1.OperatorAvailable) - if available && !failing { + if available { g.Set(1) } else { g.Set(0) diff --git a/pkg/cvo/metrics_test.go b/pkg/cvo/metrics_test.go index b1a82d9a0..279b95155 100644 --- a/pkg/cvo/metrics_test.go +++ b/pkg/cvo/metrics_test.go @@ -186,7 +186,7 @@ func Test_operatorMetrics_Collect(t *testing.T) { t.Fatalf("Unexpected metrics %s", spew.Sdump(metrics)) } expectMetric(t, metrics[0], 0, map[string]string{"type": "current", "version": "", "image": "", "from_version": ""}) - expectMetric(t, metrics[1], 0, map[string]string{"name": "test", "version": "10.1.5-1"}) + expectMetric(t, metrics[1], 1, map[string]string{"name": "test", "version": "10.1.5-1"}) expectMetric(t, metrics[2], 1, map[string]string{"name": "test", "condition": "Available"}) expectMetric(t, metrics[3], 1, map[string]string{"name": "test", "condition": "Degraded"}) expectMetric(t, metrics[4], 1, map[string]string{"type": ""})