From 00caae0ed3e99c0a591830da6d302110b29a25ec Mon Sep 17 00:00:00 2001 From: clerie Date: Fri, 22 Oct 2021 23:53:42 +0200 Subject: [PATCH] Move rules to dedicated file --- hosts/monitoring-3/configuration.nix | 14 +------------- hosts/monitoring-3/rules.yml | 11 +++++++++++ 2 files changed, 12 insertions(+), 13 deletions(-) create mode 100644 hosts/monitoring-3/rules.yml diff --git a/hosts/monitoring-3/configuration.nix b/hosts/monitoring-3/configuration.nix index fd814fe..c4452f5 100644 --- a/hosts/monitoring-3/configuration.nix +++ b/hosts/monitoring-3/configuration.nix @@ -161,19 +161,7 @@ in { } ]; } ]; - rules = [ '' - groups: - - name: alert.rules - rules: - - alert: InstanceDown - expr: up == 0 - for: 1m - labels: - severity: critical - annotations: - summary: "Endpoint {{ $labels.instance }} down" - description: "{{ $labels.instance }} of job {{ $labels.job }} has been down for more than 1 minutes." - '' ]; + rules = [ (readFile ./rules.yml) ]; }; services.grafana = { diff --git a/hosts/monitoring-3/rules.yml b/hosts/monitoring-3/rules.yml new file mode 100644 index 0000000..18f08b6 --- /dev/null +++ b/hosts/monitoring-3/rules.yml @@ -0,0 +1,11 @@ +groups: +- name: alert.rules + rules: + - alert: InstanceDown + expr: up == 0 + for: 1m + labels: + severity: critical + annotations: + summary: "Endpoint {{ $labels.instance }} down" + description: "{{ $labels.instance }} of job {{ $labels.job }} has been down for more than 1 minutes."