RootTrace / Integrations / PostgreSQL
Databases & queues
PostgreSQL monitoring for the questions that page you.
Replica lag, connections near max, a query that has been running for an hour, sessions stuck idle-in-transaction: the collector checks each one against prefilled thresholds and opens an issue with the evidence attached.
What RootTrace watches
Every reading is checked continuously; bad readings become grouped issues with the evidence attached. RootTrace also remembers whether it has seen the same incident before.
- Replication healthReplica lag in seconds and replication slot lag in bytes; recovery mode is reported so a promoted replica is never a surprise.
- Connection saturationActive vs. max connections as a percentage.
- Long-running queriesQueries past a configurable age, with idle-in-transaction sessions counted separately.
- Blocked sessions & deadlocksLock contention as it happens, plus the deadlock counter.
- Cache hit ratioBuffer cache effectiveness: the early sign of a working set outgrowing memory.
- Database size & latencySize in bytes and connection latency in milliseconds, trended.
Warn and fail thresholds, prefilled
Sensible defaults out of the box, overridable per host with environment variables. No threshold spreadsheet required on day one.
- Connection usage warn / fail percent
ROOTTRACE_POSTGRES_CONNECTION_WARN_PERCENT - Replica lag fail seconds
ROOTTRACE_POSTGRES_REPLICA_LAG_FAIL_SECONDS - Long-query age seconds
ROOTTRACE_POSTGRES_LONG_QUERY_SECONDS
Setup
# after installing the collector package, point it at your instance: $ export ROOTTRACE_POSTGRES_DSN='postgresql://user:pass@postgres-1:5432/appdb'
Read-only by architecture: no write path, no remediation executor, no inbound ports. Credential-like evidence is redacted before it leaves the host.
One collector, live in minutes
Everything on this page comes from the same read-only collector: one command per host, then point it at your targets.
$ # after adding the signed RootTrace dnf or apt repository:
sudo dnf install roottrace-collector # apt: sudo apt install roottrace-collector
sudoedit /etc/roottrace/collector.env # set ROOTTRACE_COLLECTOR_TOKEN and API URL
sudo roottrace-collector-setup apply
sudo systemctl enable --now roottrace-collector
Questions, answered honestly
Does it need superuser?
No. A regular role that can read pg_stat views is enough. The collector only runs read queries and never writes to the database.
Is this safe to run next to production?
The collector is read-only by architecture, not by policy: there is no write path, no remediation executor, and no privileged mode to switch on. It sends short-lived outbound HTTPS requests, opens no inbound ports, and redacts credential-like evidence before anything leaves the host.
Do I need a separate agent for this?
No. One RootTrace collector per host covers every integration on this site: databases, web servers, containers, endpoints, and the Linux host itself, all from one signed package or container. You point it at targets with environment variables; there is nothing else to deploy.
Related integrations
Free on 5 hosts. Live in minutes.
Create a workspace, install one collector, and watch issues explain themselves.
RootTrace