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

pg_stat_monitor issue in QAN

    XMLWordPrintable

    Details

    • Story Points:
      1
    • Sprint:
      Platform Sprint 26
    • Needs Review:
      Yes
    • Needs QA:
      Yes

      Description

      STR:

      Start PMM server with Percona distribution for PostgreSQL 11 or 12 - use attached docker-compse)
      Install PMM client and configure:

      sudo apt-get install pmm2-client
      sudo pmm-admin config --server-url=https://admin:admin@localhost
      --server-insecure-tls

      Enable pg_stat_monitor extension:

      postgres=# create extension pg_stat_monitor;
      

      Add PG via Swagger or curl http://127.0.0.1/swagger/#/PostgreSQL/AddPostgreSQL

      {
      "service_name": "postgrestest",
      "node_id": "$current node id",
      "address": "localhost",
      "port": 5432,
      "qan_postgresql_pgstatmonitor_agent" : true,
      "pmm_agent_id": "$pmm agent id"
      "username": "postgres",
      "password": "pass"
      }
      
      pmm@pmm-VirtualBox:~/docker_compose$ curl -X POST "https://admin:admin@127.0.0.1/v1/management/PostgreSQL/Add" -H "accept: application/json" -H "Content-Type: application/json" -d "{\"service_name\": \"testpostgres\",\"node_id\": \"/node_id/fab9c5ff-9fd9-4ab5-ae53-20703a4640d4\",\"address\": \"localhost\",\"port\": 5432,\"qan_postgresql_pgstatmonitor_agent\" : true,\"pmm_agent_id\": \"/agent_id/5e5a750b-abdb-4ffc-8a4d-f8bab85145ed\",\"username\": \"postgres\",\"password\": \"pass\"}" --insecure
      {
        "service": {
          "service_id": "/service_id/65bb2af1-947d-4046-80ff-48348efff11a",
          "service_name": "testpostgres",
          "node_id": "/node_id/fab9c5ff-9fd9-4ab5-ae53-20703a4640d4",
          "address": "localhost",
          "port": 5432,
          "socket": "",
          "environment": "",
          "cluster": "",
          "replication_set": "",
          "custom_labels": {
          }
        },
        "postgres_exporter": {
          "agent_id": "/agent_id/c2bad50e-9f6f-427b-9f3b-f21e114ffd2c",
          "pmm_agent_id": "/agent_id/5e5a750b-abdb-4ffc-8a4d-f8bab85145ed",
          "disabled": false,
          "service_id": "/service_id/65bb2af1-947d-4046-80ff-48348efff11a",
          "username": "postgres",
          "tls": false,
          "tls_skip_verify": false,
          "custom_labels": {
          },
          "status": "AGENT_STATUS_INVALID",
          "listen_port": 0
        },
        "qan_postgresql_pgstatements_agent": null,
        "qan_postgresql_pgstatmonitor_agent": {
          "agent_id": "/agent_id/ca35158f-a048-45bd-8996-05d4abbc1da7",
          "pmm_agent_id": "/agent_id/5e5a750b-abdb-4ffc-8a4d-f8bab85145ed",
          "disabled": false,
          "service_id": "/service_id/65bb2af1-947d-4046-80ff-48348efff11a",
          "username": "postgres",
          "tls": false,
          "tls_skip_verify": false,
          "query_examples_disabled": false,
          "custom_labels": {
          },
          "status": "AGENT_STATUS_INVALID"
        }
      }pmm@pmm-VirtualBox:~/docker_compose$ 
      

      Result:

      pg stat monitor agent is visible on Inventory page but not in QAN

       

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved:

                Smart Checklist