From 36f24bdd30b179d17423c38d2794deaa5a506f2e Mon Sep 17 00:00:00 2001 From: SebastianStork Date: Tue, 3 Mar 2026 16:47:32 +0100 Subject: [PATCH] prometheus, alertmanager: Improve alerts --- modules/nixos/services/alertmanager.nix | 14 ++++++++++++++ modules/nixos/services/prometheus.nix | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/modules/nixos/services/alertmanager.nix b/modules/nixos/services/alertmanager.nix index 295e2e7..45bbf84 100644 --- a/modules/nixos/services/alertmanager.nix +++ b/modules/nixos/services/alertmanager.nix @@ -75,6 +75,20 @@ in notification = { topic = "splitleaf"; priority = "default"; + templates = { + title = ''{{ index .Annotations "summary" }}''; + description = ""; + }; + tags = [ + { + condition = ''status == "resolved"''; + tag = "white_check_mark"; + } + { + condition = ''status == "firing"''; + tag = "rotating_light"; + } + ]; }; }; }; diff --git a/modules/nixos/services/prometheus.nix b/modules/nixos/services/prometheus.nix index 182a70c..7c1b17c 100644 --- a/modules/nixos/services/prometheus.nix +++ b/modules/nixos/services/prometheus.nix @@ -89,7 +89,7 @@ in expr = "up == 0"; for = "2m"; labels.severity = "critical"; - annotations.summary = "Instance {{ $labels.instance }} down"; + annotations.summary = "{{ $labels.instance }} is DOWN"; }; }; }