Azure “的度量名称”;队列/主题中死信邮件的计数。(预览)";蔚蓝色的

Azure “的度量名称”;队列/主题中死信邮件的计数。(预览)";蔚蓝色的,azure,azure-devops,azureservicebus,azure-servicebus-topics,Azure,Azure Devops,Azureservicebus,Azure Servicebus Topics,对于连续部署,我们希望为主题中的死信消息设置警报规则。在azure portal上,此指标作为预览功能存在。我们希望通过ARM模板创建此警报规则 在我的ARM模板参数中是否已经有一个度量名称可以用于此? 如果没有,什么时候可以在ARM模板中使用此度量 请参见此处未列出的度量名称: 但可以手动创建警报规则并选择此指标: 以下是ARM模板,用于创建队列/主题中死信邮件的度量警报计数: { "$schema": "https://schema.management.azure.com/sc

对于连续部署,我们希望为主题中的死信消息设置警报规则。在azure portal上,此指标作为预览功能存在。我们希望通过ARM模板创建此警报规则

在我的ARM模板参数中是否已经有一个度量名称可以用于此? 如果没有,什么时候可以在ARM模板中使用此度量

请参见此处未列出的度量名称:

但可以手动创建警报规则并选择此指标:

以下是ARM模板,用于创建队列/主题中死信邮件的度量警报
计数

    {
  "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "alertName": {
      "type": "string",
      "minLength": 1,
      "metadata": {
        "description": "Name of the alert"
      }
    },
    "alertDescription": {
      "type": "string",
      "defaultValue": "This is a metric alert",
      "metadata": {
        "description": "Description of alert"
      }
    },
    "alertSeverity": {
      "type": "int",
      "defaultValue": 3,
      "allowedValues": [
        0,
        1,
        2,
        3,
        4
      ],
      "metadata": {
        "description": "Severity of alert {0,1,2,3,4}"
      }
    },
    "isEnabled": {
      "type": "bool",
      "defaultValue": true,
      "metadata": {
        "description": "Specifies whether the alert is enabled"
      }
    },
    "resourceId": {
      "type": "string",
      "minLength": 1,
      "metadata": {
        "description": "Full Resource ID of the resource emitting the metric that will be used for the comparison. For example /subscriptions/00000000-0000-0000-0000-0000-00000000/resourceGroups/ResourceGroupName/providers/Microsoft.compute/virtualMachines/VM_xyz"
      }
    },
    "metricName": {
      "type": "string",
      "minLength": 1,
      "metadata": {
        "description": "Name of the metric used in the comparison to activate the alert."
      }
    },
    "operator": {
      "type": "string",
      "defaultValue": "GreaterThan",
      "allowedValues": [
        "Equals",
        "NotEquals",
        "GreaterThan",
        "GreaterThanOrEqual",
        "LessThan",
        "LessThanOrEqual"
      ],
      "metadata": {
        "description": "Operator comparing the current value with the threshold value."
      }
    },
    "threshold": {
      "type": "string",
      "defaultValue": "0",
      "metadata": {
        "description": "The threshold value at which the alert is activated."
      }
    },
    "timeAggregation": {
      "type": "string",
      "defaultValue": "Average",
      "allowedValues": [
        "Average",
        "Minimum",
        "Maximum",
        "Total"
      ],
      "metadata": {
        "description": "How the data that is collected should be combined over time."
      }
    },
    "windowSize": {
      "type": "string",
      "defaultValue": "PT5M",
      "metadata": {
        "description": "Period of time used to monitor alert activity based on the threshold. Must be between five minutes and one day. ISO 8601 duration format."
      }
    },
    "evaluationFrequency": {
      "type": "string",
      "defaultValue": "PT1M",
      "metadata": {
        "description": "how often the metric alert is evaluated represented in ISO 8601 duration format"
      }
    }
  },
  "variables": {},
  "resources": [
    {
      "apiVersion": "2018-03-01",
      "type": "Microsoft.Insights/ActionGroups",
      "name": "testAG12",
      "location": "Global",
      "kind": null,
      "tags": {},
      "properties": {
        "groupShortName": "testAg",
        "enabled": true,
        "emailReceivers": [
          {
            "name": "emailservice_-EmailAction-",
            "emailAddress": "email@contoso.com",
            "status": "Enabled",
            "useCommonAlertSchema": false
          }
        ],
        "smsReceivers": [],
        "webhookReceivers": [],
        "itsmReceivers": [],
        "azureAppPushReceivers": [],
        "automationRunbookReceivers": [],
        "voiceReceivers": [],
        "logicAppReceivers": [],
        "azureFunctionReceivers": [],
        "armRoleReceivers": []
      },
      "identity": null
    },
    {
      "name": "[parameters('alertName')]",
      "type": "Microsoft.Insights/metricAlerts",
      "location": "global",
      "apiVersion": "2018-03-01",
      "tags": {},
      "properties": {
        "description": "[parameters('alertDescription')]",
        "severity": "[parameters('alertSeverity')]",
        "enabled": "[parameters('isEnabled')]",
        "scopes": [ "[parameters('resourceId')]" ],
        "evaluationFrequency": "[parameters('evaluationFrequency')]",
        "windowSize": "[parameters('windowSize')]",
        "criteria": {
          "odata.type": "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria",
          "allOf": [
            {
              "name": "1st criterion",
              "metricName": "[parameters('metricName')]",
              "metricNamespace": "microsoft.servicebus/namespaces",
              "dimensions": [],
              "operator": "[parameters('operator')]",
              "threshold": "[parameters('threshold')]",
              "timeAggregation": "[parameters('timeAggregation')]"
            }
          ]
        },
        "actions": [
          {
            "actionGroupId": "[resourceId('Microsoft.Insights/ActionGroups', 'testAG12')]"
          }
        ]
      }
    }
  ]
}
将以下重要值传递给参数:

