prometheus: Add rules CominDeploymentFailed and CominDeploymentDifferentCommits

This commit is contained in:
SebastianStork 2026-03-03 19:09:27 +01:00
parent 3f882c89c7
commit 5378787ac0
Signed by: SebastianStork
SSH key fingerprint: SHA256:tRrGdjYOwgHxpSc/wTOZQZEjxcb15P0tyXRsbAfd+2Q

View file

@ -83,8 +83,9 @@ in
ruleFiles = ruleFiles =
{ {
groups = lib.singleton { groups = lib.singleton {
name = "InstanceDown"; name = "Rules";
rules = lib.singleton { rules = [
{
alert = "InstanceDown"; alert = "InstanceDown";
expr = "up == 0"; expr = "up == 0";
for = "2m"; for = "2m";
@ -93,7 +94,25 @@ in
summary = "{{ $labels.instance }} is DOWN"; summary = "{{ $labels.instance }} is DOWN";
description = "{{ $labels.instance }} of job {{ $labels.job }} has been down for more than 2 minutes."; description = "{{ $labels.instance }} of job {{ $labels.job }} has been down for more than 2 minutes.";
}; };
}
{
alert = "CominDeploymentFailed";
expr = ''comin_deployment_info{status!="done"}'';
annotations = {
summary = "{{ $labels.instance }} deployment failed";
description = "The deployment of {{ $labels.instance }} with comin is failing.";
}; };
}
{
alert = "CominDeploymentDifferentCommits";
expr = "count(count by (commit_id) (comin_deployment_info)) > 1";
for = "10m";
annotations = {
summary = "Comin commit mismatch";
description = "Two or more comin deployments are on different commits.";
};
}
];
}; };
} }
|> lib.strings.toJSON |> lib.strings.toJSON