Daily JSON reports with hourly snapshots of pgss and ASH data, with normalized query texts
Reporter enhancements: hourly and per-query query analysis
Summary
This MR extends the reporter to generate additional query-focused reports (including hourly breakdowns and per-query artifacts), improves Postgres version handling in report payloads, and aligns docker-compose/Helm configuration and unit tests with the updated reporter behavior.
Changes
- Add new report types for query analysis:
- M001–M003: top queries by mean time, rows, and I/O time
- N001: wait events grouped by type and query
- Extend hourly pg_stat_statements reporting (K004–K007) and reporting orchestration accordingly
- Add support for producing per-query JSON outputs (daily metrics sourced from Prometheus), and enrich query reporting by mapping
queryid→ query text from the Postgres sink (pgss_queryid_queries) - Refactor/strengthen version parsing:
- Introduce a defensive helper to fetch both
server_versionandserver_version_numvia a single PromQL regex selector and parse major/minor consistently
- Introduce a defensive helper to fetch both
- Deployment/config updates:
-
docker-compose.yml: bump reporter image topostgresai/reporter:1.0.3and adjust invocation to remove the--projectargument -
postgres_ai_helm/values.yaml: bump reporter image to1.0.3and removereporter.project
-
- Metrics improvements:
-
Filter bloat metrics to exclude very small relations (threshold > 1 MiB) to analyze faster DBs with huge number of relations->> !106 (merged) - Add
tag_datnameto the “unused indexes” metric for easier attribution
-
Benefits
- More actionable performance diagnostics by linking query-level metrics (including wait events) to stable query identifiers.
- Cleaner configuration surface (removing the
projectparameter) while keeping API upload supported via token
Edited by Nikolay Samokhvalov