- 1 PostgreSQL builtin & contrib
- 2 External projects
- 2.1 Checkers
- 2.2 Interfaces & collectors
- 2.3 Generic monitoring solutions with plugins
- 2.4 Postgres-centric monitoring solutions
PostgreSQL builtin & contrib
PostgreSQL collects lots of data on its own and offers it via the pg_stat(io)_ system views
The following extensions offer access to Postgres internals which may be of interest or collect additional information. Most of them are shipped with Postgres (the -contrib packages may need to be installed) and can be activated via the extension interface.
pg_stat_statements tracks all queries that are executed on the server and records average runtime per query "class" among other parameters.
pg_stat_plans extends on pg_stat_statements and records query plans for all executed quries. This is very helpful when you're experiencing performance regressions due to inefficient query plans due to changed parameters or table sizes.
pgstattuple can generate statistics for tables and indexes, showing how much space in each table & index is consumed by live tuples, deleted tuples as well as how much unused space is available in each relation.
check_postgres is a command line tool which is designed to be run from software like Icinga, MRTG or as a standalone tool. It can monitor many aspects of the database and trigger warnings when thresholds are violated.
Interfaces & collectors
These tools either offer an interface to PostgreSQL monitoring-relevant data or can aggregate and prepare them for other systems.
This is useful for network management systems which are limited to SNMP protocol.
pganalyze-collector is a tool which collects pg_stat_plans query information as well as various performance-relevant database parameters and converts them into a JSON structure for easy ingestion in other systems.
Generic monitoring solutions with plugins
PostgreSQL Plugins developed in Perl are included in the Core Munin Distribution. The following plugins are included by default: postgres_bgwriter, postgres_locks_, postgres_tuples_, postgres_cache_, postgres_querylength_, postgres_users, postgres_checkpoints, postgres_scans_, postgres_xlog, postgres_connections_, postgres_size_, postgres_connections_db, postgres_transactions_
PyMunin includes a Multigraph Munin Plugin written in Python that implements the following graphs: pg_connections, pg_diskspace, pg_blockreads, pg_xact, pg_tup_read, pg_tup_write, pg_blockreads_detail, pg_xact_commit_detail, pg_xact_rollback_detail, pg_tup_return_detail, pg_tup_fetch_detail, pg_tup_delete_detail, pg_tup_update_detail, pg_tup_insert_detail
Detailed setup instructions for common Linux platforms can be found at highperfpostgres.com
Postgres-centric monitoring solutions
EnterpriseDB Postgres Enterprise Manager
Postgres Enterprise Manager is a commercial application offered by EnterpriseDB which covers many aspects of Postgres operations & monitoring in large environments.
pganalyze is a commercial SaaS offering which focuses on performance monitoring and automated tuning suggestions.
pgwatch is a PHP web application which offers interactive graphs for relevant Postgres data.