PostgreSQLMaxConnectionsReached
>>>
sum
(
pg_stat_activity_count
) by (instance) >=
sum
(
pg_settings_max_connections
) by (instance) -
sum
(
pg_settings_superuser_reserved_connections
) by (instance)
The rule sums the current open PostgreSQL sessions (pg_stat_activity_count) for each instance and checks whether this total is greater than or equal to the usable connection capacity, calculated as the configured max_connections minus the reserved superuser connections (pg_settings_superuser_reserved_connections). The alert triggers when an instance’s active connections reach or exceed this usable limit, indicating the instance is at or over its maximum allowed connections.
Exporters Used
Related Alerts
PostgreSQLCacheHitRatio
PostgreSQLDown
PostgreSQLHighConnections
PostgreSQLQPS
PostgreSQLSlowQueries
Postgresql SSL compression active
Postgresql bloat index high (> 80%)
Postgresql bloat table high (> 80%)
Postgresql commit rate low
Postgresql configuration changed
Postgresql dead locks
Postgresql down
Postgresql exporter error
Postgresql high rate deadlock
Postgresql high rate statement timeout
Postgresql high rollback rate
Postgresql invalid index
Postgresql low XID consumption
Postgresql not enough connections
Postgresql replication lag
Postgresql restarted
Postgresql table not auto analyzed
Postgresql table not auto vacuumed
Postgresql too many connections
Postgresql too many dead tuples
Postgresql too many locks acquired
Postgresql unused replication slot