adyya-flake/services/monitoring/prometheus.mod.nix
Ittihadyya f93018a4cf
Some checks failed
/ Check formatting (push) Failing after 1s
configure grafana further. set up prometheus node export.
2024-12-20 17:53:08 +02:00

42 lines
815 B
Nix

{
universal.modules = [
{
services.prometheus.exporters = {
node = {
enable = true;
enabledCollectors = ["systemd"];
port = 6703;
};
varnish.enable = true;
};
}
];
glucose.modules = [
{
lib,
molecules,
...
}: let
ip = i: "10.24.1.${toString i}";
ips = builtins.mapAttrs (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';
}
];
}
];
};
}
];
}