nix-infra/hosts/metrics/prometheus.nix

20 lines
414 B
Nix

{ hosts, ... }:
{
services.prometheus = {
enable = true;
scrapeConfigs = [
{
job_name = "node";
static_configs = builtins.map (name: {
targets = [
"${name}.${hosts.${name}.site}.grzb.de:9100"
];
labels = {
host = "${name}.${hosts.${name}.site}.grzb.de";
};
}) (builtins.attrNames hosts);
}
];
};
}