Skip to content

Commit

Permalink
Adds victoria-metrics declarative alerts
Browse files Browse the repository at this point in the history
  • Loading branch information
johnalotoski authored and blaggacao committed Jun 21, 2022
1 parent fc9d4b2 commit 99b6e38
Show file tree
Hide file tree
Showing 15 changed files with 381 additions and 16 deletions.
18 changes: 2 additions & 16 deletions profiles/monitoring.nix
Expand Up @@ -152,21 +152,7 @@ in {
enable = true;
externalUrl = "https://monitoring.${domain}/vmalert";
httpPathPrefix = "/vmalert";
rules = [
{
name = "alerting-pipeline";
rules = [{
alert = "DeadMansSnitch";
expr = "vector(1)";
labels = { severity = "critical"; };
annotations = {
summary = "Alerting DeadMansSnitch.";
description =
"This is a DeadMansSnitch meant to ensure that the entire Alerting pipeline is functional.";
};
}];
}
];
rules = (import ./monitoring/alerts/alerts.nix "https://monitoring.${domain}").groups;
};

loki = { enable = true; };
Expand Down Expand Up @@ -209,7 +195,7 @@ in {

dashboards = [{
name = "provisioned";
options.path = ./monitoring;
options.path = ./monitoring/dashboards;
}];
};

Expand Down
5 changes: 5 additions & 0 deletions profiles/monitoring/alerts/alerts.nix
@@ -0,0 +1,5 @@
grafanaUrl: {
groups =
(import ./deadmans-snitch.nix grafanaUrl).groups ++
(import ./victoria-metrics.nix grafanaUrl).groups;
}
17 changes: 17 additions & 0 deletions profiles/monitoring/alerts/deadmans-snitch.nix
@@ -0,0 +1,17 @@
grafanaUrl: {
groups = [
{
name = "alerting-pipeline";
rules = [{
alert = "DeadMansSnitch";
expr = "vector(1)";
labels = { severity = "critical"; };
annotations = {
summary = "Alerting DeadMansSnitch.";
description =
"This is a DeadMansSnitch meant to ensure that the entire Alerting pipeline is functional.";
};
}];
}
];
}

0 comments on commit 99b6e38

Please sign in to comment.