您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

可用性警报Availability alerts

Azure Application Insights 将来自全球各地的 Web 请求定期发送到应用程序。Azure Application Insights sends web requests to your application at regular intervals from points around the world. 如果应用程序无响应或响应太慢,它可以提醒你。It can alert you if your application isn't responding, or if it responds too slowly.

启用警报Enable alerts

默认情况下,现在会自动启用警报,但为了完全配置警报,首先需要创建可用性测试。Alerts are now automatically enabled by default, but in order to fully configure the alert you first have to initially create your availability test.

创建体验

备注

使用新的统一警报时,必须在警报体验中配置预警规则严重性和操作组的通知首选项。With the new unified alerts, the alert rule severity and notification preferences with action groups must be configured in the alerts experience. 如果不执行以下步骤,则只会收到门户内通知。Without the following steps, you will only receive in-portal notifications.

  1. 保存可用性测试后,在详细信息选项卡上单击你刚才所做的测试旁边的省略号。After saving the availability test, on the details tab click on the ellipsis by the test you just made. 单击“编辑警报”。Click on "edit alert".

    屏幕截图显示从菜单选择的编辑警报。

  2. 设置所需的严重性级别、规则说明,最重要的是设置具有要用于此警报规则的通知首选项的操作组。Set the desired severity level, rule description and most importantly - the action group that has the notification preferences you would like to use for this alert rule.

    屏幕截图显示 "规则管理" 页,可以在其中编辑规则。

备注

通过这种体验创建的可用性警报是基于状态的。Availability alerts created through this experience are state-based. 这意味着,当满足警报条件时,如果站点被检测为不可用,会生成一个警报。This means that when the alert criteria is met a single alert is generated when the site is detected as unavailable. 如果在下一次评估警报条件时站点仍处于关闭状态,则不会产生新警报。If the site is still down the next time the alert criteria is evaluated this won't generate a new alert. 因此,如果站点关闭了一个小时且已设置电子邮件警报,则你只会在该站点关闭时收到一封电子邮件,然后在该站点重新开放时再收到一封电子邮件。So if your site was down for an hour and you had setup an e-mail alert, you would only receive an e-mail when the site went down, and a subsequent e-mail when the site was back up. 你不会连续收到提醒该站点仍然不可用的警报。You would not receive continuous alerts reminding you that the site was still unavailable.

当 Y 个位置中有 X 个报告失败时发出警报Alert on X out of Y locations reporting failures

创建新的可用性测试时,会在新的统一警报体验中默认启用“Y 个位置中的 X 个”警报规则。The X out of Y locations alert rule is enabled by default in the new unified alerts experience, when you create a new availability test. 可通过选择“经典”选项或选择禁用该警报规则来选择退出。You can opt out by selecting the "classic" option or choosing to disable the alert rule.

备注

通过执行上述步骤,将操作组配置为在警报触发时接收通知。Configure the action groups to receive notifications when the alert triggers by following the steps above. 如果不执行此步骤,则在规则触发时只会收到门户内通知。Without this step, you will only receive in-portal notifications when the rule triggers.

根据可用性指标发出警报Alert on availability metrics

使用新的统一警报时,可以根据分段聚合可用性发出警报以及测试持续时间指标:Using the new unified alerts, you can alert on segmented aggregate availability and test duration metrics as well:

  1. 在指标体验中选择 Application Insights 资源,然后选择可用性指标:Select an Application Insights resource in the Metrics experience, and select an Availability metric:

    可用性指标选择

  2. 从菜单中配置警报选项将转到新体验,可在其中选择特定测试或位置以将警报规则设置为打开。Configure alerts option from the menu will take you to the new experience where you can select specific tests or locations to set up alert rule on. 还可以在此处配置此警报规则的操作组。You can also configure the action groups for this alert rule here.

根据自定义分析查询发出警报Alert on custom analytics queries

使用新的统一警报时,可以根据自定义日志查询发出警报。Using the new unified alerts, you can alert on custom log queries. 借助自定义查询,可以在有助于获得最可靠的可用性问题信号的任意条件下发出警报。With custom queries, you can alert on any arbitrary condition that helps you get the most reliable signal of availability issues. 如果使用 TrackAvailability SDK 发送自定义可用性结果,这同样适用。This is also applicable, if you are sending custom availability results using the TrackAvailability SDK.

提示

可用性数据的指标包括可能通过调用我们的 TrackAvailability SDK 提交的任何自定义可用性结果。The metrics on availability data include any custom availability results you may be submitting by calling our TrackAvailability SDK. 可以使用“根据指标发出警报”支持根据自定义可用性结果发出警报。You can use the alerting on metrics support to alert on custom availability results.

自动发送警报Automate alerts

若要使用 Azure 资源管理器模板自动执行此过程,请参阅使用资源管理器模板创建指标警报文档。To automate this process with Azure Resource Manager templates, refer to the Create a metric alert with Resource Manager template documentation.

故障排除Troubleshooting

专用故障排除文章Dedicated troubleshooting article.

后续步骤Next steps