2023-01-20 19:55:52 +01:00
|
|
|
{ ... }:
|
|
|
|
{
|
|
|
|
services.prometheus = {
|
|
|
|
scrapeConfigs = [{
|
|
|
|
job_name = "postgres";
|
|
|
|
scrape_interval = "15s";
|
|
|
|
static_configs = [
|
|
|
|
{
|
|
|
|
targets = [ "localhost:10392" ];
|
|
|
|
}
|
|
|
|
];
|
|
|
|
}];
|
|
|
|
|
|
|
|
exporters.postgres = {
|
|
|
|
enable = true;
|
|
|
|
port = 10392;
|
|
|
|
runAsLocalSuperUser = true;
|
|
|
|
extraFlags = [ "--auto-discover-databases" ];
|
|
|
|
};
|
|
|
|
};
|
2024-01-23 05:26:22 +01:00
|
|
|
|
|
|
|
systemd.services.prometheus-postgres-exporter.serviceConfig.Slice = "system-prometheus.slice";
|
2023-01-20 19:55:52 +01:00
|
|
|
}
|