Sdílet prostřednictvím


Use the Azure portal to set up alerts on metrics for Azure Database for PostgreSQL - Single Server

APPLIES TO: Azure Database for PostgreSQL - Single Server

Important

Azure Database for PostgreSQL - Single Server is on the retirement path. We strongly recommend that you upgrade to Azure Database for PostgreSQL - Flexible Server. For more information about migrating to Azure Database for PostgreSQL - Flexible Server, see What's happening to Azure Database for PostgreSQL Single Server?.

This article shows you how to set up Azure Database for PostgreSQL alerts using the Azure portal. You can receive an alert based on monitoring metrics for your Azure services.

The alert triggers when the value of a specified metric crosses a threshold you assign. The alert triggers both when the condition is first met, and then afterwards when that condition is no longer being met.

You can configure an alert to do the following actions when it triggers:

  • Send email notifications to the service administrator and co-administrators.
  • Send email to additional emails that you specify.
  • Call a webhook.

You can configure and get information about alert rules using:

Create an alert rule on a metric from the Azure portal

  1. In the Azure portal, select the Azure Database for PostgreSQL server you want to monitor.

  2. Under the Monitoring section of the sidebar, select Alerts.

  3. Select New metric alert (+ icon).

  4. The Create rule page opens. Fill in the required information.

  5. Within the Condition section, select Add condition.

  6. Select a metric from the list of signals to be alerted on. In this example, select "Storage percent".

  7. Configure the alert logic including the Condition (ex. "Greater than"), Threshold (ex. 85 percent), Time Aggregation, Period of time the metric rule must be satisfied before the alert triggers (ex. "Over the last 30 minutes"), and Frequency.

    Select Done when complete.

  8. Within the Action Groups section, select Create New to create a new group to receive notifications on the alert.

  9. Fill out the "Add action group" form with a name, short name, subscription, and resource group.

  10. Configure an Email/SMS/Push/Voice action type.

    Choose "Email Azure Resource Manager Role" to select subscription Owners, Contributors, and Readers to receive notifications.

    Optionally, provide a valid URI in the Webhook field if you want it called when the alert fires.

    Select OK when completed.

  11. Specify an Alert rule name, Description, and Severity.

  12. Select Create alert rule to create the alert.

    Within a few minutes, the alert is active and triggers as previously described.

Manage your alerts

Once you have created an alert, you can select it and do the following actions:

  • View a graph showing the metric threshold and the actual values from the previous day relevant to this alert.
  • Edit or Delete the alert rule.
  • Disable or Enable the alert, if you want to temporarily stop or resume receiving notifications.

Next steps