Uploaded image for project: 'Percona Monitoring and Management'
  1. Percona Monitoring and Management
  2. PMM-6567

Technical preview of new PostgreSQL extension 'pg_stat_monitor'


    • 0
    • Platform Sprint 25, Platform Sprint 26
    • Yes
    • Yes


      As part of implementing pg_stat_monitor we should extend management pmm-managed API.

      How to test it:

      1. Add new postgresql service with query source equal to pg_stat_monitor with swagger.
        1. No error occured
        2. Information about created service and pg_stat_monitor agent is returned.
      2. Send Get request with recently added agent_id.
        1. No error occured
        2. Information about requested pg_stat_monitor agent is returned.
      3. Send List agents request in inventory API with swagger.
        1. No error occured
        2. New pg_stat_monitor agent in the list.

      Test new metrics

      1. 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.
      2. Check that we have the same metrics which is available in pg_stat_statements.
      3. 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


        1. image-2020-09-22-11-38-10-555.png
          156 kB
          Beata Handzelova
        2. image-2020-09-22-11-39-20-074.png
          67 kB
          Beata Handzelova

        Issue Links



              jiri.ctvrtka Jiří Čtvrtka
              roma.novikov Roma Novikov
              0 Vote for this issue
              3 Start watching this issue



                Time Tracking

                  Original Estimate - Not Specified
                  Not Specified
                  Remaining Estimate - Not Specified
                  Not Specified
                  Time Spent - 1 hour

                  Smart Checklist