使用 Azure 门户为 Azure SQL 数据库和 Azure Synapse Analytics 创建警报Create alerts for Azure SQL Database and Azure Synapse Analytics using the Azure portal

适用于: Azure SQL 数据库 Azure Synapse Analytics

概述Overview

本文介绍如何使用 Azure 门户为 Azure SQL 数据库和 Azure Synapse Analytics 中的数据库设置警报。This article shows you how to set up alerts for databases in Azure SQL Database and Azure Synapse Analytics using the Azure portal. 当某些指标(例如数据库大小或 CPU 使用率)达到阈值时,警报可以向你发送电子邮件或调用 Webhook。Alerts can send you an email or call a web hook when some metric (for example database size or CPU usage) reaches the threshold.

备注

有关 Azure SQL 托管实例的具体说明,请参阅为 Azure SQL 托管实例创建警报For Azure SQL Managed Instance specific instructions, see Create alerts for Azure SQL Managed Instance.

可以根据监控指标或事件接收 Azure 服务的警报。You can receive an alert based on monitoring metrics for, or events on, your Azure services.

  • 指标值 - 当指定指标的值在任一方向越过了指定的阈值时警报将触发。Metric values - The alert triggers when the value of a specified metric crosses a threshold you assign in either direction. 也就是说,当条件先是满足以及之后不再满足该条件时,警报都会触发。That is, it triggers both when the condition is first met and then afterwards when that condition is no longer being met.
  • 活动日志事件 - 警报可以在发生 每个 事件时都触发,也可以仅在发生特定数量的事件时触发。Activity log events - An alert can trigger on every event, or, only when a certain number of events occur.

可以配置警报以在其触发时执行以下操作:You can configure an alert to do the following when it triggers:

  • 向服务管理员和共同管理员发送电子邮件通知Send email notifications to the service administrator and co-administrators
  • 将电子邮件发送到指定的其他电子邮件地址。Send email to additional emails that you specify.
  • 调用 WebhookCall a webhook

可以使用以下工具配置和获取关于警报的信息:You can configure and get information about alert rules using

使用 Azure 门户创建指标的警报规则Create an alert rule on a metric with the Azure portal

  1. 在此门户,查找想要监视的资源并选中它。In the portal, locate the resource you are interested in monitoring and select it.

  2. 在“监视”部分中选择“警报”。Select Alerts in the Monitoring section. 对于不同的资源,文本和图标可能会略有不同。The text and icon may vary slightly for different resources.

    监视

  3. 选择“新建警报规则”按钮以打开“创建规则”页。 Select the New alert rule button to open the Create rule page. 创建规则Create rule

  4. 在“条件”部分中,单击“添加”。 In the Condition section, click Add. 定义条件Define condition

  5. 在“配置信号逻辑”页中,选择一个信号。In the Configure signal logic page, select a signal. 选择信号Select signal

  6. 在选择某个信号(例如“CPU 百分比”)后,将会显示“配置信号逻辑”页。After selecting a signal, such as CPU percentage, the Configure signal logic page appears. 配置信号逻辑Configure signal logic

  7. 在此页面上,配置该阈值类型、运算符、聚合类型、阈值、聚合粒度和评估频率。On this page, configure that threshold type, operator, aggregation type, threshold value, aggregation granularity, and frequency of evaluation. 然后单击“完成”。Then click Done.

  8. 在“创建规则”中,选择一个现有的“操作组”或创建一个新组。 On the Create rule, select an existing Action group or create a new group. 操作组用于定义在发生警报条件时要执行的操作。An action group enables you to define the action to be taken when an alert condition occurs. 定义操作组Define action group

  9. 定义规则的名称,提供可选说明,为规则选择严重性级别,选择是否在创建规则时启用规则,然后单击“创建规则警报”以创建指标规则警报。Define a name for the rule, provide an optional description, choose a severity level for the rule, choose whether to enable the rule upon rule creation, and then click Create rule alert to create the metric rule alert.

在 10 分钟后,警报将如前所述激活并触发。Within 10 minutes, the alert is active and triggers as previously described.

后续步骤Next steps