An Azure managed PostgreSQL database service for app development and deployment.
tldr If client connections, query execution, Resource Health, and other monitoring signals all indicate normal operation, investigate the accuracy of the is_db_alive metric itself before concluding that the PostgreSQL server is unavailable.
The Database Is Alive (is_db_alive) metric is intended to indicate database availability, where 1 = available and 0 = unavailable. Azure Database for PostgreSQL Flexible Server emits this metric to Azure Monitor on a regular interval and Microsoft recommends using the MAX aggregation when evaluating availability. (Microsoft Learn)
If your PostgreSQL server is actively accepting connections, serving queries, and other platform metrics continue to update normally, then an is_db_alive value of 0 by itself is not sufficient evidence that the database is unavailable.
A few checks that may help narrow down the cause:
- Verify the metric is being viewed with MAX aggregation rather than Average or other aggregations. Microsoft's availability metric guidance specifically references MAX aggregation for determining availability during a given period.
- Correlate the timestamp with other metrics such as Succeeded Connections, Active Connections, CPU utilisation, and storage activity. If those metrics show normal activity while
is_db_aliveremains 0, that suggests a discrepancy between the availability metric and the observed workload behaviour. - Review Resource Health and the Activity Log for any platform events, maintenance activities, or availability incidents that coincide with the affected timeframe.
- Query the metric directly through Azure Monitor Metrics or Log Analytics (if exported) to confirm the value is not a portal visualisation issue.
- Check whether the behaviour is continuous or intermittent. A continuously reported value of 0 while the database remains fully operational is not the expected behaviour for this metric.
Based on the symptoms described, where the server remains healthy and continues serving traffic, the issue appears more likely to be related to metric collection or reporting rather than an actual PostgreSQL availability problem. The key indicator would be whether connectivity, queries, and other health metrics continue to function normally during the same period.
Help make this community better for everyone: if this answer resolved your issue, please accept it or leave an upvote. If not, share more details in a comment so we can continue the discussion and find the right solution.