From 84ed7169089072b0393c6150e0815fbf46073e19 Mon Sep 17 00:00:00 2001 From: Vincent Boutour Date: Tue, 2 Feb 2021 13:17:48 +0100 Subject: [PATCH] Exclude deleted resources on prometheus alerting query Signed-off-by: Vincent Boutour --- docs/guides/monitoring.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guides/monitoring.md b/docs/guides/monitoring.md index 390693ab..42a2f209 100644 --- a/docs/guides/monitoring.md +++ b/docs/guides/monitoring.md @@ -86,7 +86,7 @@ groups: - name: GitOpsToolkit rules: - alert: ReconciliationFailure - expr: gotk_reconcile_condition{type="Ready",status="False"} == 1 + expr: max(gotk_reconcile_condition{status="False",type="Ready"}) by (namespace, name, kind) + on(namespace, name, kind) (max(gotk_reconcile_condition{status="Deleted"}) by (namespace, name, kind)) * 2 == 1 for: 10m labels: severity: page