r/PostgreSQL • u/Xappz1 • 8h ago
Tools pgloupe: offline analyzer for Postgres logs and pg_stat_statements
pgloupe is a command-line tool that reads PostgreSQL logs and pg_stat_statements snapshots, joins them, and writes one HTML report with what to look at first and the numbers behind it.
I made it because going through logs and stats by hand takes too long, and I didn't want to paste hundreds of thousands of log rows into a hosted tool or an AI agent. It runs entirely on your machine and sends nothing anywhere.
- Reads stderr, csvlog and jsonlog formats
- Takes pg_stat_statements snapshots as CSV, so you can compare points in time. It notices stats resets and entries evicted from pg_stat_statements
- Works with Postgres 14 to 18, including managed ones like RDS
- One static binary: no server, no dependencies, no parser to configure
- Fast and light: on 11 GB of generated test logs it read about 141 MB/s on one thread, using around 44 MiB of memory
Try it:
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/vtrbraga/pgloupe/releases/latest/download/pgloupe-installer.sh | sh
pgloupe --help
Also available through Homebrew, cargo install pgloupe and Docker.
Repo: https://github.com/vtrbraga/pgloupe
Docs: https://vtrbraga.github.io/pgloupe/
This is the first stable release (0.1.0) and my first open source project. I'd like to hear what's missing or wrong: log formats or settings it misreads, findings that aren't useful, anything confusing in the report. Issues and comments are both welcome!