From e85f7cbf201686dac598d8b285585d9af468490d Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Mon, 25 Jul 2022 13:30:47 +0100 Subject: [PATCH] Add an alert for prometheus configuration errors --- .../templates/default/alert_rules.yml.erb | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/cookbooks/prometheus/templates/default/alert_rules.yml.erb b/cookbooks/prometheus/templates/default/alert_rules.yml.erb index 61a7370b1..30a14a471 100644 --- a/cookbooks/prometheus/templates/default/alert_rules.yml.erb +++ b/cookbooks/prometheus/templates/default/alert_rules.yml.erb @@ -1,13 +1,6 @@ # DO NOT EDIT - This file is being maintained by Chef groups: - - name: alertmanager - rules: - - alert: prometheus target missing - expr: up == 0 - for: 10m - labels: - alertgroup: "prometheus" - name: amsterdam rules: - alert: pdu current draw @@ -422,6 +415,18 @@ groups: alertgroup: "{{ $labels.instance }}" annotations: queries: "{{ $value }}" + - name: prometheus + rules: + - alert: prometheus configuration error + expr: prometheus_config_last_reload_successful == 0 + for: 10m + labels: + alertgroup: "prometheus" + - alert: prometheus target missing + expr: up == 0 + for: 10m + labels: + alertgroup: "prometheus" - name: raid rules: - alert: raid array degraded -- 2.43.2