简体   繁体   English

Azure 监控由 cloud_RoleInstance 过滤的自定义指标的警报

[英]Azure Monitor alert on a custom metric filtered by cloud_RoleInstance

I'm able to create an alert based on my custom metric.我可以根据我的自定义指标创建警报。 However, i'd like to have several different alerts, for each cloud_RoleInstance I have.但是,对于我拥有的每个 cloud_RoleInstance,我想有几个不同的警报。 Is it possible somehow?有可能吗?

If the logs are stored in Azure Log Analytics or Azure Application Insights, then you can use Custom Log Search alert (in step 5 of this article).如果日志存储在 Azure Log Analytics 或 Azure Application Insights 中,则可以使用自定义日志搜索警报(在本文的步骤 5 中)。 Note you need to create one alert as per one cloud_RoleInstance in the query.请注意,您需要根据查询中的一个 cloud_RoleInstance 创建一个警报。

Steps as blow:打击步骤:

Step 1:步骤1:

In azure portal -> Nav to azure monitor -> Alerts -> New alert rule, then in the resource, select the Azure Log Analytics or Azure Application Insights. In azure portal -> Nav to azure monitor -> Alerts -> New alert rule, then in the resource, select the Azure Log Analytics or Azure Application Insights.

Step 2:第2步:

Then in Condition, select Add, then select "Custom log search":然后在条件中,select 添加,然后 select “自定义日志搜索”:

在此处输入图像描述

Step 3:第 3 步:

Then in new window, write you query to trigger the alert, remember use where clause to filter the cloud_RoleInstance.然后在新的 window 中,编写查询以触发警报,记住使用 where 子句过滤 cloud_RoleInstance。

And note that: change "Based on" from "Number of results" to "Metric measurement", and use this query:请注意:将“基于”从“结果数”更改为“公制测量”,并使用此查询:

customMetrics 
| where name == 'MyMetricName' 
| where cloud_RoleInstance == 'MyInstanceName' 
| summarize AggregatedValue = sum(value) by bin(timestamp, 5m)

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Azure Monitor / Log Analytics 指标警报查询 - Azure Monitor / Log Analytics metric alert query Appinsight 自定义指标的 azurerm_monitor_metric_alert 不起作用 - azurerm_monitor_metric_alert for Appinsight custom metric is not working Azure CLI 中 azure 监视器指标警报条件的格式是什么? - What is the format of azure monitor metric alert conditions in Azure CLI? 使用 Terraform 在 Azure 上为 ServiceBus 创建 azurerm_monitor_metric_alert 时出错 - Error creating azurerm_monitor_metric_alert for ServiceBus on Azure with Terraform Azure Monitor / Log Analytics 指标警报查询和需要重定向端到端事务详细信息窗口 - Azure Monitor / Log Analytics metric alert query and need to redirect End-to-end transaction details window 使用 Terraform 在 Azure 上为 IPsec 站点到站点创建 azurerm_monitor_metric_alert 时出错 - Error creating azurerm_monitor_metric_alert for IPsec Site-to-Site on Azure with Terraform 无法在Azure上为App Insights自定义指标创建警报 - Can't create an alert for an App Insights custom metric on Azure Azure监视器警报定价 - Azure monitor alert pricing 通过 Azure 监视器创建警报 - Alert creation through Azure Monitor VM部署和RoleInstance计数-Azure REST API - VM Deployment and RoleInstance Count - Azure REST API
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM