Add postgres_exporter

This commit is contained in:
Charlotte 🦝 Delenk 2022-01-15 21:50:42 +01:00
parent a04474f478
commit 23d255bd39
Signed by: darkkirb
GPG key ID: 015E3768A70AFBC5
2 changed files with 13 additions and 1 deletions

View file

@ -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;
};
}

View file

@ -19,6 +19,14 @@
];
}];
}
{
job_name = "postgres_exporter";
static_configs = [{
targets = [
"${config.services.prometheus.exporters.postgres.listenAddress}:${toString config.services.prometheus.exporters.postgres.port}"
];
}];
}
];
};
}