Postgresql not enough connections
critical

Description PostgreSQL instance should have more connections (> 5)
Query for 2m
>>>
	
				
					sum by (datname) (
				
			
				
					
				
			
				
					{datname!~"template.*|postgres"}) < 5
				
			
    
Query Explanation

The rule aggregates the pg_stat_activity_count metric for all non‑template databases (excluding template.* and postgres) and checks if the total number of active connections is less than 5. The alert fires whenever the summed connections across those databases drop below 5, indicating the PostgreSQL instance may not have enough client connections.

Get Alert
Download
Copy to Clipboard