Azure 监控:MetricsAlert 与 AlertRules,在 Monitor 中看不到 AlertRules

Azure monitoring: MetricsAlert vs AlertRules, can't see AlertRules in Monitor

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

  1. 微软。Insights/alertrules
  2. 微软。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": []
    }
  }
}

微软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。我希望看到两者。如果我转到资源组的“监视”菜单下的“见解(预览)”选项卡,我可以看到两者。

我认为我应该在 Monitor --> Alerts 下看到这两种类型是错误的?或者?

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

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

据我所见"Alerts(Classic) will be retired on August 31st. Use the voluntary migration tool to upgrade to the faster, simpler, and more scalable metric alerts platform",所以经典快讯一定是微软Insights/alertrules。因此,metricAlerts 是 Azure 监控的未来。如有不妥请指正