gpt4 book ai didi

azure - "Count of dead-lettered messages in a Queue/Topic. (Preview)"Azure 的指标名称

转载 作者:行者123 更新时间:2023-12-03 00:38:43 26 4
gpt4 key购买 nike

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

我的 ARM 模板参数中是否已有可用于此目的的指标名称?如果没有,什么时候可以在我们的 ARM 模板中使用这个指标?

请参阅此处未列出指标名称:https://learn.microsoft.com/en-us/azure/azure-monitor/platform/metrics-supported#microsoftservicebusnamespaces

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

最佳答案

这是用于创建指标警报的 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": "<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="13767e727a7f53707c7d677c607c3d707c7e" rel="noreferrer noopener nofollow">[email protected]</a>",
"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

enter image description here enter image description here

关于azure - "Count of dead-lettered messages in a Queue/Topic. (Preview)"Azure 的指标名称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55285107/

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