From ceecada0f7510fe7b3f3d9e7003458554dba50e1 Mon Sep 17 00:00:00 2001 From: Quentin Bisson Date: Wed, 11 Oct 2023 11:11:48 +0200 Subject: [PATCH] Ensure AppWithoutTeamAnnotation only pages for Giant Swarm catalogs (#929) * Ensure AppWithoutTeamAnnotation only pages for Giant Swarm catalogs * Update app.rules.yml --- CHANGELOG.md | 1 + helm/prometheus-rules/templates/alerting-rules/app.rules.yml | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e1d09f8af..8793cac28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Fix link for node exporter opsrecipe +- Fix AppWithoutTeamAnnotation so it only pages for Giant Swarm catalogs. ## [2.138.0] - 2023-10-05 diff --git a/helm/prometheus-rules/templates/alerting-rules/app.rules.yml b/helm/prometheus-rules/templates/alerting-rules/app.rules.yml index 842050904..5e5a56661 100644 --- a/helm/prometheus-rules/templates/alerting-rules/app.rules.yml +++ b/helm/prometheus-rules/templates/alerting-rules/app.rules.yml @@ -105,9 +105,9 @@ spec: description: '{{`App {{ $labels.name }} has no team label.`}}' opsrecipe: app-without-team-annotation/ {{- if eq .Values.managementCluster.provider.flavor "capi" }} - expr: label_replace(app_operator_app_info{team=~"^$|noteam"}, "cluster_id", "$1", "name", "([a-zA-Z0-9]+)-.*") == 1 + expr: label_replace(app_operator_app_info{team=~"^$|noteam", catalog=~"giantswarm.*|control-plane(-test)?-catalog|cluster(-test)?|default(-test)?|releases(-test)?"}, "cluster_id", "$1", "name", "([a-zA-Z0-9]+)-.*") == 1 {{- else }} - expr: label_replace(app_operator_app_info{team=~"^$|noteam"}, "cluster_id", "$1", "namespace", {{ include "namespaceNotGiantswarm" . }}) == 1 + expr: label_replace(app_operator_app_info{team=~"^$|noteam", catalog=~"giantswarm.*|control-plane(-test)?-catalog|cluster(-test)?|default(-test)?|releases(-test)?"}, "cluster_id", "$1", "namespace", {{ include "namespaceNotGiantswarm" . }}) == 1 {{- end }} for: 40m labels: