adyya-flake/services/monitoring/prometheus.mod.nix
Ittihadyya 20ef619d75
Some checks failed
/ Check formatting (push) Failing after 1s
if this works, it's very scuffed
2024-12-20 18:04:47 +02:00

42 lines
846 B
Nix

{molecules, ...}:{
universal.modules = [
{
services.prometheus.exporters = {
node = {
enable = true;
enabledCollectors = ["systemd"];
port = 6703;
};
varnish.enable = true;
};
}
];
glucose.modules = [
({
nixpkgs,
molecules,
...
}: let
ip = i: "10.24.1.${toString i}";
ips = builtins.mapAttrs (nixpkgs.lib.const ip) molecules;
ips' = builtins.mapAttrs (name: ip: "${ip}:6703") ips;
in {
services.prometheus = {
enable = true;
port = 6750;
enableReload = true;
scrapeConfigs = [
{
job_name = "devices";
static_configs = [
{
targets = ips';
}
];
}
];
};
})
];
}