Monitor PostgreSQL database age with telegraf

PostgreSQL is amazing database but has one very problematic feature which can be disastrous. This problem is called transaction ID wraparound error. We already had one problem of this kind so we set monitoring for it. The easiest way is to monitor “age of...

Monitor PostgreSQL heartbeat with telegraf

The easiest way how to monitor if PostgreSQL is up and running without causing any necessary load on database is to connect and get just pid of the session using command select pg_backend_pid(); – this is very lightweight action. I set this monitoring using...

Monitor PostgreSQL queries in Grafana

To be able to monitor PostgreSQL queries under non superuser you need to create some objects as superuser and grant select permissions to your monitoring user. Solution based on “How to view the query of another session in pg_stat_activity without being super...