Metric Name : DeadletteredMessages
Time Aggregation : Average
Resource Id: Resource ID of your Service Bus Namespace. You can get this from the properties of the service bus blade as shown in below image

以下是ARM模板,用于创建队列/主题中死信邮件的度量警报
计数

    {
  "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "alertName": {
      "type": "string",
      "minLength": 1,
      "metadata": {
        "description": "Name of the alert"
      }
    },
    "alertDescription": {
      "type": "string",
      "defaultValue": "This is a metric alert",
      "metadata": {
        "description": "Description of alert"
      }
    },
    "alertSeverity": {
      "type": "int",
      "defaultValue": 3,
      "allowedValues": [
        0,
        1,
        2,
        3,
        4
      ],
      "metadata": {
        "description": "Severity of alert {0,1,2,3,4}"
      }
    },
    "isEnabled": {
      "type": "bool",
      "defaultValue": true,
      "metadata": {
        "description": "Specifies whether the alert is enabled"
      }
    },
    "resourceId": {
      "type": "string",
      "minLength": 1,
      "metadata": {
        "description": "Full Resource ID of the resource emitting the metric that will be used for the comparison. For example /subscriptions/00000000-0000-0000-0000-0000-00000000/resourceGroups/ResourceGroupName/providers/Microsoft.compute/virtualMachines/VM_xyz"
      }
    },
    "metricName": {
      "type": "string",
      "minLength": 1,
      "metadata": {
        "description": "Name of the metric used in the comparison to activate the alert."
      }
    },
    "operator": {
      "type": "string",
      "defaultValue": "GreaterThan",
      "allowedValues": [
        "Equals",
        "NotEquals",
        "GreaterThan",
        "GreaterThanOrEqual",
        "LessThan",
        "LessThanOrEqual"
      ],
      "metadata": {
        "description": "Operator comparing the current value with the threshold value."
      }
    },
    "threshold": {
      "type": "string",
      "defaultValue": "0",
      "metadata": {
        "description": "The threshold value at which the alert is activated."
      }
    },
    "timeAggregation": {
      "type": "string",
      "defaultValue": "Average",
      "allowedValues": [
        "Average",
        "Minimum",
        "Maximum",
        "Total"
      ],
      "metadata": {
        "description": "How the data that is collected should be combined over time."
      }
    },
    "windowSize": {
      "type": "string",
      "defaultValue": "PT5M",
      "metadata": {
        "description": "Period of time used to monitor alert activity based on the threshold. Must be between five minutes and one day. ISO 8601 duration format."
      }
    },
    "evaluationFrequency": {
      "type": "string",
      "defaultValue": "PT1M",
      "metadata": {
        "description": "how often the metric alert is evaluated represented in ISO 8601 duration format"
      }
    }
  },
  "variables": {},
  "resources": [
    {
      "apiVersion": "2018-03-01",
      "type": "Microsoft.Insights/ActionGroups",
      "name": "testAG12",
      "location": "Global",
      "kind": null,
      "tags": {},
      "properties": {
        "groupShortName": "testAg",
        "enabled": true,
        "emailReceivers": [
          {
            "name": "emailservice_-EmailAction-",
            "emailAddress": "email@contoso.com",
            "status": "Enabled",
            "useCommonAlertSchema": false
          }
        ],
        "smsReceivers": [],
        "webhookReceivers": [],
        "itsmReceivers": [],
        "azureAppPushReceivers": [],
        "automationRunbookReceivers": [],
        "voiceReceivers": [],
        "logicAppReceivers": [],
        "azureFunctionReceivers": [],
        "armRoleReceivers": []
      },
      "identity": null
    },
    {
      "name": "[parameters('alertName')]",
      "type": "Microsoft.Insights/metricAlerts",
      "location": "global",
      "apiVersion": "2018-03-01",
      "tags": {},
      "properties": {
        "description": "[parameters('alertDescription')]",
        "severity": "[parameters('alertSeverity')]",
        "enabled": "[parameters('isEnabled')]",
        "scopes": [ "[parameters('resourceId')]" ],
        "evaluationFrequency": "[parameters('evaluationFrequency')]",
        "windowSize": "[parameters('windowSize')]",
        "criteria": {
          "odata.type": "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria",
          "allOf": [
            {
              "name": "1st criterion",
              "metricName": "[parameters('metricName')]",
              "metricNamespace": "microsoft.servicebus/namespaces",
              "dimensions": [],
              "operator": "[parameters('operator')]",
              "threshold": "[parameters('threshold')]",
              "timeAggregation": "[parameters('timeAggregation')]"
            }
          ]
        },
        "actions": [
          {
            "actionGroupId": "[resourceId('Microsoft.Insights/ActionGroups', 'testAG12')]"
          }
        ]
      }
    }
  ]
}
将以下重要值传递给参数:

