Add postgres_exporter
This commit is contained in:
parent
a04474f478
commit
23d255bd39
2 changed files with 13 additions and 1 deletions
|
@ -1,7 +1,11 @@
|
|||
{ lib, ... }: {
|
||||
{ config, lib, ... }: {
|
||||
services.postgresql = {
|
||||
enable = true;
|
||||
enableTCPIP = true;
|
||||
authentication = "host all all fd0d:a262:1fa6:e621::/64 md5";
|
||||
};
|
||||
services.prometheus.exporters.postgres = {
|
||||
enable = true;
|
||||
listenAddress = (import ../../utils/getInternalIP.nix config).listenIP;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -19,6 +19,14 @@
|
|||
];
|
||||
}];
|
||||
}
|
||||
{
|
||||
job_name = "postgres_exporter";
|
||||
static_configs = [{
|
||||
targets = [
|
||||
"${config.services.prometheus.exporters.postgres.listenAddress}:${toString config.services.prometheus.exporters.postgres.port}"
|
||||
];
|
||||
}];
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue