New metrics from pg_stat_monitor 0.9 will be presented on the boards.
How to test:
- Go to Grafana.
- Do some queries.
- Open QAN
- Select queries for right service
- Open Chrome Debugger (F12, it should be same for another browsers)
- Check request /GetMetrics for right query
- It should contains plans_calls, wal_fpi and wal_records property.
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
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 https://jira.percona.com/browse/PMM-8057 for where that can be useful potentially.