Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Follow a live server

watch loops snap, fetch and report, and serves the live dashboard on a local address.

pgloupe watch --conn postgres://me@db.example.com/postgres \
  --provider aws-rds --instance my-db --interval 5m --window 24h

It prints a local URL. The page keeps your view, search, selected row and scroll position when it refreshes, and says when the watch process behind it restarted.

FlagDefaultWhat it does
--interval5mtime between updates
--window24hhow far back the report looks
--listen127.0.0.1:8080where the dashboard is served; loopback only unless --allow-remote, since the page holds statement text
--state-dirpgloupe-watchwhere snapshots, fetched logs and the store are kept
--keep-snapshots288snapshots to keep (24 hours at 5 minutes)
--outalso write the HTML here after every update
--oncerun one cycle and exit instead of looping and serving

The pieces

CommandWhat it does
doctorchecks the server and the role and says how to fix what is missing; --output json for scripts
snaptakes a pg_stat_statements snapshot, with pg_stat_database and the settings; read-only
logs fetchdownloads log files from RDS (and, experimentally, other providers), resumable
exportdoctor, snap, logs fetch and report in one command
watchrepeats all of that and serves the result

Connection

Pass --conn or set PGLOUPE_DSN. Passwords come from PGPASSWORD (or the variable named by --password-env) or ~/.pgpass; keep them out of the command line. PGSSLMODE and PGSSLROOTCERT are honoured; verify-ca and verify-full check the server certificate, and --sslrootcert gives the CA to trust (for RDS, the regional bundle from AWS). A Unix socket skips TLS.