You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Postgresql exporter is showing errors. A query may be buggy in query.yaml
- alert: PostgresqlExporterErrorexpr: pg_exporter_last_scrape_error > 0for: 5mlabels:
severity: warningannotations:
summary: "Postgresql exporter error (instance {{ $labels.instance }})"description: "Postgresql exporter is showing errors. A query may be buggy in query.yaml\n VALUE = {{ $value }}\n LABELS: {{ $labels }}"
Postgresql replication lag
PostgreSQL replication lag is going up (> 10s)
- alert: PostgresqlReplicationLagexpr: (pg_replication_lag) > 10 and ON(instance) (pg_replication_is_replica == 1)for: 5mlabels:
severity: warningannotations:
summary: "Postgresql replication lag (instance {{ $labels.instance }})"description: "PostgreSQL replication lag is going up (> 10s)\n VALUE = {{ $value }}\n LABELS: {{ $labels }}"
Postgresql table not vaccumed
Table has not been vaccum for 24 hours
- alert: PostgresqlTableNotVaccumedexpr: time() - pg_stat_user_tables_last_autovacuum > 60 * 60 * 24for: 5mlabels:
severity: warningannotations:
summary: "Postgresql table not vaccumed (instance {{ $labels.instance }})"description: "Table has not been vaccum for 24 hours\n VALUE = {{ $value }}\n LABELS: {{ $labels }}"
Postgresql table not analyzed
Table has not been analyzed for 24 hours
- alert: PostgresqlTableNotAnalyzedexpr: time() - pg_stat_user_tables_last_autoanalyze > 60 * 60 * 24for: 5mlabels:
severity: warningannotations:
summary: "Postgresql table not analyzed (instance {{ $labels.instance }})"description: "Table has not been analyzed for 24 hours\n VALUE = {{ $value }}\n LABELS: {{ $labels }}"
Postgresql too many connections
PostgreSQL instance has too many connections
- alert: PostgresqlTooManyConnectionsexpr: sum by (datname) (pg_stat_activity_count{datname!~"template.*|postgres"}) > pg_settings_max_connections * 0.9for: 5mlabels:
severity: warningannotations:
summary: "Postgresql too many connections (instance {{ $labels.instance }})"description: "PostgreSQL instance has too many connections\n VALUE = {{ $value }}\n LABELS: {{ $labels }}"
Postgresql not enough connections
PostgreSQL instance should have more connections (> 5)
- alert: PostgresqlNotEnoughConnectionsexpr: sum by (datname) (pg_stat_activity_count{datname!~"template.*|postgres"}) < 5for: 5mlabels:
severity: warningannotations:
summary: "Postgresql not enough connections (instance {{ $labels.instance }})"description: "PostgreSQL instance should have more connections (> 5)\n VALUE = {{ $value }}\n LABELS: {{ $labels }}"
Postgresql dead locks
PostgreSQL has dead-locks
- alert: PostgresqlDeadLocksexpr: rate(pg_stat_database_deadlocks{datname!~"template.*|postgres"}[1m]) > 0for: 5mlabels:
severity: warningannotations:
summary: "Postgresql dead locks (instance {{ $labels.instance }})"description: "PostgreSQL has dead-locks\n VALUE = {{ $value }}\n LABELS: {{ $labels }}"
Database connections with SSL compression enabled. This may add significant jitter in replication delay. Replicas should turn off SSL compression via sslcompression=0 in recovery.conf
- alert: PostgresqlSslCompressionActiveexpr: sum(pg_stat_ssl_compression) > 0for: 5mlabels:
severity: criticalannotations:
summary: "Postgresql SSL compression active (instance {{ $labels.instance }})"description: "Database connections with SSL compression enabled. This may add significant jitter in replication delay. Replicas should turn off SSL compression via `sslcompression=0` in `recovery.conf`.\n VALUE = {{ $value }}\n LABELS: {{ $labels }}"
Postgresql too many locks acquired
Too many locks acquired on the database. If this alert happens frequently, we may need to increase the postgres setting max_locks_per_transaction.
- alert: PostgresqlTooManyLocksAcquiredexpr: ((sum (pg_locks_count)) / (pg_settings_max_locks_per_transaction * pg_settings_max_connections)) > 0.20for: 5mlabels:
severity: criticalannotations:
summary: "Postgresql too many locks acquired (instance {{ $labels.instance }})"description: "Too many locks acquired on the database. If this alert happens frequently, we may need to increase the postgres setting max_locks_per_transaction.\n VALUE = {{ $value }}\n LABELS: {{ $labels }}"