configuration.nix/hosts/shared/node-exporter.nix

33 lines
787 B
Nix
Raw Normal View History

2024-07-18 22:03:46 +05:30
{ config, ... }: {
services = {
caddy = {
virtualHosts."${config.networking.hostName}.labs.adtya.xyz" = {
extraConfig = ''
2024-07-18 23:00:17 +05:30
handle /metrics {
reverse_proxy 127.0.0.1:9100
}
handle /systemd-metrics {
uri replace /systemd-metrics /metrics
reverse_proxy 127.0.0.1:9558
}
2024-07-18 22:03:46 +05:30
tls /persist/secrets/caddy/certs/default.crt /persist/secrets/caddy/certs/default.key
'';
};
};
2024-07-18 23:00:17 +05:30
prometheus.exporters = {
node = {
enable = true;
listenAddress = "127.0.0.1";
port = 9100;
enabledCollectors = [ "systemd" ];
};
systemd = {
enable = true;
listenAddress = "127.0.0.1";
port = 9558;
};
2024-07-18 22:03:46 +05:30
};
};
}