Applications Systems
DPM reports that pg_stat_statements is not available, but it is enabled
The pg_stat_statements extension is required when using DPM to monitor a PostgreSQL database remotely. The vc-pgsql-metrics agent may log an error such as `[WARN] pid[1] pg_stat_statements metrics not available: pq: relation "pg_stat_statements" does not exist` even when a user is able to query the table successfully.
First published date
Last published date
Overview
Product section
Cause
pg_stat_statements, the pg_stat_statements view must be added to the database that DPM is connecting to. This is the internal PostgreSQL database, not the host itself. For example, you may have run the CREATE EXTENSION on the reporting database, while DPM is connecting to postgres (which is the default unless another database is specified).Resolution
postgres). Within DPM, go to Inventory, and click the edit icon under Settings next to the name of the Postgres database. Then click the "Edit Credentials" tab and verify that the database is correct. You can also read the agent’s log in /var/log/vividcortex, which will contain the connection information at startup. The database provided must be the same database where you ran CREATE EXTENSION pg_stat_statements.You can also confirm this is the cause by connecting to PostgreSQL using the same username, password, and database that you have provided to the agent and then executing
select count(*) from pg_stat_statements.