Step 1: Configure RDS Instance

In order to set up pganalyze monitoring for Amazon RDS you'll need to first follow these steps to enable the pg_stat_statements extension for collecting query statistics.

This guide assumes you have an already running Amazon RDS PostgreSQL server you want to monitor.


Enabling pg_stat_statements

Connect to your database as an RDS superuser (usually the credentials you created the database with), e.g. using psql.

Run the following SQL commands to enable the extension, and make sure it was installed correctly:

CREATE EXTENSION IF NOT EXISTS pg_stat_statements;
SELECT * FROM pg_stat_statements LIMIT 1;

This should return one row of query statistics information.

Important: If you get the error pg_stat_statements must be loaded via shared_preload_libraries, follow the troubleshooting document.

Review pg_stat_statements configuration parameters

There are a number of settings that define how pg_stat_statements will collect statistics. The right configuration will depend on your server, workload, and preferences, but the following is the example of what to modify.

NameNew Value 
pg_stat_statements.trackALLOptional, enables tracking of queries inside stored procedures
track_io_timing1Optional, enables tracking of per-query I/O statistics
track_activity_query_size2048Optional, increases the max size of the query strings Postgres records

Find the parameter group for your database and apply the settings above.

In case you created a new parameter group you'll have to modify your database to use the Parameter Group you created earlier.

Enable Enhanced Monitoring

We also highly recommend turning on Enhanced Monitoring, if you haven't already - it will give you
more detailed system-level statistics that can be helpful, e.g. to debug I/O issues.

If Enhanced Monitoring is enabled, pganalyze will automatically collect and show this additional information in the dashboard as well.


Continue by creating the monitoring user:

Proceed to Step 2: Create Monitoring User


Couldn't find what you were looking for or want to talk about something specific?
Start a conversation with us →