nixos-config/hosts/nuc/modules/prometheus/default.nix

36 lines
683 B
Nix
Raw Normal View History

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" ];
};
postgres.enable = true;
};
scrapeConfigs = [
{
job_name = "node";
static_configs = [
{
targets = [ "127.0.0.1:${toString exportersConfig.node.port}" ];
}
];
}
{
job_name = "postgres";
static_configs = [
{
targets = [ "127.0.0.1:${toString exportersConfig.postgres.port}" ];
}
];
}
];
};
}