PostgreSQL
Connect PostgreSQL to the Pagerly SRE Agent to check active queries, locks, and replication lag.
What the Agent Can Do
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
Setup Instructions
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
Required Credentials
Connection String
host:port/database
your-db-host.com:5432/dbname
Username
PostgreSQL username with pg_monitor role
pagerly
Password
PostgreSQL password
your-password
Context Prompt Tips
"Main database is api_production. Tables in public schema. Long-running queries usually involve the orders table."
Docs
Last updated