mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-03-22 23:29:08 +01:00
prometheus, alertmanager: Adjust alert wording depending on firing or resolved status
This commit is contained in:
parent
f2258ac79c
commit
ba6f0387b2
2 changed files with 8 additions and 5 deletions
|
|
@ -83,7 +83,10 @@ in
|
|||
notification = {
|
||||
topic = "splitleaf";
|
||||
priority = "default";
|
||||
templates.title = ''{{ index .Annotations "summary" }}'';
|
||||
templates = {
|
||||
title = ''{{ if eq .Status "firing" }}{{ index .Annotations "summary" }}{{ else }}{{ index .Annotations "summary_resolved" }}{{ end }}'';
|
||||
description = ".";
|
||||
};
|
||||
tags = [
|
||||
{
|
||||
condition = ''status == "resolved"'';
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ in
|
|||
labels.severity = "critical";
|
||||
annotations = {
|
||||
summary = "${hostName} is DOWN";
|
||||
description = "${hostName} has not reported any metrics for more than 2 minutes.";
|
||||
summary_resolved = "${hostName} is up again";
|
||||
};
|
||||
})
|
||||
)
|
||||
|
|
@ -108,7 +108,7 @@ in
|
|||
for = "2m";
|
||||
annotations = {
|
||||
summary = "{{ $labels.job }} on {{ $labels.instance }} is DOWN";
|
||||
description = "{{ $labels.job }} on {{ $labels.instance }} has been down for more than 2 minutes.";
|
||||
summary_resolved = "{{ $labels.job }} on {{ $labels.instance }} is up again";
|
||||
};
|
||||
}
|
||||
{
|
||||
|
|
@ -116,7 +116,7 @@ in
|
|||
expr = ''comin_deployment_info{status!="done"}'';
|
||||
annotations = {
|
||||
summary = "{{ $labels.instance }} deployment failed";
|
||||
description = "The deployment of {{ $labels.instance }} with comin is failing.";
|
||||
summary_resolved = "{{ $labels.instance }} deployment recovered";
|
||||
};
|
||||
}
|
||||
{
|
||||
|
|
@ -125,7 +125,7 @@ in
|
|||
for = "10m";
|
||||
annotations = {
|
||||
summary = "Hosts are running different commits";
|
||||
description = "Not all hosts are running the same git commit, which may indicate a failed deployment and could lead to incompatible configurations.";
|
||||
summary_resolved = "All hosts are running the same commit again";
|
||||
};
|
||||
}
|
||||
];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue