Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save varun-dhawan/637a01e959dfcfc61e2ad4324283db1c to your computer and use it in GitHub Desktop.
Save varun-dhawan/637a01e959dfcfc61e2ad4324283db1c to your computer and use it in GitHub Desktop.
title description ms.service ms.subservice ms.topic ms.author ms.date
Azure Database for PostgreSQL Flexible Server - DB-is-Alive metric (Preview)
Metrics to monitor database availability
postgresql
flexible-server
conceptual
varun.dhawan
1/1/2023

Azure Postgres Flexible Server - DB-is-Alive metric (Preview)

Database availability metric

DB-is-Alive is database availability metric for Azure Postgres Flexible Server. DB-is-Alive is azure monitor (MDM) metric that is emitted as a boolen [1 for available] and [0 for not-available]. The metric are emitted by a seperate background process, and is emitted every 20 seconds.

Azure monitor will aggregate this metric every one minute. Aggregating this data with a MAX() aggregation will allow to correctly determine the health of the database in last one minute. For example:

  1. If the database remains continuously unavailable for 1 mins then [0 = not-available] will be sent to Azure monitor.
  2. If however the database auto recovers within 60s, then [1 = available] will be sent to Azure monitor.

Customers can further aggergate these metric with any desired frequency to avoid any false positives.

Display Name Metric ID Unit Description Dimension Default enabled
Database Is Alive (Preview) is_db_alive Boolean Indicates if the database is up or not N/a Yes

Architecture

  • DB-is-Alive check is executed by an independent background processes to monitor the inatnce health.
  • This background process is child proces for postmaster

Scope

  • Stand-alone servers
  • Replica servers in read-replica configuration

Enabling DB-is-Alive metrics

  • DB-is-Alive metrics is enabled by default

Team

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment