| 1 | # you can disable an alarm notification by setting the 'to' line to: silent |
| 2 | |
| 3 | template: postgres_total_connection_utilization |
| 4 | on: postgres.connections_utilization |
| 5 | class: Utilization |
| 6 | type: Database |
| 7 | component: PostgreSQL |
| 8 | lookup: average -1m unaligned of used |
| 9 | units: % |
| 10 | every: 1m |
| 11 | warn: $this > (($status >= $WARNING) ? (70) : (80)) |
| 12 | crit: $this > (($status == $CRITICAL) ? (80) : (90)) |
| 13 | delay: down 15m multiplier 1.5 max 1h |
| 14 | summary: PostgreSQL connection utilization |
| 15 | info: Average total connection utilization over the last minute |
| 16 | to: dba |
| 17 | |
| 18 | template: postgres_acquired_locks_utilization |
| 19 | on: postgres.locks_utilization |
| 20 | class: Utilization |
| 21 | type: Database |
| 22 | component: PostgreSQL |
| 23 | lookup: average -1m unaligned of used |
| 24 | units: % |
| 25 | every: 1m |
| 26 | warn: $this > (($status >= $WARNING) ? (15) : (20)) |
| 27 | delay: down 15m multiplier 1.5 max 1h |
| 28 | summary: PostgreSQL acquired locks utilization |
| 29 | info: Average acquired locks utilization over the last minute |
| 30 | to: dba |
| 31 | |
| 32 | template: postgres_txid_exhaustion_perc |
| 33 | on: postgres.txid_exhaustion_perc |
| 34 | class: Utilization |
| 35 | type: Database |
| 36 | component: PostgreSQL |
| 37 | calc: $txid_exhaustion |
| 38 | units: % |
| 39 | every: 1m |
| 40 | warn: $this > 90 |
| 41 | delay: down 15m multiplier 1.5 max 1h |
| 42 | summary: PostgreSQL TXID exhaustion |
| 43 | info: Percent towards TXID wraparound |
| 44 | to: dba |
| 45 | |
| 46 | # Database alarms |
| 47 | |
| 48 | template: postgres_db_cache_io_ratio |
| 49 | on: postgres.db_cache_io_ratio |
| 50 | class: Workload |
| 51 | type: Database |
| 52 | component: PostgreSQL |
| 53 | lookup: average -1m unaligned of miss |
| 54 | calc: 100 - $this |
| 55 | units: % |
| 56 | every: 1m |
| 57 | warn: $this < (($status >= $WARNING) ? (70) : (60)) |
| 58 | crit: $this < (($status == $CRITICAL) ? (60) : (50)) |
| 59 | delay: down 15m multiplier 1.5 max 1h |
| 60 | summary: PostgreSQL DB ${label:database} cache hit ratio |
| 61 | info: Average cache hit ratio in db ${label:database} over the last minute |
| 62 | to: dba |
| 63 | |
| 64 | template: postgres_db_transactions_rollback_ratio |
| 65 | on: postgres.db_transactions_ratio |
| 66 | class: Workload |
| 67 | type: Database |
| 68 | component: PostgreSQL |
| 69 | lookup: average -5m unaligned of rollback |
| 70 | units: % |
| 71 | every: 1m |
| 72 | warn: $this > (($status >= $WARNING) ? (0) : (2)) |
| 73 | delay: down 15m multiplier 1.5 max 1h |
| 74 | summary: PostgreSQL DB ${label:database} aborted transactions |
| 75 | info: Average aborted transactions percentage in db ${label:database} over the last five minutes |
| 76 | to: dba |
| 77 | |
| 78 | template: postgres_db_deadlocks_rate |
| 79 | on: postgres.db_deadlocks_rate |
| 80 | class: Errors |
| 81 | type: Database |
| 82 | component: PostgreSQL |
| 83 | lookup: sum -1m unaligned of deadlocks |
| 84 | units: deadlocks |
| 85 | every: 1m |
| 86 | warn: $this > (($status >= $WARNING) ? (0) : (10)) |
| 87 | delay: down 15m multiplier 1.5 max 1h |
| 88 | summary: PostgreSQL DB ${label:database} deadlocks rate |
| 89 | info: Number of deadlocks detected in db ${label:database} in the last minute |
| 90 | to: dba |
| 91 | |
| 92 | # Table alarms |
| 93 | |
| 94 | template: postgres_table_cache_io_ratio |
| 95 | on: postgres.table_cache_io_ratio |
| 96 | class: Workload |
| 97 | type: Database |
| 98 | component: PostgreSQL |
| 99 | lookup: average -1m unaligned of miss |
| 100 | calc: 100 - $this |
| 101 | units: % |
| 102 | every: 1m |
| 103 | warn: $this < (($status >= $WARNING) ? (70) : (60)) |
| 104 | crit: $this < (($status == $CRITICAL) ? (60) : (50)) |
| 105 | delay: down 15m multiplier 1.5 max 1h |
| 106 | summary: PostgreSQL table ${label:table} db ${label:database} cache hit ratio |
| 107 | info: Average cache hit ratio in db ${label:database} table ${label:table} over the last minute |
| 108 | to: dba |
| 109 | |
| 110 | template: postgres_table_index_cache_io_ratio |
| 111 | on: postgres.table_index_cache_io_ratio |
| 112 | class: Workload |
| 113 | type: Database |
| 114 | component: PostgreSQL |
| 115 | lookup: average -1m unaligned of miss |
| 116 | calc: 100 - $this |
| 117 | units: % |
| 118 | every: 1m |
| 119 | warn: $this < (($status >= $WARNING) ? (70) : (60)) |
| 120 | crit: $this < (($status == $CRITICAL) ? (60) : (50)) |
| 121 | delay: down 15m multiplier 1.5 max 1h |
| 122 | summary: PostgreSQL table ${label:table} db ${label:database} index cache hit ratio |
| 123 | info: Average index cache hit ratio in db ${label:database} table ${label:table} over the last minute |
| 124 | to: dba |
| 125 | |
| 126 | template: postgres_table_toast_cache_io_ratio |
| 127 | on: postgres.table_toast_cache_io_ratio |
| 128 | class: Workload |
| 129 | type: Database |
| 130 | component: PostgreSQL |
| 131 | lookup: average -1m unaligned of miss |
| 132 | calc: 100 - $this |
| 133 | units: % |
| 134 | every: 1m |
| 135 | warn: $this < (($status >= $WARNING) ? (70) : (60)) |
| 136 | crit: $this < (($status == $CRITICAL) ? (60) : (50)) |
| 137 | delay: down 15m multiplier 1.5 max 1h |
| 138 | summary: PostgreSQL table ${label:table} db ${label:database} toast cache hit ratio |
| 139 | info: Average TOAST hit ratio in db ${label:database} table ${label:table} over the last minute |
| 140 | to: dba |
| 141 | |
| 142 | template: postgres_table_toast_index_cache_io_ratio |
| 143 | on: postgres.table_toast_index_cache_io_ratio |
| 144 | class: Workload |
| 145 | type: Database |
| 146 | component: PostgreSQL |
| 147 | lookup: average -1m unaligned of miss |
| 148 | calc: 100 - $this |
| 149 | units: % |
| 150 | every: 1m |
| 151 | warn: $this < (($status >= $WARNING) ? (70) : (60)) |
| 152 | crit: $this < (($status == $CRITICAL) ? (60) : (50)) |
| 153 | delay: down 15m multiplier 1.5 max 1h |
| 154 | summary: PostgreSQL table ${label:table} db ${label:database} index toast hit ratio |
| 155 | info: average index TOAST hit ratio in db ${label:database} table ${label:table} over the last minute |
| 156 | to: dba |
| 157 | |
| 158 | template: postgres_table_bloat_size_perc |
| 159 | on: postgres.table_bloat_size_perc |
| 160 | class: Errors |
| 161 | type: Database |
| 162 | component: PostgreSQL |
| 163 | calc: ($table_size > (1024 * 1024 * 100)) ? ($bloat) : (0) |
| 164 | units: % |
| 165 | every: 1m |
| 166 | warn: $this > (($status >= $WARNING) ? (60) : (70)) |
| 167 | crit: $this > (($status == $CRITICAL) ? (70) : (80)) |
| 168 | delay: down 15m multiplier 1.5 max 1h |
| 169 | summary: PostgreSQL table ${label:table} db ${label:database} bloat size |
| 170 | info: Bloat size percentage in db ${label:database} table ${label:table} |
| 171 | to: dba |
| 172 | |
| 173 | template: postgres_table_last_autovacuum_time |
| 174 | on: postgres.table_autovacuum_since_time |
| 175 | class: Errors |
| 176 | type: Database |
| 177 | component: PostgreSQL |
| 178 | host labels: _hostname=!* |
| 179 | calc: $time |
| 180 | units: seconds |
| 181 | every: 1m |
| 182 | warn: $this != nan AND $this > (60 * 60 * 24 * 7) |
| 183 | summary: PostgreSQL table ${label:table} db ${label:database} last autovacuum |
| 184 | info: Time elapsed since db ${label:database} table ${label:table} was vacuumed by the autovacuum daemon |
| 185 | to: dba |
| 186 | |
| 187 | template: postgres_table_last_autoanalyze_time |
| 188 | on: postgres.table_autoanalyze_since_time |
| 189 | class: Errors |
| 190 | type: Database |
| 191 | component: PostgreSQL |
| 192 | host labels: _hostname=!* |
| 193 | calc: $time |
| 194 | units: seconds |
| 195 | every: 1m |
| 196 | warn: $this != nan AND $this > (60 * 60 * 24 * 7) |
| 197 | summary: PostgreSQL table ${label:table} db ${label:database} last autoanalyze |
| 198 | info: Time elapsed since db ${label:database} table ${label:table} was analyzed by the autovacuum daemon |
| 199 | to: dba |
| 200 | |
| 201 | # Index alarms |
| 202 | |
| 203 | template: postgres_index_bloat_size_perc |
| 204 | on: postgres.index_bloat_size_perc |
| 205 | class: Errors |
| 206 | type: Database |
| 207 | component: PostgreSQL |
| 208 | calc: ($index_size > (1024 * 1024 * 10)) ? ($bloat) : (0) |
| 209 | units: % |
| 210 | every: 1m |
| 211 | warn: $this > (($status >= $WARNING) ? (60) : (70)) |
| 212 | crit: $this > (($status == $CRITICAL) ? (70) : (80)) |
| 213 | delay: down 15m multiplier 1.5 max 1h |
| 214 | summary: PostgreSQL table ${label:table} db ${label:database} index bloat size |
| 215 | info: Bloat size percentage in db ${label:database} table ${label:table} index ${label:index} |
| 216 | to: dba |