From 034e6356313e9baf393517789c355593c4a3a918 Mon Sep 17 00:00:00 2001 From: p4u1 Date: Mon, 12 Oct 2026 11:03:47 +0200 Subject: [PATCH] feat(matrix): show more information in matrix alerts --- abra.sh | 2 +- alertmanager-matrix-config.yml.tmpl | 20 +++++++++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/abra.sh b/abra.sh index 10aaa5c..cc14e38 100644 --- a/abra.sh +++ b/abra.sh @@ -7,7 +7,7 @@ export GF_BACKUP_DASH_VERSION=v1 export GF_CUSTOM_INI_VERSION=v4 export LOKI_YML_VERSION=v3 export PROMETHEUS_YML_VERSION=v2 -export MATRIX_ALERTMANAGER_CONFIG_VERSION=v1 +export MATRIX_ALERTMANAGER_CONFIG_VERSION=v2 export MATRIX_ALERTMANAGER_ENTRYPOINT_VERSION=v1 export GF_ALERTS_NODE_VERSION=v3 export CONFIG_ALLOY_VERSION=v3 diff --git a/alertmanager-matrix-config.yml.tmpl b/alertmanager-matrix-config.yml.tmpl index 539af76..da0e51e 100644 --- a/alertmanager-matrix-config.yml.tmpl +++ b/alertmanager-matrix-config.yml.tmpl @@ -54,21 +54,35 @@ templating: {{ else if .Alert.Labels.alertname }} {{ .Alert.Labels.alertname }} {{ end }} + {{ if .Alert.Labels.rulename }} + → {{ .Alert.Labels.rulename }} + {{ end }} + {{ if .Alert.Labels.grafana_folder }} + ({{ .Alert.Labels.grafana_folder }}) + {{ end }} >> {{ if .Alert.Labels.severity }} - {{ .Alert.Labels.severity | ToUpper }}: + {{ .Alert.Labels.severity | ToUpper }}: {{ end }} {{ if .Alert.Annotations.description }} {{ .Alert.Annotations.description }} {{ else if .Alert.Annotations.summary }} {{ .Alert.Annotations.summary }} + {{ else if .Alert.Labels.rulename }} + Query {{ .Alert.Labels.ref_id }} returned no data (datasource {{ .Alert.Labels.datasource_uid }}) + {{ end }} + {{ if .Alert.Labels.instance }} + on {{ .Alert.Labels.instance }} {{ end }} >> {{ if .Alert.Annotations.runbook }} - Runbook | + Runbook | {{ end }} {{ if .Alert.Annotations.dashboard }} - Dashboard | + Dashboard | + {{ end }} + {{ if .GeneratorURL }} + Rule | {{ end }} Silence

`}}' -- 2.54.0