首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >Azure监控: MetricsAlert vs AlertRules,在监视器中看不到AlertRules

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

Stack Overflow用户
提问于 2019-06-01 22:14:39
回答 1查看 339关注 0票数 0

我有一个包含以下两种监控类型的ARM模板:

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

Microsoft.Insights/alertrules如下所示:

代码语言:javascript
复制
{
  "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如下所示

代码语言:javascript
复制
   {
      "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。我希望两者都能看到。如果我转到资源组的监视菜单下的Insights (预览)选项卡,我可以同时看到这两个选项卡。

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

也许我没有足够清楚地理解这两者之间的区别(我的google foo也不能带我去一些文档中为我描述它)。也许我误解了这两个概念?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-06-03 01:24:13

一段时间后,alertRule将出现在经典警报部分,当在监视器中输入“警报”时引用该部分。所以我可以从监视器上看到这两种情况。你只需要稍等片刻。

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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56407503

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档