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.

Revisions

  1. varun-dhawan revised this gist Apr 18, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion AzurePostgresFlexibleServer-DBIsAliveMetrics.md
    Original file line number Diff line number Diff line change
    @@ -23,7 +23,7 @@ Customers can further aggergate these metric with any desired frequency to avoid

    |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 |
    |**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.
  2. varun-dhawan revised this gist Apr 4, 2023. No changes.
  3. varun-dhawan revised this gist Mar 7, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion AzurePostgresFlexibleServer-DBIsAliveMetrics.md
    Original file line number Diff line number Diff line change
    @@ -23,7 +23,7 @@ Customers can further aggergate these metric with any desired frequency to avoid

    |Display Name |Metric ID |Unit |Description |Dimension |Default enabled|
    |-------------------------------------------------|-------------------------------|-------|--------------------------------------------------------------------------------------------------------|------------|---------------|
    |**Database Is Alive** (Preview) |db-is-alive |Boolean|Indicates if the database is up or not |N/a |Yes |
    |**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.
  4. varun-dhawan revised this gist Feb 9, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion AzurePostgresFlexibleServer-DBIsAliveMetrics.md
    Original file line number Diff line number Diff line change
    @@ -23,7 +23,7 @@ Customers can further aggergate these metric with any desired frequency to avoid

    |Display Name |Metric ID |Unit |Description |Dimension |Default enabled|
    |-------------------------------------------------|-------------------------------|-------|--------------------------------------------------------------------------------------------------------|------------|---------------|
    |**Database Is Alive** (Preview) |db-is-alive |Boolean|Indicates if the server is up or not |N/a |Yes |
    |**Database Is Alive** (Preview) |db-is-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.
  5. varun-dhawan revised this gist Feb 8, 2023. 1 changed file with 0 additions and 3 deletions.
    3 changes: 0 additions & 3 deletions AzurePostgresFlexibleServer-DBIsAliveMetrics.md
    Original file line number Diff line number Diff line change
    @@ -35,9 +35,6 @@ Customers can further aggergate these metric with any desired frequency to avoid

    ## Enabling DB-is-Alive metrics
    * DB-is-Alive metrics is enabled by default

    ## References
    * <TBD>

    ## Team
    * Engineering - [email protected]; [email protected] (consulting)
  6. varun-dhawan revised this gist Feb 1, 2023. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions AzurePostgresFlexibleServer-DBIsAliveMetrics.md
    Original file line number Diff line number Diff line change
    @@ -26,9 +26,8 @@ Customers can further aggergate these metric with any desired frequency to avoid
    |**Database Is Alive** (Preview) |db-is-alive |Boolean|Indicates if the server is up or not |N/a |Yes |

    ## Architecture
    * DB-is-Alive check will be executed by a dedicated background processes (send_pg_alive_metric)
    * DB-is-Alive check is executed by an independent background processes to monitor the inatnce health.
    * This background process is child proces for postmaster
    * High-lvl architecture diagram <TBD>

    ## Scope
    * Stand-alone servers
  7. varun-dhawan revised this gist Jan 31, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion AzurePostgresFlexibleServer-DBIsAliveMetrics.md
    Original file line number Diff line number Diff line change
    @@ -8,7 +8,7 @@ ms.author: varun.dhawan
    ms.date: 1/1/2023
    ---

    # Azure Postgres Flexible Server - DB-is-Alive metric (Preview) [Zn Sem]
    # Azure Postgres Flexible Server - DB-is-Alive metric (Preview)

    ## Database availability metric

  8. varun-dhawan revised this gist Jan 18, 2023. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions AzurePostgresFlexibleServer-DBIsAliveMetrics.md
    Original file line number Diff line number Diff line change
    @@ -31,8 +31,8 @@ Customers can further aggergate these metric with any desired frequency to avoid
    * High-lvl architecture diagram <TBD>

    ## Scope
    * All AZ PG Flex Stand-alone servers
    * Read-Replica (in-scope) is seperate instances hence this also have 'DB-is-Alive' metrics
    * Stand-alone servers
    * Replica servers in read-replica configuration

    ## Enabling DB-is-Alive metrics
    * DB-is-Alive metrics is enabled by default
  9. varun-dhawan revised this gist Jan 18, 2023. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions AzurePostgresFlexibleServer-DBIsAliveMetrics.md
    Original file line number Diff line number Diff line change
    @@ -12,9 +12,9 @@ ms.date: 1/1/2023

    ## Database availability metric

    DB-is-Alive is database availability metric for Azure Postgres Flexible Server. DB-is-Alive is azure monitor (MDM) metrics that is emitted as a boolen `[1 for available]` and `[0 for not-available]`. The metrics are emitted by a seperate background process, and is emitted every 20 seconds.
    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 metrics 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:
    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.
    1. If however the database auto recovers within 60s, then [`1 = available`] will be sent to Azure monitor.
  10. varun-dhawan revised this gist Jan 18, 2023. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions AzurePostgresFlexibleServer-DBIsAliveMetrics.md
    Original file line number Diff line number Diff line change
    @@ -10,6 +10,8 @@ ms.date: 1/1/2023

    # Azure Postgres Flexible Server - DB-is-Alive metric (Preview) [Zn Sem]

    ## Database availability metric

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

    Azure monitor will aggregate this metrics 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:
  11. varun-dhawan revised this gist Jan 18, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion AzurePostgresFlexibleServer-DBIsAliveMetrics.md
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,7 @@ description: Metrics to monitor database availability
    ms.service: postgresql
    ms.subservice: flexible-server
    ms.topic: conceptual
    ms.author: varundhawan
    ms.author: varun.dhawan
    ms.date: 1/1/2023
    ---

  12. varun-dhawan revised this gist Jan 18, 2023. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions AzurePostgresFlexibleServer-DBIsAliveMetrics.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    ---
    title: Azure Database for PostgreSQL Flexible Server - DB-is-Alive metrics (Preview)
    title: Azure Database for PostgreSQL Flexible Server - DB-is-Alive metric (Preview)
    description: Metrics to monitor database availability
    ms.service: postgresql
    ms.subservice: flexible-server
    @@ -8,7 +8,7 @@ ms.author: varundhawan
    ms.date: 1/1/2023
    ---

    # Azure Postgres Flexible Server - DB-is-Alive metrics (Preview) [Zn Sem]
    # Azure Postgres Flexible Server - DB-is-Alive metric (Preview) [Zn Sem]

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

  13. varun-dhawan revised this gist Jan 18, 2023. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions AzurePostgresFlexibleServer-DBIsAliveMetrics.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    ---
    title: Azure Database for PostgreSQL Flexible Server - DB-is-Alive Metrics (Preview)
    title: Azure Database for PostgreSQL Flexible Server - DB-is-Alive metrics (Preview)
    description: Metrics to monitor database availability
    ms.service: postgresql
    ms.subservice: flexible-server
    @@ -8,7 +8,7 @@ ms.author: varundhawan
    ms.date: 1/1/2023
    ---

    # Azure Postgres Flexible Server - DB-is-Alive Metrics (Preview) [Zn Sem]
    # Azure Postgres Flexible Server - DB-is-Alive metrics (Preview) [Zn Sem]

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

  14. varun-dhawan revised this gist Jan 18, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion AzurePostgresFlexibleServer-DBIsAliveMetrics.md
    Original file line number Diff line number Diff line change
    @@ -8,7 +8,7 @@ ms.author: varundhawan
    ms.date: 1/1/2023
    ---

    # Azure Database for PostgreSQL Flexible Server - DB-is-Alive Metrics (Preview) [Zn Sem]
    # Azure Postgres Flexible Server - DB-is-Alive Metrics (Preview) [Zn Sem]

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

  15. varun-dhawan revised this gist Jan 18, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion AzurePostgresFlexibleServer-DBIsAliveMetrics.md
    Original file line number Diff line number Diff line change
    @@ -8,7 +8,7 @@ ms.author: varundhawan
    ms.date: 1/1/2023
    ---

    # Azure Database for PostgreSQL Flexible Server - DB-is-Alive Metrics (Preview)
    # Azure Database for PostgreSQL Flexible Server - DB-is-Alive Metrics (Preview) [Zn Sem]

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

  16. varun-dhawan revised this gist Jan 18, 2023. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions AzurePostgresFlexibleServer-DBIsAliveMetrics.md
    Original file line number Diff line number Diff line change
    @@ -19,6 +19,10 @@ Azure monitor will aggregate this metrics every one minute. Aggregating this dat

    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) |db-is-alive |Boolean|Indicates if the server is up or not |N/a |Yes |

    ## Architecture
    * DB-is-Alive check will be executed by a dedicated background processes (send_pg_alive_metric)
    * This background process is child proces for postmaster
  17. varun-dhawan revised this gist Jan 18, 2023. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions AzurePostgresFlexibleServer-DBIsAliveMetrics.md
    Original file line number Diff line number Diff line change
    @@ -28,6 +28,9 @@ Customers can further aggergate these metric with any desired frequency to avoid
    * All AZ PG Flex Stand-alone servers
    * Read-Replica (in-scope) is seperate instances hence this also have 'DB-is-Alive' metrics

    ## Enabling DB-is-Alive metrics
    * DB-is-Alive metrics is enabled by default

    ## References
    * <TBD>

  18. varun-dhawan revised this gist Jan 17, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion AzurePostgresFlexibleServer-DBIsAliveMetrics.md
    Original file line number Diff line number Diff line change
    @@ -33,4 +33,4 @@ Customers can further aggergate these metric with any desired frequency to avoid

    ## Team
    * Engineering - [email protected]; [email protected] (consulting)
    * Product - varun.dhawan@microsoft.com
    * Product - Varun.Dhawan@microsoft.com
  19. varun-dhawan revised this gist Jan 17, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion AzurePostgresFlexibleServer-DBIsAliveMetrics.md
    Original file line number Diff line number Diff line change
    @@ -26,7 +26,7 @@ Customers can further aggergate these metric with any desired frequency to avoid

    ## Scope
    * All AZ PG Flex Stand-alone servers
    * Read-Replica (in-scope) is seperate instances hence this also have 'DB-Is-Alive' metrics
    * Read-Replica (in-scope) is seperate instances hence this also have 'DB-is-Alive' metrics

    ## References
    * <TBD>
  20. varun-dhawan revised this gist Jan 17, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion AzurePostgresFlexibleServer-DBIsAliveMetrics.md
    Original file line number Diff line number Diff line change
    @@ -20,7 +20,7 @@ Azure monitor will aggregate this metrics every one minute. Aggregating this dat
    Customers can further aggergate these metric with any desired frequency to avoid any false positives.

    ## Architecture
    * Dediacted (seperate) background process runs DB-is-alive `send_pg_alive_metric`
    * DB-is-Alive check will be executed by a dedicated background processes (send_pg_alive_metric)
    * This background process is child proces for postmaster
    * High-lvl architecture diagram <TBD>

  21. varun-dhawan revised this gist Jan 17, 2023. 1 changed file with 3 additions and 5 deletions.
    8 changes: 3 additions & 5 deletions AzurePostgresFlexibleServer-DBIsAliveMetrics.md
    Original file line number Diff line number Diff line change
    @@ -20,15 +20,13 @@ Azure monitor will aggregate this metrics every one minute. Aggregating this dat
    Customers can further aggergate these metric with any desired frequency to avoid any false positives.

    ## Architecture
    * Dediacted background process for DB-is-alive - `send_pg_alive_metric`
    * This background is child proces for postmaster (some part of it still worked upon)
    * Hemanth / Varun to work on diagram
    * Dediacted (seperate) background process runs DB-is-alive `send_pg_alive_metric`
    * This background process is child proces for postmaster
    * High-lvl architecture diagram <TBD>

    ## Scope
    * All AZ PG Flex Stand-alone servers
    * Read-Replica (in-scope) is seperate instances hence this also have 'DB-Is-Alive' metrics
    * High-Avability - is out-of-scope


    ## References
    * <TBD>
  22. varun-dhawan revised this gist Jan 17, 2023. 1 changed file with 5 additions and 2 deletions.
    7 changes: 5 additions & 2 deletions AzurePostgresFlexibleServer-DBIsAliveMetrics.md
    Original file line number Diff line number Diff line change
    @@ -10,9 +10,12 @@ ms.date: 1/1/2023

    # Azure Database for PostgreSQL Flexible Server - DB-is-Alive Metrics (Preview)

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

    Azure monitor will aggregate the metrics every minute. As such, with a `MAX()` aggregation, if the database is be un-avaiable for 1 min, then [`0 = not-available`] will be registered in Azure monitor. However, the database auto recovers within 60s, then [`1 = available`] will be registered.
    Azure monitor will aggregate this metrics 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.
    1. 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.

  23. varun-dhawan revised this gist Jan 12, 2023. 1 changed file with 8 additions and 2 deletions.
    10 changes: 8 additions & 2 deletions AzurePostgresFlexibleServer-DBIsAliveMetrics.md
    Original file line number Diff line number Diff line change
    @@ -10,16 +10,22 @@ ms.date: 1/1/2023

    # Azure Database for PostgreSQL Flexible Server - DB-is-Alive Metrics (Preview)

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

    Azure monitor will aggregate the metrics every minute. As such, with a `MAX()` aggregation, if the database is be un-avaiable for 1 min, then [`0 = not-available`] will be registered in Azure monitor. However, the database auto recovers within 60s, then [`1 = available`] will be registered.

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

    ## Architecture

    * Dediacted background process for DB-is-alive - `send_pg_alive_metric`
    * This background is child proces for postmaster (some part of it still worked upon)
    * Hemanth / Varun to work on diagram

    ## Scope
    * All AZ PG Flex Stand-alone servers
    * Read-Replica (in-scope) is seperate instances hence this also have 'DB-Is-Alive' metrics
    * High-Avability - is out-of-scope


    ## References
    * <TBD>
  24. varun-dhawan revised this gist Jan 12, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion AzurePostgresFlexibleServer-DBIsAliveMetrics.md
    Original file line number Diff line number Diff line change
    @@ -25,5 +25,5 @@ Customers can further aggergate these metric with any desired frequency to avoid
    * <TBD>

    ## Team
    * Engineering - [email protected]; [email protected]
    * Engineering - [email protected]; [email protected] (consulting)
    * Product - [email protected]
  25. varun-dhawan revised this gist Jan 12, 2023. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions AzurePostgresFlexibleServer-DBIsAliveMetrics.md
    Original file line number Diff line number Diff line change
    @@ -18,6 +18,7 @@ Customers can further aggergate these metric with any desired frequency to avoid

    ## Architecture


    ## Scope

    ## References
  26. varun-dhawan revised this gist Jan 12, 2023. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion AzurePostgresFlexibleServer-DBIsAliveMetrics.md
    Original file line number Diff line number Diff line change
    @@ -16,9 +16,13 @@ Azure monitor will aggregate the metrics every minute. As such, with a `MAX()` a

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

    ## Architecture

    ## Scope

    ## References
    * <TBD>

    ## Team
    * Engineering -
    * Engineering - [email protected]; [email protected]
    * Product - [email protected]
  27. varun-dhawan revised this gist Jan 6, 2023. 1 changed file with 7 additions and 21 deletions.
    28 changes: 7 additions & 21 deletions AzurePostgresFlexibleServer-DBIsAliveMetrics.md
    Original file line number Diff line number Diff line change
    @@ -10,29 +10,15 @@ ms.date: 1/1/2023

    # Azure Database for PostgreSQL Flexible Server - DB-is-Alive Metrics (Preview)

    PgBouncer is an open-source, lightweight, single-binary connection pooler for PostgreSQL. It can pool connections to one or more databases (on possibly different servers) and serve clients over TCP and Unix domain sockets. Azure Database for PostgreSQL – Flexible Server offers PgBouncer as a built-in connection pooling solution.
    DB-Is-Alive is database availability signal for Azure Postgres Flexible Server. DB-Is-Alive is azure monitor (MDM) metrics that is emitted as boolen [1 = available, 0 = not-available]. The metrics are emitted by a seperate background process, and is emitted every 20s.

    PgBouncer also provides an internal database that you can connect to called pgbouncer. Once connected to the database you can execute SHOW commands that provide information on the current state of pgbouncer.
    Azure monitor will aggregate the metrics every minute. As such, with a `MAX()` aggregation, if the database is be un-avaiable for 1 min, then [`0 = not-available`] will be registered in Azure monitor. However, the database auto recovers within 60s, then [`1 = available`] will be registered.

    * **SHOW HELP** - list all the available show commands
    * **SHOW POOLS** — show number of connections in each state for each pool
    * **SHOW DATABASES** - show current applied connection limits for each database
    * **SHOW STATS** - show stats on requests and traffic for every database
    Customers can further aggergate these metric with any desired frequency to avoid any false positives.

    ## PgBouncer Metrics

    |Srno|Metrics |Desc |SHOW commands |Dimension (limit 50)|Status |
    |----|-------------------------------------|--------------------------------------------------------------------------|--------------|--------------------|---------|
    |1 |`pgbouncer.pools.cl_active` |Client connections linked to server connection and able to process queries|SHOW POOLS |Per database |Committed (M25)|
    |2 |`pgbouncer.pools.cl_waiting` |Client connections waiting on a server connection |SHOW POOLS |Per database |Committed (M25)|
    |3 |`pgbouncer.pools.sv_active` |Server connections linked to a client connection |SHOW POOLS |Per database |Committed (M25)|
    |4 |`pgbouncer.pools.sv_idle` |Server connections idle and ready for a client query |SHOW POOLS |Per database |Committed (M25)|
    |5 |`pgbouncer.database.active_connections`|Current number of connections (client-2-pgBouncer) |SHOW DATABASES|Per database |Committed (M25)|
    |6 |`pgbouncer.pools.pools_per_database` |Total no. of pools per DB |CUSTOM METRICS|Per database |Committed (M25)|

    ## Reference
    * PgBouncer Admin Console - https://www.pgbouncer.org/usage.html
    ## References
    * <TBD>

    ## Team
    * Engineering - [email protected], [email protected]
    * Product - [email protected], [email protected]
    * Engineering -
    * Product - [email protected]
  28. varun-dhawan revised this gist Jan 6, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion AzurePostgresFlexibleServer-DBIsAliveMetrics.md
    Original file line number Diff line number Diff line change
    @@ -8,7 +8,7 @@ ms.author: varundhawan
    ms.date: 1/1/2023
    ---

    # Azure Database for PostgreSQL Flexible Server - PgBouncer Metrics (Preview)
    # Azure Database for PostgreSQL Flexible Server - DB-is-Alive Metrics (Preview)

    PgBouncer is an open-source, lightweight, single-binary connection pooler for PostgreSQL. It can pool connections to one or more databases (on possibly different servers) and serve clients over TCP and Unix domain sockets. Azure Database for PostgreSQL – Flexible Server offers PgBouncer as a built-in connection pooling solution.

  29. varun-dhawan created this gist Jan 6, 2023.
    38 changes: 38 additions & 0 deletions AzurePostgresFlexibleServer-DBIsAliveMetrics.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,38 @@
    ---
    title: Azure Database for PostgreSQL Flexible Server - DB-is-Alive Metrics (Preview)
    description: Metrics to monitor database availability
    ms.service: postgresql
    ms.subservice: flexible-server
    ms.topic: conceptual
    ms.author: varundhawan
    ms.date: 1/1/2023
    ---

    # Azure Database for PostgreSQL Flexible Server - PgBouncer Metrics (Preview)

    PgBouncer is an open-source, lightweight, single-binary connection pooler for PostgreSQL. It can pool connections to one or more databases (on possibly different servers) and serve clients over TCP and Unix domain sockets. Azure Database for PostgreSQL – Flexible Server offers PgBouncer as a built-in connection pooling solution.

    PgBouncer also provides an internal database that you can connect to called pgbouncer. Once connected to the database you can execute SHOW commands that provide information on the current state of pgbouncer.

    * **SHOW HELP** - list all the available show commands
    * **SHOW POOLS** — show number of connections in each state for each pool
    * **SHOW DATABASES** - show current applied connection limits for each database
    * **SHOW STATS** - show stats on requests and traffic for every database

    ## PgBouncer Metrics

    |Srno|Metrics |Desc |SHOW commands |Dimension (limit 50)|Status |
    |----|-------------------------------------|--------------------------------------------------------------------------|--------------|--------------------|---------|
    |1 |`pgbouncer.pools.cl_active` |Client connections linked to server connection and able to process queries|SHOW POOLS |Per database |Committed (M25)|
    |2 |`pgbouncer.pools.cl_waiting` |Client connections waiting on a server connection |SHOW POOLS |Per database |Committed (M25)|
    |3 |`pgbouncer.pools.sv_active` |Server connections linked to a client connection |SHOW POOLS |Per database |Committed (M25)|
    |4 |`pgbouncer.pools.sv_idle` |Server connections idle and ready for a client query |SHOW POOLS |Per database |Committed (M25)|
    |5 |`pgbouncer.database.active_connections`|Current number of connections (client-2-pgBouncer) |SHOW DATABASES|Per database |Committed (M25)|
    |6 |`pgbouncer.pools.pools_per_database` |Total no. of pools per DB |CUSTOM METRICS|Per database |Committed (M25)|

    ## Reference
    * PgBouncer Admin Console - https://www.pgbouncer.org/usage.html

    ## Team
    * Engineering - [email protected], [email protected]
    * Product - [email protected], [email protected]