PostgreSQL
Connect PostgreSQL to the Pagerly SRE Agent to check active queries, locks, and replication lag.
Last updated
Connect PostgreSQL to the Pagerly SRE Agent to check active queries, locks, and replication lag.
Show active queries β find long-running queries, blocked sessions, idle-in-transaction
Show lock contention β which queries are blocking others
Show replication status β lag, state, sync status for each replica
Show table statistics β dead tuples (needs VACUUM), seq scans, table sizes
Create a read-only PostgreSQL user with monitoring permissions:
CREATE USER pagerly WITH PASSWORD 'your-password';
GRANT pg_monitor TO pagerly;Ensure the database is accessible from the internet (or via SSH tunnel)
Enter the connection details in the Pagerly dashboard
Connection String
host:port/database
your-db-host.com:5432/dbname
Username
PostgreSQL username with pg_monitor role
pagerly
Password
PostgreSQL password
your-password
We add the jdbc:postgresql:// prefix automatically. Just enter host:port/dbname.
Use the pg_monitor role β it grants read-only access to monitoring views (pg_stat_activity, pg_stat_replication, etc.) without allowing data modification.
"Main database is api_production. Tables in public schema. Long-running queries usually involve the orders table."
Last updated