diff --git a/_data/rules.yml b/_data/rules.yml index 189013e..ae294fc 100644 --- a/_data/rules.yml +++ b/_data/rules.yml @@ -620,7 +620,7 @@ groups: for: 2m - name: Postgresql not enough connections description: PostgreSQL instance should have more connections (> 5) - query: 'sum by (datname) (pg_stat_activity_count{datname!~"template.*|postgres"}) < 5' + query: 'sum by (datname) (pg_stat_activity_count{datname!~"template.*|postgres"}) > 5' severity: warning for: 2m - name: Postgresql dead locks diff --git a/dist/rules/postgresql/postgres-exporter.yml b/dist/rules/postgresql/postgres-exporter.yml index b3999f8..1924b6a 100644 --- a/dist/rules/postgresql/postgres-exporter.yml +++ b/dist/rules/postgresql/postgres-exporter.yml @@ -59,7 +59,7 @@ groups: description: "PostgreSQL instance has too many connections (> 80%).\n VALUE = {{ $value }}\n LABELS = {{ $labels }}" - alert: PostgresqlNotEnoughConnections - expr: 'sum by (datname) (pg_stat_activity_count{datname!~"template.*|postgres"}) < 5' + expr: 'sum by (datname) (pg_stat_activity_count{datname!~"template.*|postgres"}) > 5' for: 2m labels: severity: warning