diff --git a/controllers/policymetrics/metrics.go b/controllers/policymetrics/metrics.go index c9b57ed3..0db69cc2 100644 --- a/controllers/policymetrics/metrics.go +++ b/controllers/policymetrics/metrics.go @@ -11,7 +11,7 @@ import ( var policyStatusGauge = prometheus.NewGaugeVec( prometheus.GaugeOpts{ Name: "policy_governance_info", - Help: "The compliance status of the named policy. 0 == Compliant. 1 == NonCompliant", + Help: "The compliance status of the named policy. 0 == Compliant. 1 == NonCompliant. -1 == Unknown/Pending", }, []string{ "type", // "root" or "propagated" diff --git a/controllers/policymetrics/policymetrics_controller.go b/controllers/policymetrics/policymetrics_controller.go index 3b569040..1b4ae670 100644 --- a/controllers/policymetrics/policymetrics_controller.go +++ b/controllers/policymetrics/policymetrics_controller.go @@ -130,6 +130,8 @@ func (r *MetricReconciler) Reconcile(ctx context.Context, request ctrl.Request) statusMetric.Set(0) } else if pol.Status.ComplianceState == policiesv1.NonCompliant { statusMetric.Set(1) + } else { + statusMetric.Set(-1) } return reconcile.Result{}, nil