diff --git a/CHANGELOG.md b/CHANGELOG.md index cb352bf4a..f3f3315a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fix cabbage alerts for multi-provider wcs. - Fix shield alert area labels. +- Fix `cert-exporter` alerting. ### Removed diff --git a/helm/prometheus-rules/templates/_helpers.tpl b/helm/prometheus-rules/templates/_helpers.tpl index e0140af3d..aa294dbfb 100644 --- a/helm/prometheus-rules/templates/_helpers.tpl +++ b/helm/prometheus-rules/templates/_helpers.tpl @@ -45,14 +45,6 @@ phoenix {{- end -}} {{- end -}} -{{- define "isCertExporterInstalled" -}} -{{- if has .Values.managementCluster.provider.kind (list "cloud-director" "vsphere" "capa") -}} -false -{{- else -}} -true -{{- end -}} -{{- end -}} - {{- define "isBastionBeingMonitored" -}} {{ not (eq .Values.managementCluster.provider.flavor "capi") }} {{- end -}} diff --git a/helm/prometheus-rules/templates/shared/alerting-rules/certificate.workload-cluster.rules.yml b/helm/prometheus-rules/templates/shared/alerting-rules/certificate.workload-cluster.rules.yml index f12abcf06..70def5eee 100644 --- a/helm/prometheus-rules/templates/shared/alerting-rules/certificate.workload-cluster.rules.yml +++ b/helm/prometheus-rules/templates/shared/alerting-rules/certificate.workload-cluster.rules.yml @@ -1,4 +1,3 @@ -{{- if eq (include "isCertExporterInstalled" .) "true" }} apiVersion: monitoring.coreos.com/v1 kind: PrometheusRule metadata: @@ -31,7 +30,7 @@ spec: annotations: description: '{{`Certificate metrics are missing for cluster {{ $labels.cluster_id }}.`}}' opsrecipe: absent-metrics - expr: max(up{cluster_id!="", cluster_type="workload_cluster"}) by (cluster_id) unless on (cluster_id) count (cert_exporter_not_after{cluster_type="workload_cluster"}) by (cluster_id) > 0 + expr: max(up{cluster_id!="", cluster_type="workload_cluster"}) by (cluster_id, installation, pipeline, provider) unless on (cluster_id) count (cert_exporter_not_after{cluster_type="workload_cluster"}) by (cluster_id, installation, pipeline, provider) > 0 for: 30m labels: area: kaas @@ -42,4 +41,3 @@ spec: severity: page team: {{ include "providerTeam" . }} topic: security -{{- end -}}