fix: ensure that pg_stat_statements is always created as an ext

Otherwise, we will have issues with this exporter.

Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
This commit is contained in:
raito 2024-10-21 14:33:18 +02:00
parent 3efdd0f6c9
commit bee402fecc

View file

@ -23,7 +23,10 @@ in
}; };
services.postgresql.settings.shared_preload_libraries = "pg_stat_statements"; services.postgresql.settings.shared_preload_libraries = "pg_stat_statements";
systemd.services.postgresql.postStart = lib.mkAfter ''
${config.services.postgresql.package}/bin/psql -U postgres -c "CREATE EXTENSION IF NOT EXISTS pg_stat_statements;";
'';
bagel.monitoring.grafana-agent.exporters.postgres.port = 9104; bagel.monitoring.grafana-agent.exporters.postgres.port = 9104;
}; };
} }