diff --git a/flake.nix b/flake.nix index f3ae25f..cefcac6 100644 --- a/flake.nix +++ b/flake.nix @@ -127,6 +127,7 @@ deployment.tags = lib.mkIf (config.bagel.baremetal.builders.enable -> !config.bagel.baremetal.builders.netboot) [ "localboot" ]; + bagel.monitoring.grafana-agent.tenant = "floral"; bagel.secrets.tenant = "floral"; bagel.builders.extra-build-capacity.provider.tenant = "floral"; }) @@ -155,6 +156,7 @@ deployment.tags = [ "localboot" ]; + bagel.monitoring.grafana-agent.tenant = "lix"; bagel.secrets.tenant = "lix"; bagel.builders.extra-build-capacity.provider.tenant = "lix"; } diff --git a/services/monitoring/agent.nix b/services/monitoring/agent.nix index 9bb29a1..99c44ac 100644 --- a/services/monitoring/agent.nix +++ b/services/monitoring/agent.nix @@ -12,6 +12,14 @@ in options.bagel.monitoring.grafana-agent = { enable = (mkEnableOption "Grafana Agent") // { default = true; }; + tenant = mkOption { + description = '' + Which tenant are we enabling Grafana Agent for. + ''; + example = "lix"; + type = types.enum [ "lix" "floral" ]; + }; + exporters = mkOption { description = '' Set of additional exporters to scrape. @@ -76,7 +84,10 @@ in }; } ]; - global.external_labels.hostname = config.networking.hostName; + global.external_labels = { + hostname = config.networking.hostName; + inherit (cfg) tenant; + }; configs = [ { name = config.networking.hostName;