feat: add cleanup for grafana alerting rules

This commit is contained in:
2025-11-01 11:09:05 +01:00
parent 819bfc1531
commit db25b2bfbb
3 changed files with 102 additions and 2 deletions

View File

@@ -11,8 +11,7 @@ let
httpsDomains = lib.map (d: "https://${d}") filteredDomains;
websiteAlertRules = lib.map (target:
let
domain = lib.replaceStrings ["://" "." "-" "/" ] ["-" "-" "_" "_"] target + "-down-alert";
uid = builtins.hashString "sha1" domain;
uid = "website-" + (builtins.replaceStrings ["https://" "http://" "." "/"] ["" "" "-" "-"] target);
in {
uid = uid;
title = "Website " + target + " Down";