pgmetrics

Easily collect and report PostgreSQL metrics for scripting, automation and troubleshooting.

pgmetrics is an open-source, zero-dependency, single-binary tool that can collect a lot of information and statistics from a running PostgreSQL server and display it in easy-to-read text format or export it as JSON for scripting.

Subsystem Info

Collects information about WAL archiving, BG writer, backends (waiting, idling, transaction too long), vacuum progress, replication (primary, standby), replication slots (physical, logical)

Database Info

Gathers stats about tablespaces (location, disk and inode usage), database sizes, transaction ID wraparound age, commit ratios, bloat, deadlocks, conflicts, cache hit ratio, installed extensions, disabled triggers, pg_stat_statements

Table Info

Collects stats about last vacuum and analyze runs, changes since last vacuum, HOT update ratio, ins/upd/del ratios, seq and idx scan efficiency, table size and bloat, index hit ratio

Go-based

Written in Go (Golang). pgmetrics is a zero-dependency, statically-linked single binary executable, available on Linux, Windows, macOS and FreeBSD.

Easy-to-use CLI

Understands most of the same command-line flags and environment variables that psql and other PostgreSQL-bundled CLI tools use.

Open Source

Released under the Apache 2.0 Open Source license. Lives on GitHub at rapidloop/pgmetrics.


Join the mailing list for announcements and discussion:
Download the latest release:
v1.3.0, released 23-May-2018
Read the documentation:

pgDash: pgmetrics-based Visualization, Monitoring & Alerting

Send your pgmetrics reports to pgDash for beautiful visualization, real-time monitoring, alerts, baselines and more. pgDash is a commercial offering from RapidLoop, with both SaaS and self-hosted/on-premise deployment options. Find out more and sign up for a beta invite at pgDash.
© RapidLoop, Inc. 2018 · All Rights Reserved.