Setting real-time alerts in Azure

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

This example sets up an alert that's 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. The right column shows the regions.

  5. In the Condition tab:

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

    2. To monitor the Log Analytics service, select Custom log search.

  6. To trigger an alert when the database cluster isn't 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 the number of results. Under Alert logic:

    1. Set Operator to Equals to.

    2. In the Threshold value field, enter 0.

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

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

  10. Select Review + Create.

  11. Select Create.