I'm trying to deploy a MetricAlert with my Traffic Manager Profile and I always get { "Code": "BadRequest", "Message": "The metric names were not found ." }
I'm trying to use the Endpoint Status by Endpoint metric and having no luck. Any idea what the correct metric name would be or how I can find it?
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {},
"variables": {},
"resources": [
{
"type": "microsoft.insights/metricAlerts",
"apiVersion": "2018-03-01",
"name": "All-PPE-Endpoints-Down",
"location": "global",
"tags": {
"displayName": "Alert-AllEndpointsDown"
},
"properties": {
"actions": [
{
"actionGroupId": "[resourceId('microsoft.insights/actionGroups', 'TDFFCEmailActionGroup')]"
}
],
"criteria": {
"odata.type": "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
"allOf": [
{
"criterionType": "DynamicThresholdCriterion",
"name": "1st criterion",
"metricName": "Endpoint Status by Endpoint(Platform)",
"dimensions": [],
"operator": "LessThan",
"alertSensitivity": "Medium",
"failingPeriods": {
"numberOfEvaluationPeriods": "4",
"minFailingPeriodsToAlert": "3"
},
"timeAggregation": "Maximum"
}
]
},
"description": "All endpoints are not responding to ping",
"enabled": true,
"evaluationFrequency": "PT5M",
"scopes": [
"/subscriptions/84eba200-00a9-41d3-9916-d63b2e25da02/resourceGroups/tdff5-rg-ppe/providers/Microsoft.Network/trafficManagerProfiles/tdfppegas"
],
"severity": 3,
"windowSize": "PT5M"
}
}
]
}
The metrics documentation webpage which describes all of the built-in metrics can be found here: https://learn.microsoft.com/en-us/azure/azure-monitor/platform/metrics-supported#microsoftnetworktrafficmanagerprofiles
In this case, the key I was looking for was ProbeAgentCurrentEndpointStateByProfileResourceId