diff --git a/pkg/monitoring/metrics/cdi-controller/dataimportcron.go b/pkg/monitoring/metrics/cdi-controller/dataimportcron.go index 73a1581828..fe94afeacc 100644 --- a/pkg/monitoring/metrics/cdi-controller/dataimportcron.go +++ b/pkg/monitoring/metrics/cdi-controller/dataimportcron.go @@ -8,7 +8,7 @@ import ( const ( // PrometheusCronNsLabel labels the DataImportCron namespace - PrometheusCronNsLabel = "ns" + PrometheusCronNsLabel = "namespace" // PrometheusCronNameLabel labels the DataImportCron name PrometheusCronNameLabel = "cron_name" // PrometheusCronPendingLabel labels whether the DataImportCron import DataVolume is pending for default storage class diff --git a/pkg/monitoring/rules/alerts/operator.go b/pkg/monitoring/rules/alerts/operator.go index acd8ff1a1d..8bbe9ebf31 100644 --- a/pkg/monitoring/rules/alerts/operator.go +++ b/pkg/monitoring/rules/alerts/operator.go @@ -58,16 +58,28 @@ var operatorAlerts = []promv1.Rule{ }, { Alert: "CDIDataImportCronOutdated", - Expr: intstr.FromString(`sum by(ns,cron_name) (kubevirt_cdi_dataimportcron_outdated{pending="false"}) > 0`), + Expr: intstr.FromString(`sum by(namespace,cron_name) (kubevirt_cdi_dataimportcron_outdated{pending="false", namespace=~"openshift-virtualization-os-images|kubevirt-os-images"}) > 0`), For: (*promv1.Duration)(ptr.To("15m")), Annotations: map[string]string{ "summary": "DataImportCron (recurring polling of VM templates disk image sources, also known as golden images) PVCs are not being updated on the defined schedule", }, Labels: map[string]string{ - severityAlertLabelKey: "info", + severityAlertLabelKey: "warning", operatorHealthImpactLabelKey: "warning", }, }, + { + Alert: "CDIUserDefinedDataImportCronOutdated", + Expr: intstr.FromString(`sum by(namespace,cron_name) (kubevirt_cdi_dataimportcron_outdated{pending="false", namespace!~"openshift-virtualization-os-images|kubevirt-os-images"}) > 0`), + For: (*promv1.Duration)(ptr.To("15m")), + Annotations: map[string]string{ + "summary": "DataImportCron (recurring polling of VM templates disk image sources, also known as golden images) PVCs are not being updated on the defined schedule", + }, + Labels: map[string]string{ + severityAlertLabelKey: "warning", + operatorHealthImpactLabelKey: "none", + }, + }, { Alert: "CDINoDefaultStorageClass", Expr: intstr.FromString(`sum(kubevirt_cdi_storageprofile_info{default="true"} or on() vector(0)) +