gpt4 book ai didi

Azure监控: MetricsAlert vs AlertRules,在监视器中看不到AlertRules

转载 作者:行者123 更新时间:2023-12-03 02:50:23 28 4
gpt4 key购买 nike

我有一个具有这两种监控类型的 ARM 模板:

  1. Microsoft.Insights/alertrules
  2. microsoft.insights/metricAlerts

Microsoft.Insights/alertrules 如下所示:

{
"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": []
}
}
}

microsoft.insights/metricAlerts 看起来像这样

   {
"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": []
}
}

当我进入监视器选项卡时,我可以看到 microsoft.insights/metricAlerts,但看不到 Microsoft.Insights/alertrules。我希望两者都能看到。如果我转到资源组的“监视”菜单下的“见解(预览)”选项卡,我可以看到两者。

我认为我应该在监视器 --> 警报下看到这两种类型,这是错误的?或者?

也许我对两者之间的区别还不够清楚(而且我的 google foo 无法带我找到一些为我描述它的文档)。也许我误解了这两个概念?

最佳答案

一段时间后,alertRule 出现在经典警报部分中,在监视器中输入“警报”时会引用该部分。所以我可以从监视器上看到两者。您只需要稍等一下。

正如我所见,“Alerts(Classic) 将于 8 月 31 日停用。使用自愿迁移工具升级到更快、更简单、更具可扩展性的指标警报平台”,因此经典警报必须是 Microsoft.Insights/警报规则。因此,metricAlerts 是 Azure 监控的 future 。如果我错了,请纠正我。

关于Azure监控: MetricsAlert vs AlertRules,在监视器中看不到AlertRules,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56407503/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com