doc: add postgrseql bloat

This commit is contained in:
Samuel Berthe 2022-06-07 02:32:09 +02:00
parent 4662cd2812
commit 08d482f314
No known key found for this signature in database
GPG key ID: 64863511FFBD0E3C

View file

@ -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: