Set up PostgreSQL for Monitoring
User Permissions
pg_stat_activity
and
pg_stat_statements.
Enable the pg_stat_statements Section
Validate the Setup
SELECT * FROM pg_stat_activity_allusers
SELECT * FROM pg_stat_statements_allusers