In the sample script, metrics items are created from the following perspectives to regularly check whether the database cluster is operating properly.
Is the database capacity sufficient?
Are your SQL performance and connections adequate?
Are each node operating normally?
Metrics name | Metrics |
---|---|
pg_stat_bgwriter_* | Maps displayed in statistics collection |
pg_stat_database_* | Maps displayed in statistics collection |
pg_stat_database_conflicts_* | Maps displayed in statistics collection |
pg_stat_archiver_* | Maps displayed in statistics collection |
pg_stat_activity_* | Maps displayed in statistics collection |
pg_stat_replication_* | Maps displayed in statistics collection |
pg_replication_slots_* | Mapping to the pg_replication_slots system catalog |
pg_locks_* | Mapping to the pg_locks system catalog |
pg_capacity_connection_* | Connection metrics (e.g. txns running for 1 hour) |
pg_capacity_schema_* | Schema disk space metrics |
pg_capacity_tblspace_* | Tablespace disk space metrics |
pg_capacity_tblvacuum_* | Metrics for tables that haven't been vacuumed in days |
pg_capacity_longtx_* | Number of transactions running for more than 5 minutes |
pg_performance_locking_detail_* | Blocked process details |
pg_performance_locking_* | Number of blocked processes |
pg_stat_user_tables_* | Vital statistics from pg_stat_user_tables |
pg_statio_user_tables_* | Vital statistics from pg_statio_user_tables |
pg_stat_statements_* | Statistics for SQL statements executed by the server |
pg_capacity_tblbloat_* | Table fetch bloat |