mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-03-22 17:49:07 +01:00
prometheus: Add rules CominDeploymentFailed and CominDeploymentDifferentCommits
This commit is contained in:
parent
3f882c89c7
commit
5378787ac0
1 changed files with 30 additions and 11 deletions
|
|
@ -83,17 +83,36 @@ in
|
||||||
ruleFiles =
|
ruleFiles =
|
||||||
{
|
{
|
||||||
groups = lib.singleton {
|
groups = lib.singleton {
|
||||||
name = "InstanceDown";
|
name = "Rules";
|
||||||
rules = lib.singleton {
|
rules = [
|
||||||
alert = "InstanceDown";
|
{
|
||||||
expr = "up == 0";
|
alert = "InstanceDown";
|
||||||
for = "2m";
|
expr = "up == 0";
|
||||||
labels.severity = "critical";
|
for = "2m";
|
||||||
annotations = {
|
labels.severity = "critical";
|
||||||
summary = "{{ $labels.instance }} is DOWN";
|
annotations = {
|
||||||
description = "{{ $labels.instance }} of job {{ $labels.job }} has been down for more than 2 minutes.";
|
summary = "{{ $labels.instance }} is DOWN";
|
||||||
};
|
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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue