Details
-
Bug
-
Status: Done
-
Medium
-
Resolution: Fixed
-
2.25.0
-
[obsolete] Observability
Description
If we follow the basic steps to monitor a PostgreSQL instance in an Ubuntu 20.04 server, we get missing metrics.
vagrant@ubuntu-20:~$ curl -s -k -u pmm:/agent_id/b0bb15e5-da5a-42fc-89d5-4423b9bb2223 http://127.0.0.1:42002/metrics | grep -i postgres -c
55
vagrant@ubuntu-20:~$ curl -s -k -u pmm:/agent_id/b0bb15e5-da5a-42fc-89d5-4423b9bb2223 http://127.0.0.1:42002/metrics | grep -i uptime -c
0
As you can see, there are 55 metrics exported that contain "postgres" string in it, but none that contain "uptime". The Home Dashboard and PostgreSQL Summary Dashboard won't show the uptime due to this. It's expecting the pg_postmaster_uptime_seconds metric to exist.
See attached screenshots with uptime panels showing N/A.
vagrant@ubuntu-20:~$ curl -s -k -u pmm:/agent_id/b0bb15e5-da5a-42fc-89d5-4423b9bb2223 http://127.0.0.1:42002/metrics | grep -i postmaster -c
0
There are no metrics exported with "postmaster" in it, either.
Versions used:
- Ubuntu 20.04
- PMM 2.25
- PostgreSQL 12.9
vagrant@ubuntu-20:~$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.04.3 LTS Release: 20.04 Codename: focalvagrant@ubuntu-20:~$ sudo pmm-admin --version ProjectName: pmm-admin Version: 2.25.0 PMMVersion: 2.25.0 Timestamp: 2021-12-13 09:38:36 (UTC) FullCommit: 4b81157ad02975c417daef2600cb0dcd3907ffa1
This is not happening on RHEL systems:
[root@agustin-gallego-node1 ~]# cat /etc/redhat-release CentOS Linux release 7.9.2009 (Core) [root@agustin-gallego-node1 ~]# pmm-admin --version ProjectName: pmm-admin Version: 2.24.0 PMMVersion: 2.24.0 Timestamp: 2021-11-18 14:57:43 (UTC) FullCommit: 2af1c987f304a3fa375af0986b6af6a0390d41bd
[root@agustin-gallego-node1 ~]# curl -s -k -u pmm:/agent_id/91edcc5c-68b7-4b93-87f0-17f797ad1b9a http://127.0.0.1:42002/metrics | grep -i uptime pg_exporter_user_queries_load_error{filename="/usr/local/percona/pmm2/collectors/custom-queries/postgresql/high-resolution/queries-postgres-uptime.yml",hashsum="088cda481b62888aa2674b361c8a390586d96f02f9be384f475dcf1d6e3997fc"} 0 # HELP pg_postmaster_uptime_seconds Service uptime # TYPE pg_postmaster_uptime_seconds gauge pg_postmaster_uptime_seconds{server="10.124.33.205:5432"} 147.813529
There seems to be 2 more metrics having "postgres" exported in RHEL, too:
[root@agustin-gallego-node1 ~]# curl -s -k -u pmm:/agent_id/91edcc5c-68b7-4b93-87f0-17f797ad1b9a http://127.0.0.1:42002/metrics | grep -i postgres -c
57