• Technical task
    • Status: Done
    • Medium
    • Resolution: Fixed
    • None
    • 2.19.0
    • None
    • None
    • 3.5
    • Yes
    • Yes
    • Yes
    • C/S Core


      User Impact:
      New metrics from pg_stat_monitor 0.9 will be presented on the boards.


      How to test:

      1. Go to Grafana.
      2. Do some queries.
      3. Open QAN
      4. Select queries for right service
      5. Open Chrome Debugger (F12, it should be same for another browsers)
      6. Check request /GetMetrics for right query
      7. It should contains plans_calls, wal_fpi and wal_records property.


      Suggested implementation:
      1. Modify structure for pg_stat_monitor 0.9 in pmm-agent

      2. Modify API

      3. Use this in pmm-managed, qan-api2

      4.  Modify tests


      Original report:

      QAN already collects some data from Postgres extensions pg_stat_statements/pg_stat_monitor like "Shared Blocks Written", "Shared Blocks Read" etc.

      Full list of currently gathered/presented columns in QAN and their pg_stat_statement/monitor names:

      • Rows Sent (rows)
      • Shared Blocks Written (shared_blks_written)
      • Shared Blocks Read (shared_blks_read)
      • Shared Block Cache Hits (shared_blks_hit)
      • Shared Blocks Dirtied (shared_blks_dirtied)
      • User CPU time (cpu_user_time *from pg_stat_monitor)
      • System CPU time (cpu_sys_time *from pg_stat_monitor)
      • Writing Blocks Time (blk_write_time)
      • Reading Blocks Time (blk_read_time)

      pg_stat_statements and pg_stat_monitor, however, provide many more metrics that could be useful. In particular, in PG 13 the planning time was separated into a separate metric, and WAL write information was added. pg_stat_monitor also has that, but additionally also shows the number of plans for the particular statement.

      In general, ideally, we want to see every column of pg_stat_statements/monitor in QAN. With some columns, however, that will require a version-specific code. Perhaps, min/max/mean/stddev time distribution columns are redundant in QAN, though see for where that can be useful potentially.





            jiri.ctvrtka Jiří Čtvrtka
            taras.kozub Taras Kozub
            0 Vote for this issue
            4 Start watching this issue



              Smart Checklist