2024-07-20 20:15:41 +05:30
|
|
|
{ lib, config, ... }: {
|
2024-07-18 22:03:46 +05:30
|
|
|
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-20 20:15:41 +05:30
|
|
|
${lib.optionalString config.services.prometheus.exporters.postgres.enable ''
|
|
|
|
handle /postgres-metrics {
|
|
|
|
uri replace /postgres-metrics /metrics
|
|
|
|
reverse_proxy ${config.services.prometheus.exporters.postgres.listenAddress}:${toString config.services.prometheus.exporters.postgres.port}
|
|
|
|
}
|
|
|
|
''}
|
2024-07-18 22:03:46 +05:30
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
2024-07-18 23:00:17 +05:30
|
|
|
prometheus.exporters = {
|
|
|
|
node = {
|
|
|
|
enable = true;
|
|
|
|
listenAddress = "127.0.0.1";
|
|
|
|
port = 9100;
|
2024-07-19 19:42:15 +05:30
|
|
|
enabledCollectors = [ "systemd" "processes" ];
|
2024-07-18 23:00:17 +05:30
|
|
|
};
|
|
|
|
systemd = {
|
|
|
|
enable = true;
|
|
|
|
listenAddress = "127.0.0.1";
|
|
|
|
port = 9558;
|
|
|
|
};
|
|
|
|
|
2024-07-18 22:03:46 +05:30
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|