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

No PostgreSQL queries or metrics in Query Analytics with PostgreSQL 13 (postgresql_pgstatements_agent in Waiting status)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: 2.10.1
    • Fix Version/s: 2.11.0
    • Component/s: PMM Agent
    • Labels:
    • Story Points:
      2
    • Sprint:
      Platform Sprint 27
    • Needs Review:
      Yes
    • Needs QA:
      Yes

      Description

      User impact:
      It's not possible to see postgres queries and metrics in QAN

      STR: 
      Follow PMM documentation
       
      Pull PG13 docker image and start PMM Server (or use attached docker-compose)

      pmm@pmm-VirtualBox:~$ docker ps -a
      CONTAINER ID        IMAGE                       COMMAND                  CREATED             STATUS                       PORTS                                      NAMES
      1cfcfe2a4adc        postgres:13                 "docker-entrypoint.s…"   About an hour ago   Up 6 minutes                 127.0.0.1:5432->5432/tcp                   postgres13
      4738f421a059        percona/pmm-server:2.10.1   "/opt/entrypoint.sh"     About an hour ago   Up About an hour (healthy)   0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp   pmm-server
      

      Install needed package

      sudo apt-get install postgresql-contrib
      

       Add these rows to postgresql.conf

      shared_preload_libraries = 'pg_stat_statements'
      track_activity_query_size = 2048
      pg_stat_statements.track = all
      

      Restart postgresql

      docker restart postgres13
      

      Add the extension

      psql -U postgres
      CREATE EXTENSION pg_stat_statements SCHEMA public;
      

      Add PG to monitoring

      pmm-admin add postgresql --username=postgres --password=pass postgres 127.0.0.1:5432

      Result:
      postgresql_pgstatements_agent is WAITING

      pmm@pmm-VirtualBox:~$ pmm-admin list
      Service type Service name        Address and port Service ID
      PostgreSQL   postgresql13        127.0.0.1:5432   /service_id/6bf82290-7517-45b4-9ac3-304b690f353c
      PostgreSQL   postgres            127.0.0.1:5432   /service_id/a96e1758-8af6-47d9-9e99-569d5ca6a41cAgent type                 Status    Agent ID                                       Service ID
      pmm_agent                  Connected /agent_id/6f08fa47-d37c-498c-9d83-49ab1649b29c 
      node_exporter              Running   /agent_id/ea553638-8b70-49a7-83de-6ac8da81fc9c 
      postgres_exporter          Running   /agent_id/1db8e467-007d-4025-8942-c19d5778b1e0 /service_id/a96e1758-8af6-47d9-9e99-569d5ca6a41c
      postgres_exporter          Running   /agent_id/be66af91-7a6d-4c96-a433-13bf0d1e21ed /service_id/6bf82290-7517-45b4-9ac3-304b690f353c
      postgresql_pgstatements_agent Waiting   /agent_id/28ba0e10-3f33-4aea-8efd-5ec8e8b29264 /service_id/a96e1758-8af6-47d9-9e99-569d5ca6a41c
      postgresql_pgstatements_agent Waiting   /agent_id/8ab32b6a-24f9-4478-bd22-47ce8e9dcb74 /service_id/6bf82290-7517-45b4-9ac3-304b690f353c
      

       

      Additional information:
      See attachments

      pmm-agent is filled with these errors:

       

      It's happening because of changes in pg_stat_statements table in PostgreSQL 13.

      Suggested solution:

        Attachments

          Activity

            People

            Assignee:
            jiri.ctvrtka Jiří Čtvrtka
            Reporter:
            beata.handzelova Beata Handzelova
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Smart Checklist