From 72a89595e7078c61d572ae6034580e29ad8eeac6 Mon Sep 17 00:00:00 2001 From: Kazuhiro MUSASHI Date: Sun, 12 Feb 2023 19:22:29 +0900 Subject: [PATCH] Add alert rules for `prometheus` and `vector-prometheus`. --- .../files/etc/prometheus.d/alerts/services.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/cookbooks/prometheus/files/etc/prometheus.d/alerts/services.yml b/cookbooks/prometheus/files/etc/prometheus.d/alerts/services.yml index a043706..343ee73 100644 --- a/cookbooks/prometheus/files/etc/prometheus.d/alerts/services.yml +++ b/cookbooks/prometheus/files/etc/prometheus.d/alerts/services.yml @@ -72,3 +72,21 @@ groups: annotations: summary: "exporter_proxy is not running: {{ $labels.instance }}." description: "exporter_proxy is not running: {{ $labels.instance }}." + + - alert: prometheus + expr: node_systemd_unit_state{name="prometheus.service", state="active"} != 1 + for: 5m + labels: + severity: error + annotations: + summary: "prometheus is not running: {{ $labels.instance }}." + description: "prometheus is not running: {{ $labels.instance }}." + + - alert: vector-prometheus + expr: node_systemd_unit_state{name="vector-prometheus.service", state="active"} != 1 + for: 5m + labels: + severity: error + annotations: + summary: "vector-prometheus is not running: {{ $labels.instance }}." + description: "vector-prometheus is not running: {{ $labels.instance }}."