1
0
Fork 0
forked from fi/nix-infra

Add metrics host with Grafana and Prometheus

This commit is contained in:
fi 2023-08-07 00:58:45 +02:00
commit d625f3f887
Signed by: fi
SSH key fingerprint: SHA256:d+6fQoDPMbSFK95zRVflRKZLRKF4cPSQb7VIxYkhFsA
6 changed files with 36 additions and 10 deletions

View file

@ -1,6 +1,19 @@
{ ... }:
{ 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);
}
];
};
}