missing data for a few graphs when the PostgreSQL server only has the default Postgres database, and there is no other user-created database.

Description

Issue: When the PostgreSQL server only has the default Postgres database, and there is no other user-created database, few pmm postgresql graphs do not show data. Just creating an empty database will fix the issue and graphs will start showing data.

Tested with PMM 2.43.2 and PostgreSQL-16.

How to test

Configure PMM 2.43.2 and PostgreSQL-16.

make sure postgresql only has default databases as below,

[postgres@node0 ~]$ psql psql (16.6 - Percona Distribution) Type "help" for help. postgres=# \l List of databases Name | Owner | Encoding | Locale Provider | Collate | Ctype | ICU Locale | ICU Rules | Access privileges -----------+----------+----------+-----------------+---------+---------+------------+-----------+----------------------- postgres | postgres | UTF8 | libc | C.UTF-8 | C.UTF-8 | | | template0 | postgres | UTF8 | libc | C.UTF-8 | C.UTF-8 | | | =c/postgres + | | | | | | | | postgres=CTc/postgres template1 | postgres | UTF8 | libc | C.UTF-8 | C.UTF-8 | | | =c/postgres + | | | | | | | | postgres=CTc/postgres (3 rows) postgres=# \dx List of installed extensions Name | Version | Schema | Descript ion --------------------+---------+------------+-------------------------------------- ---------------------------------- pg_stat_statements | 1.10 | public | track planning and execution statisti cs of all SQL statements executed plpgsql

 

Add postgresql tp pmm monitoring,

[root@node0 /]# pmm-admin add postgresql pgsql16 --username=pmm --password=pmmPWD 127.0.0.1:5432 PostgreSQL Service added. Service ID : /service_id/ba239eaa-dc49-499e-9076-08929dff9a28 Service name: pgsql16 Warning: Could not to detect the pg_stat_monitor extension on your system. Falling back to the pg_stat_statements. [root@node0 /]# pmm-admin list Service type Service name Address and port Service ID PostgreSQL pgsql16 127.0.0.1:5432 /service_id/ba239eaa-dc49-499e-9076-08929dff9a28 Agent type Status Metrics Mode Agent ID Service ID Port pmm_agent Connected /agent_id/5a2e0a84-6828-4812-af5e-07f20391ef03 0 node_exporter Running push /agent_id/e839a3de-e844-480e-ac67-32ca72e26601 42001 postgres_exporter Running push /agent_id/079d8b95-44c9-4e51-9d58-2b9998126e18 /service_id/ba239eaa-dc49-499e-9076-08929dff9a28 42002 postgresql_pgstatements_agent Running /agent_id/34aaa703-6515-4d36-b795-09bc12aad9b1 /service_id/ba239eaa-dc49-499e-9076-08929dff9a28 0 vmagent Running push /agent_id/42eb7639-c8e2-43fc-9cd6-135d9245cf9e 42000 [root@node0 /]#

We can see in the below screeshorts a few graphs with no data in PostgreSQL Instance Summary,

before adding data to postgres.png
before adding data to postgres db_2.png

Let's add some data to postgres using pgbench,

[postgres@node0 ~]$ /usr/pgsql-16/bin/pgbench -i -s 50 postgres [postgres@node0 ~]$ /usr/pgsql-16/bin/pgbench -c 5 -j 2 -t 10000 postgres

It's still the same, with few graphs with no data.

no_data_after adding data to Postgres DB.png

QAN is working fine, and we can see pgbench queries,

postgres_QAN.png

 

Workaround:

Create database,

postgres=# create database db1; CREATE DATABASE postgres=# exit

and graphs will start showing data.

Example:

Create new db started showing data in pmm.png
Create new db started showing data in pmm_2.png

How to document

None

AFFECTED CS IDs

CS0051329

Attachments

7
  • 11 Dec 2024, 03:19 PM
  • 11 Dec 2024, 11:29 AM
  • 11 Dec 2024, 11:29 AM
  • 11 Dec 2024, 11:29 AM
  • 11 Dec 2024, 11:29 AM
  • 11 Dec 2024, 11:29 AM
  • 11 Dec 2024, 11:29 AM

Activity

Show:

Lalit Choudhary December 11, 2024 at 3:19 PM

The FR feature is about “Remove exclusion of default PG database (postgres) from filters on dashboards.”

currently, we don’t see the Postgres database in the DB filter list, so yes, FR should fix this issue.

image-20241211-151844.png

Thanks.

Roma Novikov December 11, 2024 at 1:30 PM

pls check the ^ and feature build for it. IS this solved the problem?

Roma Novikov December 11, 2024 at 11:21 AM

This will be changed in pmm v3 - https://perconadev.atlassian.net/browse/PMM-13550

Duplicate

Details

Assignee

Reporter

Priority

Components

Labels

Needs QA

Yes

Needs Doc

Yes

Affects versions

Environment

Issue: When the postgresql server only has the default postgres database and there is no other database, few pmm graphs not showing data for Postgresql monitoring.

E

Smart Checklist

Created December 11, 2024 at 11:15 AM
Updated December 12, 2024 at 8:23 AM
Resolved December 12, 2024 at 8:23 AM

Flag notifications