【问题标题】:Application Insights Alerts. Set Suppress time via ARM TemplateApplication Insights 警报。通过 ARM 模板设置抑制时间
【发布时间】:2019-08-28 15:06:47
【问题描述】:

我想部署基于自定义日志搜索的 Application Insights 警报,并抑制通过 ARM 模板设置的警报。有一个属性"throttlingInMin": 30,,但它似乎没有做任何事情。

这是模板:

{
  "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "existingApplicationInsightsName": {
      "type": "string"
    }
  },
  "variables": {},
  "resources": [
    {
      "apiVersion": "2018-04-16",
      "type": "Microsoft.Insights/scheduledQueryRules",
      "name": "Alert1",
      "location": "[resourceGroup().location]",
      "tags": {
        "[concat('hidden-link:', resourceId('microsoft.insights/components', parameters('existingApplicationInsightsName')))]": "Resource"
      },
      "properties": {
        "description": "Description1",
        "Enabled": "True",
        "source": {
          "query": "customMetrics | summarize AggregatedValue = count() by bin(timestamp, 15m),client_StateOrProvince",
          "dataSourceId": "[resourceId('microsoft.insights/components', parameters('existingApplicationInsightsName'))]",
          "queryType": "ResultCount"
        },
        "schedule": {
          "FrequencyInMinutes": 40,
          "TimeWindowInMinutes": 40
        },
        "action": {
          "odata.type": "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction",
          "Severity": "3",
          "aznsAction": {
            "actionGroup": [
              "/subscriptions/131c713e-23e2-4eec-b592-61e975f28e6b/resourceGroups/Alerts/providers/microsoft.insights/actiongroups/Me" 
            ],
            "throttlingInMin": 30,
            "emailSubject": null,
            "customWebhookPayload": null
          },
          "trigger": {
            "ThresholdOperator": "GreaterThan",
            "Threshold": 0
          }
        }
      }
    }
  ]
}

部署成功后。抑制警报复选框仍未选中:

【问题讨论】:

    标签: azure azure-application-insights arm-template azure-template


    【解决方案1】:

    throttleConsecutiveWindowCount 设置为0,在您的throttlingInMin 属性旁边,如下所示

     "throttlingInMin": 30,
     "throttleConsecutiveWindowCount": 0,
    

    并将它们移动到action 属性下,如下所示:

    "action": {
      "odata.type": "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction",
      "Severity": "3",
      "aznsAction": {
        "actionGroup": [
          "/subscriptions/131c713e-23e2-4eec-b592-61e975f28e6b/resourceGroups/Alerts/providers/microsoft.insights/actiongroups/Me"
        ],
        "emailSubject": null,
        "customWebhookPayload": null
      },
      "throttlingInMin": 30,
      "throttleConsecutiveWindowCount": 0,
      "trigger": {
        "ThresholdOperator": "GreaterThan",
        "Threshold": 0
      }
    }
    

    【讨论】:

      猜你喜欢
      • 2017-10-17
      • 1970-01-01
      • 2018-04-04
      • 2020-04-16
      • 2016-12-09
      • 1970-01-01
      • 2018-12-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多