finds.dev← search

// the find

prometheus-community/postgres_exporter

★ 3,560 · Go · Apache-2.0 · updated Jul 2026

A PostgreSQL metric exporter for Prometheus

postgres_exporter is the standard way to get PostgreSQL metrics into Prometheus. It scrapes pg_stat_* views and exposes them as Prometheus metrics, with optional custom queries for anything the built-ins don't cover. This is what you deploy if you're running Postgres and want to alert on replication lag, connection saturation, vacuum progress, or transaction wraparound.

The collector architecture is clean — each pg_stat_* view gets its own file with a corresponding test, so adding or auditing a metric is straightforward. The non-superuser setup is actually documented and works, which is rare for exporters of this type. Multi-target support via the /probe endpoint means you can run one exporter instance against many managed databases (RDS, Cloud SQL) without sidecar gymnastics. The included postgres_mixin ships ready-made Grafana dashboards and alert rules in Jsonnet, so you're not starting from scratch on dashboards.

The custom queries YAML path is deprecated with no migration story beyond 'use built-in collectors or switch to sql_exporter' — if you've built automation around queries.yaml, you're holding legacy config. auto-discover-databases is also deprecated, which is the feature most people reach for when they have many databases per server; the replacement story isn't clearly spelled out. The multi-target /probe feature is still labeled beta despite being the right answer for SaaS-hosted Postgres, so it can change under you. pg_stat_statements is disabled by default and requires pg_stat_statements to be loaded in shared_preload_libraries — easy to miss, and you'll get no error, just missing metrics.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →