mirror of
https://git.sr.ht/~rouven/nixos-config
synced 2024-11-15 13:23:11 +01:00
36 lines
683 B
Nix
36 lines
683 B
Nix
|
{ 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}" ];
|
||
|
}
|
||
|
];
|
||
|
}
|
||
|
];
|
||
|
|
||
|
};
|
||
|
}
|