From 54e8282aac823351efbd9f3a98eb645794ced8aa Mon Sep 17 00:00:00 2001 From: K900 Date: Tue, 12 Nov 2024 23:21:30 +0300 Subject: [PATCH] fix: use promtool to verify rules, fix format --- services/monitoring/lgtm/alerts/forkos.yaml | 1 - services/monitoring/lgtm/alerts/postgres.yml | 1 - services/monitoring/lgtm/alerts/resources.yaml | 1 - services/monitoring/lgtm/mimir.nix | 7 ++----- 4 files changed, 2 insertions(+), 8 deletions(-) diff --git a/services/monitoring/lgtm/alerts/forkos.yaml b/services/monitoring/lgtm/alerts/forkos.yaml index e6dc3f6..013487e 100644 --- a/services/monitoring/lgtm/alerts/forkos.yaml +++ b/services/monitoring/lgtm/alerts/forkos.yaml @@ -1,4 +1,3 @@ -namespace: forkos groups: - name: ForkOS automation rules: diff --git a/services/monitoring/lgtm/alerts/postgres.yml b/services/monitoring/lgtm/alerts/postgres.yml index c9a229e..41e9b15 100644 --- a/services/monitoring/lgtm/alerts/postgres.yml +++ b/services/monitoring/lgtm/alerts/postgres.yml @@ -1,4 +1,3 @@ -namespace: postgres groups: - name: PostgreSQL rules: diff --git a/services/monitoring/lgtm/alerts/resources.yaml b/services/monitoring/lgtm/alerts/resources.yaml index 84b52cf..03aa686 100644 --- a/services/monitoring/lgtm/alerts/resources.yaml +++ b/services/monitoring/lgtm/alerts/resources.yaml @@ -1,4 +1,3 @@ -namespace: resources groups: - name: Host & hardware rules: diff --git a/services/monitoring/lgtm/mimir.nix b/services/monitoring/lgtm/mimir.nix index 782832f..bca3cf5 100644 --- a/services/monitoring/lgtm/mimir.nix +++ b/services/monitoring/lgtm/mimir.nix @@ -12,14 +12,11 @@ let alerts = pkgs.runCommand "mimir-alerts-checked" { src = ./alerts; - nativeBuildInputs = with pkgs; [ mimir ]; + nativeBuildInputs = with pkgs; [ prometheus.cli ]; } '' + promtool check rules $src/* mkdir $out cp -R $src $out/anonymous/ - chmod -R +w $out - mimirtool rules check --rule-dirs=$out/anonymous - mimirtool rules lint --rule-dirs=$out/anonymous - diff -r $src $out/anonymous ''; in {