Setting real-time alerts in Azure

BigAnimal provides a wide range of metrics for your clusters, see Metrics details. You can use a Log Analytics query to trigger a real-time alerts based on these metrics.

In this example we set up an alert that is triggered when one of your cluster groups goes down. Assume that your cluster group has an ID = p-gjlmcos8n7 and is on a subscription called development.

  1. In the Azure portal, search for and select Alerts. On the Alerts page, you can see the metrics that BigAnimal collects from your environment.

  2. Select + Create and select Alert rule to create new alert rule.

  3. Select + Select scope. Under Select a resource:

    1. Select your Azure subscription (development) in the Filter by subscription field.

    2. Select Log Analytics workspaces in the Filter by resource type field.

    3. Select the Azure region of your cluster in the Filter by location field.

  4. BigAnimal creates a Log Analytics workspace for each region in your Azure subscription. Select the Log Analytics workspace for your region and select Done (see right column for region).

  5. In the Condition tab,

    1. Select Add condition to set when the alert rule is triggered.

    2. Select Custom log search to monitor the Log analytics service.

  6. To trigger an alert when the database cluster is not detected enter the following query:

    DpMetrics_CL
    | where Message has "cnp_collector_up"
    | extend m = todynamic(Message)
    | where m.labels.role == "primary" and m.labels.postgresql == "p-gjlmcos8n7"

    The query programs the alert to check for the cnp_collector_up metric for the p-gjlmcos8n7 database cluster.

  7. After running the query, select Continue editing alert.

  8. Design the alert logic based on number of results. Under Alert logic:

    1. Select the Operator as Equals to.

    2. Enter 0 in the Threshold value field.

      The alert is triggered when the database cluster is unavailable and there are no metrics of cnp_collector_up. It can indicate that there is a monitoring problem or a critical error.

  9. In the Details tab, create the alert rule name.

  10. Select Review + Create.

  11. Select Create.