mirror of
https://github.com/samber/awesome-prometheus-alerts.git
synced 2026-06-21 08:57:19 +08:00
doc: add postgrseql bloat
This commit is contained in:
parent
4662cd2812
commit
08d482f314
1 changed files with 14 additions and 4 deletions
|
|
@ -555,12 +555,12 @@ groups:
|
|||
query: 'pg_replication_lag > 30 and ON(instance) pg_replication_is_replica == 1'
|
||||
severity: critical
|
||||
- name: Postgresql table not vacuumed
|
||||
description: Table has not been vacuumed for 24 hours
|
||||
query: 'time() - pg_stat_user_tables_last_autovacuum > 60 * 60 * 24'
|
||||
description: Table {{ $labels.relname }} has not been vacuumed for 10 days
|
||||
query: '(pg_stat_user_tables_last_autovacuum > 0) and (time() - pg_stat_user_tables_last_autovacuum) > 60 * 60 * 24 * 10'
|
||||
severity: warning
|
||||
- name: Postgresql table not analyzed
|
||||
description: Table has not been analyzed for 24 hours
|
||||
query: 'time() - pg_stat_user_tables_last_autoanalyze > 60 * 60 * 24'
|
||||
description: Table {{ $labels.relname }} has not been analyzed for 10 days
|
||||
query: '(pg_stat_user_tables_last_autoanalyze > 0) and (time() - pg_stat_user_tables_last_autoanalyze) > 24 * 60 * 60 * 10'
|
||||
severity: warning
|
||||
- name: Postgresql too many connections
|
||||
description: PostgreSQL instance has too many connections (> 80%).
|
||||
|
|
@ -629,6 +629,16 @@ groups:
|
|||
query: '((sum (pg_locks_count)) / (pg_settings_max_locks_per_transaction * pg_settings_max_connections)) > 0.20'
|
||||
severity: critical
|
||||
for: 2m
|
||||
- name: Postgresql bloat index high (> 80%)
|
||||
description: 'The index {{ $labels.idxname }} is bloated. You should execute `REINDEX INDEX CONCURRENTLY {{ $labels.idxname }};`'
|
||||
query: 'pg_bloat_btree_bloat_pct > 80 and on (idxname) (pg_bloat_btree_real_size > 100000000)'
|
||||
severity: warning
|
||||
for: 1h
|
||||
- name: Postgresql bloat table high (> 80%)
|
||||
description: 'The table {{ $labels.relname }} is bloated. You should execute `VACUUM {{ $labels.relname }};`'
|
||||
query: 'pg_bloat_table_bloat_pct > 80 and on (relname) (pg_bloat_table_real_size > 200000000)'
|
||||
severity: warning
|
||||
for: 1h
|
||||
|
||||
- name: SQL Server
|
||||
exporters:
|
||||
|
|
|
|||
Loading…
Reference in a new issue