NO EXTENSION · NO DATABASE RESTART

Connect your PostgreSQL

Two ways in, both without compiling anything or restarting your database. Works on PostgreSQL 13–17, self-managed or fully managed (RDS, Aurora, Cloud SQL).

Agentless (pull)

Easiest

You install nothing. We connect to your database over TLS from our side and collect on a schedule. Best for RDS, Aurora and Cloud SQL, or any database we can reach.

Requires: a read-only user and network access from our collectors.

Agent (push)

Private networks

A small Python agent runs on any host that can reach your database and pushes metrics out every 60s. Best when your database is not reachable from the internet.

Requires: Python 3 on one host, outbound HTTPS.

Agent one-liner

Installs Python dependencies, the agent and its systemd unit, then starts collecting. Get YOUR_TOKEN from your instance page.

$ curl -fsSL https://pgmonitoring.com/install.sh | sudo bash -s -- --token YOUR_TOKEN

Omit --token to install without starting — you can fill it into /etc/pg_monitor_agent.conf later.

Create a read-only monitoring user

Managed databases don't allow shared_preload_libraries changes, so nothing gets installed on the server. Create a user and we do the rest.

-- Monitoring role (read-only)
CREATE USER pgmonitoring WITH PASSWORD 'a-strong-password';
GRANT pg_monitor TO pgmonitoring;
GRANT CONNECT ON DATABASE your_db TO pgmonitoring;

-- Recommended: richer query statistics
CREATE EXTENSION IF NOT EXISTS pg_stat_statements;

Note: pg_monitor here is the built-in PostgreSQL role — not an extension to compile. On RDS/Aurora, add pg_stat_statements to shared_preload_libraries in your parameter group.

Then add the instance

Sign in, choose Agentless (pull), and enter host, port, database and those credentials. Collection starts on the next cycle — no agent, no extension, no restart.

Configuring the agent

1

Edit /etc/pg_monitor_agent.conf

[agent]
dsn       = host=/var/run/postgresql dbname=postgres
endpoint  = https://pgmonitoring.com/api/v1/agent/metrics
token     = your-instance-token
interval  = 60                       # seconds between pushes
log_level = INFO

No database password on disk: with a token set, the agent fetches credentials over HTTPS at startup.

2

Start it

sudo systemctl daemon-reload
sudo systemctl enable --now pg_monitor_agent

Verify

sudo systemctl status pg_monitor_agent
journalctl -u pg_monitor_agent -f

Your instance page flips to online within a couple of collection cycles. After that the agent keeps itself up to date — each update is checksum- and signature-verified.

Running the old pg_monitor extension?

It still works and we keep reading from it, but it is no longer shipped or required — the agent collects everything it did using plain SQL, with no shared_preload_libraries and no database restart. New instances should use one of the two modes above.

Ready to connect your instance to PG Monitoring?

Sign in to add your instance
Talk to us