feat(monitoring): add static label for tenancy

So we can distinguish easily things in the dashboards.

Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
This commit is contained in:
raito 2024-10-06 11:03:53 +02:00
parent 8838709a95
commit 1e421889e4
2 changed files with 14 additions and 1 deletions

View file

@ -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";
}

View file

@ -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;