From 1e52eec02a7d9e88b13e20273f9e713d947c3c02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torjus=20H=C3=A5kestad?= Date: Sun, 8 Feb 2026 20:58:52 +0100 Subject: [PATCH] monitoring: always include tier label in scrape configs Previously tier was only included if non-default (not "prod"), which meant prod hosts had no tier label. This made the Grafana tier filter only show "test" since "prod" never appeared in label_values(). Now tier is always included, so both "prod" and "test" appear in the fleet dashboard tier selector. Co-Authored-By: Claude Opus 4.5 --- lib/monitoring.nix | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/monitoring.nix b/lib/monitoring.nix index 57bffb4..b10703b 100644 --- a/lib/monitoring.nix +++ b/lib/monitoring.nix @@ -58,10 +58,9 @@ let }; # Build effective labels for a host - # Always includes hostname; only includes tier/priority/role if non-default + # Always includes hostname and tier; only includes priority/role if non-default buildEffectiveLabels = host: - { hostname = host.hostname; } - // (lib.optionalAttrs (host.tier != "prod") { tier = host.tier; }) + { hostname = host.hostname; tier = host.tier; } // (lib.optionalAttrs (host.priority != "high") { priority = host.priority; }) // (lib.optionalAttrs (host.role != null) { role = host.role; }) // host.labels;