2023-10-29 11:58:56 +01:00
|
|
|
{ config, ... }:
|
|
|
|
let
|
|
|
|
exportersConfig = config.services.prometheus.exporters;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
services.prometheus = {
|
|
|
|
enable = true;
|
|
|
|
exporters = {
|
|
|
|
node = {
|
|
|
|
enable = true;
|
|
|
|
enabledCollectors = [ "systemd" ];
|
|
|
|
};
|
2024-01-25 18:19:48 +01:00
|
|
|
# postgres.enable = true;
|
2023-10-29 11:58:56 +01:00
|
|
|
};
|
|
|
|
scrapeConfigs = [
|
|
|
|
{
|
|
|
|
job_name = "node";
|
|
|
|
static_configs = [
|
|
|
|
{
|
|
|
|
targets = [ "127.0.0.1:${toString exportersConfig.node.port}" ];
|
|
|
|
}
|
|
|
|
];
|
|
|
|
}
|
2024-01-25 18:19:48 +01:00
|
|
|
# {
|
|
|
|
# job_name = "postgres";
|
|
|
|
# static_configs = [
|
|
|
|
# {
|
|
|
|
# targets = [ "127.0.0.1:${toString exportersConfig.postgres.port}" ];
|
|
|
|
# }
|
|
|
|
# ];
|
|
|
|
# }
|
2023-10-29 11:58:56 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
};
|
|
|
|
}
|