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_version and server_version_num via a single PromQL regex selector and parse major/minor consistently
  • Deployment/config updates:
    • docker-compose.yml: bump reporter image to postgresai/reporter:1.0.3 and adjust invocation to remove the --project argument
    • postgres_ai_helm/values.yaml: bump reporter image to 1.0.3 and remove reporter.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_datname to 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 project parameter) while keeping API upload supported via token

https://gitlab.com/postgres-ai/platform/-/issues/346

Edited by Nikolay Samokhvalov

Merge request reports

Loading