Unable to get Azure monitoring metrics from the REST API -


i retrieve metric definitions using this:

https://management.azure.com/subscriptions/{subscription-id}/resourcegroups/{resource-grp-id}/providers/microsoft.classiccompute/virtualmachines/{vm-id}/providers/microsoft.insights/metricdefinitions?api-version=2015-07-01 

which returns

{ "id": "/subscriptions/{subscription-id}/resourcegroups/{res-group-id}/providers/microsoft.classiccompute/virtualmachines/{vm-id}/providers/microsoft.insights/metricdefinitions", "value": [     {         "resourceuri": "/subscriptions/{subscription-id}/resourcegroups/{res-group-id}/providers/microsoft.classiccompute/virtualmachines/{vm-id}",         "resourceid": "/subscriptions/{subscription-id}/resourcegroups/{res-group-id}/providers/microsoft.classiccompute/virtualmachines/{vm-id}",         "name": {             "value": "\\memory\\availablememory",             "localizedvalue": "memory available"         },         "starttime": "0001-01-01t00:00:00z",         "endtime": "0001-01-01t00:00:00z",         "unit": "bytes",         "primaryaggregationtype": "average",         "resourceuri": "/subscriptions/{subscription-id}/resourcegroups/{res-group-id}/providers/microsoft.classiccompute/virtualmachines/{vm-id}",         "resourceid": "/subscriptions/{subscription-id}/resourcegroups/{res-group-id}/providers/microsoft.classiccompute/virtualmachines/{vm-id}",         "metricavailabilities": [a11bbc020fdd/resourcegroups/cldy-az-res-grp-test-1/providers/microsoft.classiccompute/virtualmachines/cldy-az-vm-test-1","metricavailabilities":[{"timegrain":"pt1h","retention":"p10675199dt2h48m5.4775807s","location":{"tableendpoint":"https://cldyazresgrptest19563.table.core.windows.net/","tableinfo":[{"tablename":"wadmetricspt1hp10dv2s20170331", 

....

but when attempt fetch metric "\\memory\\availablememory" with

https://management.azure.com/subscriptions/{subscription-id}/resourcegroups/{res-grp-id}/providers/microsoft.classiccompute/virtualmachines/{vm-id}/providers/microsoft.insights/metrics?api-version=2016-09-01&$filter=%28name.value+eq+%27%5cmemory%5cavailablememory%27%29+and+aggregationtype+eq+%27average%27+and+starttime+eq+2017-04-06t10%3a01%3a00z+and+endtime+eq+2017-04-07t10%3a01%3a00z+and+timegrain+eq+duration%27pt1h%27 

i error message:

{"code":"notfound","message":"please make sure provider: microsoft.classiccompute registered insights , retry"} 

the filter param in url is

(name.value eq '\memory\availablememory') , aggregationtype eq 'average' , starttime eq 2017-04-06t10:01:00z , endtime eq 2017-04-07t10:01:00z , timegrain eq duration'pt1h'  

this isn't supported resource type through metrics api. supported types , metrics here. https://docs.microsoft.com/en-us/azure/monitoring-and-diagnostics/monitoring-supported-metrics

the memory metric guest agent metric , written wadmetrics table in customer storage account. metric definition api returns sas key these tables there no metrics rest api access data today. customer need access data through storage apis.


Comments

Popular posts from this blog

c# - Update a combobox from a presenter (MVP) -

How to understand 2 main() functions after using uftrace to profile the C++ program? -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -