I have created a set of Availability tests in Application Insights, and want to add Alerts to notify the team about unexpected failures, but I haven't managed to do it. Alerts don't change its state after creation and it looks like, they are not able to get Metric data at all.
When I open Availability test resource (from Application Insights blade or Resource Group) - I see a huge graph with a lot of green/red dots on it, showing executed tests during last 1/24/72 hours:
When I try to create a Metric Alert, I choose the same Availability Test resource and Uptime metric for it but proposed graph display nothing (note the strict horizontal line and 1970th year), while any tutorial shows examples with nice graphs in it
Any created alert doesn't react on changed resource availability too.
Here is a part of my ARM template:
{
"apiVersion": "2016-03-01",
"name": "[variables('alerts').vehiclesHealth]",
"type": "microsoft.insights/alertrules",
"location": "[resourceGroup().location]",
"tags": {
"[concat('hidden-link:', resourceId('Microsoft.Insights/components', variables('appInsights').name))]": "Resource",
"displayName": "app-insights-alert",
"env": "[parameters('environment')]"
},
"properties": {
"name": "[variables('alerts').vehiclesHealth]",
"condition": {
"odata.type": "Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition",
"dataSource": {
"odata.type": "Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource",
"resourceUri": "[resourceId('microsoft.insights/webtests', variables('tests').vehiclesHealth)]",
"metricName": "locations/emea-nl-ams-azr/metrics/GSMT_AvRaw"
},
"operator": "LessThan",
"threshold": 50,
"windowSize": "PT1H"
},
"actions": "[variables('alerts').actions]"
},
"dependsOn": [
"[resourceId('microsoft.insights/webtests', variables('tests').vehiclesHealth)]"
]
},
I suppose that I may use a wrong metric name or resource reference, but I have no idea how to check it. Is there any Powershell script or REST API to get all available metrics for a particular resource?
My main question is: what am I doing wrong and how to get it working?