Metric Name : DeadletteredMessages
Time Aggregation : Average
Resource Id: Resource ID of your Service Bus Namespace. You can get this from the properties of the service bus blade as shown in below image

我意识到我忘记了Azure portal中的“导出模板”功能。手动创建警报规则或任何资源后,可以将资源组导出为ARM模板。在这里,我能够找到包含模板内容的资源,以生成手动创建的资源

我意识到我忘记了Azure portal中的“导出模板”功能。手动创建警报规则或任何资源后,可以将资源组导出为ARM模板。在这里,我能够找到包含模板内容的资源,以生成手动创建的资源


非常感谢!您能告诉我您是如何从门户上的第二个屏幕截图(带有设置)进入屏幕的吗?或者换句话说,您是如何找到度量名称的?然后,我可以更好地了解如何在需要时找到其他度量名称。第二个屏幕截图实际上是来自门户的模板部署。登录>所有服务>搜索模板您可以粘贴我回答中提到的模板,您将看到相同的UI。非常感谢!您能告诉我您是如何从门户上的第二个屏幕截图(带有设置)进入屏幕的吗?或者换句话说,您是如何找到度量名称的?然后,我可以更好地了解如何在需要时找到其他度量名称。第二个屏幕截图实际上是来自门户的模板部署。登录到>所有服务>搜索模板您可以粘贴我的答案中提到的模板,您将看到相同的UI。