prometheus-community / postgres_exporter

A PostgreSQL metric exporter for Prometheus
Apache License 2.0
2.82k stars 743 forks source link

Make walreceiver collector useful w/o repmgr #1086

Closed bitfehler closed 2 weeks ago

bitfehler commented 2 weeks ago

In a streaming replication setup that was created without replication manager (repmgr), the stat_wal_receiver collector does not return any metrics, because one value it wants to export is not present.

This is rather overly opinionated. The missing metric is comparatively uninteresting and does not justify discarding all the others. And replication setups created without repmgr are not exactly rare.

This commit makes the one relevant metric optional and simply skips it if the respective value cannot be determined.