Microsoft.Insights / alertrules和microsoft.insights / metricAlerts之间有什么区别?什么时候用? [英] What are the difference between Microsoft.Insights/alertrules and microsoft.insights/metricAlerts? And when to use what?
问题描述
正如标题所说,有什么区别
As the title say, what is the difference between
- microsoft.insights / metricAlerts
- Microsoft.Insights / alertrules
我不应该在监视器中看到这两种类型 - > Azure门户中的警报部分?我试图用这两个json片段创建其中一个:
And shouldn't i be able to see both types in the Monitor --> Alerts section in the Azure portal? I have tried to create one of both with these two json snippets:
{
"apiVersion": "2014-04-01",
"name": "[concat('CPUHigh ', parameters('hostingPlanName'))]",
"type": "Microsoft.Insights/alertrules",
"location": "[resourceGroup().location]",
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]"
],
"tags": {
"[concat('hidden-link:', resourceGroup().id, '/providers/Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]": "Resource",
"displayName": "CPUHighAlertRule"
},
"properties": {
"name": "[concat('CPUHigh ', parameters('hostingPlanName'))]",
"description": "[concat('The average CPU is high across all the instances of ', parameters('hostingPlanName'))]",
"isEnabled": true,
"condition": {
"odata.type": "Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition",
"dataSource": {
"odata.type": "Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource",
"resourceUri": "[concat(resourceGroup().id, '/providers/Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]",
"metricName": "CpuPercentage"
},
"operator": "GreaterThan",
"threshold": 90,
"windowSize": "PT15M"
},
"action": {
"odata.type": "Microsoft.Azure.Management.Insights.Models.RuleEmailAction",
"sendToServiceOwners": true,
"customEmails": []
}
}
}
和
{
"type": "microsoft.insights/metricAlerts",
"apiVersion": "2018-03-01",
"name": "CreatedThisFromARM",
"location": "global",
"properties": {
"description": "Created this from ARM. Does it show up or not?",
"severity": 3,
"enabled": true,
"scopes": [
"/subscriptions/4ec6f523-de5f-4e8a-a6e7-45e4f53170df/resourceGroups/AzureResourceGroup4/providers/Microsoft.Web/serverFarms/plantestmonitor"
],
"evaluationFrequency": "PT1M",
"windowSize": "PT5M",
"criteria": {
"allOf": [
{
"criterionType": "StaticThresholdCriterion",
"name": "MemoryFromARM",
"metricName": "MemoryPercentage",
"dimensions": [],
"operator": "GreaterThan",
"threshold": 90,
"timeAggregation": "Average"
}
],
"odata.type": "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria"
},
"actions": []
}
}
I可以在监视器中看到指标警报 - >警报部分,但不是警报规则。我通过转到资源组找到的警报规则,转到左侧菜单的监控部分,然后点击"Insights(Preview)"。菜单条目。
在这里我找到了两个警报。当我去监视器时,我不应该也能找到这个 - >警报?
I can see the metric alert in the Monitor --> alert section, but not the alert rule. The alert rule I have found by going to the resource group, go down to the monitoring section of the left menu and click on the "Insights (Preview)" menu entry. Here I find both alerts. Shouldn't I be able to also find this when I go to Monitor --> Alerts?
另外:我什么时候应该使用什么?我感觉公制警报比警报规则更广泛。警报规则只能查看Application Insights,但是度量标准警报可以查看虚拟机等。但也许我错了吗?
Also: When should i use what? I have a feeling that metric alerts is broader than alert rules. Alerts rules can only look into Application Insights, but metric alerts can look into VMs etc. But maybe I am wrong here?
推荐答案
嗨Martin Slot,
$
是的,你是对的,我看到了这个问题的副本 此处。有关指标提醒和提醒规则的详细信息,请参阅
这个教程。
Hi Martin Slot,
Yes you are right and I see a duplicate of this issue here. For more information on metric alerts and alert rules please refer this tutorial.
这篇关于Microsoft.Insights / alertrules和microsoft.insights / metricAlerts之间有什么区别?什么时候用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!