modules: init prometheus

This commit is contained in:
notohh 2023-06-19 12:47:07 -04:00
parent afd1c72cdb
commit 1d21825c7b
Signed by: notohh
GPG key ID: BD47506D475EE86D
2 changed files with 25 additions and 0 deletions

View file

@ -8,5 +8,6 @@
./openssh.nix ./openssh.nix
./virtualisation.nix ./virtualisation.nix
./sops.nix ./sops.nix
./prometheus.nix
]; ];
} }

24
modules/prometheus.nix Normal file
View file

@ -0,0 +1,24 @@
_: {
networking.firewall.allowedTCPPorts = [9090];
services.prometheus = {
enable = true;
scrapeConfigs = [
{
job_name = "prometheus";
scrape_interval = "30s";
static_configs = [{targets = ["localhost:9090"];}];
}
{
job_name = "node";
scrape_interval = "30s";
static_configs = [{targets = ["localhost:9100"];}];
}
];
exporters = {
node = {
enable = true;
enabledCollectors = ["systemd" "cpu"];
};
};
};
}