2025-04-24 11:40:52 +02:00
|
|
|
{ config, ... }:
|
|
|
|
|
{
|
2024-09-26 13:18:37 +02:00
|
|
|
services = {
|
|
|
|
|
prometheus = {
|
|
|
|
|
enable = true;
|
|
|
|
|
port = 9001;
|
|
|
|
|
exporters = {
|
|
|
|
|
node = {
|
|
|
|
|
enable = true;
|
|
|
|
|
enabledCollectors = [ "systemd" ];
|
|
|
|
|
port = 9002;
|
|
|
|
|
};
|
|
|
|
|
};
|
2025-04-24 11:40:52 +02:00
|
|
|
scrapeConfigs = [
|
|
|
|
|
{
|
2025-04-24 11:52:43 +02:00
|
|
|
job_name = "${config.networking.hostName}";
|
2025-04-24 11:40:52 +02:00
|
|
|
static_configs = [
|
|
|
|
|
{
|
|
|
|
|
targets = [ "127.0.0.1:${toString config.services.prometheus.exporters.node.port}" ];
|
|
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
];
|
2024-09-26 13:18:37 +02:00
|
|
|
};
|
|
|
|
|
};
|
2025-04-24 12:05:25 +02:00
|
|
|
networking.firewall = {
|
|
|
|
|
allowedTCPPorts = [
|
|
|
|
|
9001
|
|
|
|
|
];
|
|
|
|
|
};
|
2024-09-26 13:18:37 +02:00
|
|
|
}
|