Details
-
New Feature
-
Status: Done
-
Medium
-
Resolution: Done
-
None
-
0
-
Platform Sprint 25, Platform Sprint 26
-
Yes
-
Yes
Description
As part of implementing pg_stat_monitor we should extend management pmm-managed API.
How to test it:
- Add new postgresql service with query source equal to pg_stat_monitor with swagger.
- No error occured
- Information about created service and pg_stat_monitor agent is returned.
- Send Get request with recently added agent_id.
- No error occured
- Information about requested pg_stat_monitor agent is returned.
- Send List agents request in inventory API with swagger.
- No error occured
- New pg_stat_monitor agent in the list.
Test new metrics
- Setup percona distribution of PG 11 or percona distribution of PG 12 with installed pg_stat_monitor
- Try with pg_stat_monitor.pgsm_normalized_query enabled
- Check that we have only fingerprint
- Try with pg_stat_monitor.pgsm_normalized_query disabled and disabled query examples
- Check that we have only fingerprint
- Try with pg_stat_monitor.pgsm_normalized_query disabled and enabled query examples
- Check that we have fingerpint and example.
- Try with pg_stat_monitor.pgsm_normalized_query enabled
- Check that we have the same metrics which is available in pg_stat_statements.
- Check that we have new metrics
- cpu_user_time
- cpu_sys_time
If some metrics has wrong values then it is OK, because ticket was already created for that.
If flag will be unavalaible please use them without prefix "pgsm_". As you can see here:
https://github.com/percona/pg_stat_monitor flag for max query length is pg_stat_monitor.pgsm_query_max_len, but in my PR worked only pg_stat_monitor.query_max_len (https://github.com/percona/pmm-agent/pull/183/files#diff-4e5e90c6228fd48698d074241c2ba760R67).
What should be done:
- PMM-managed
- New agent type in database
- New agent type in List and Get endpoints of inventory API
- New query source in Management API
- Skip generating prometheus scrape config for new agent type
- Generate postgresql DSN for new agent type.
- Send request to pmm-agent to run new agent
- Forward new metrics from pmm-agent to qan-api
- PMM-agent
- Run pg_stat_monitor agent
- PMM API tests
- Extend tests for list and get endpoints
- Extend tests for management API