json - Error in retrieving metric values for SQL server data from AZURE -


https://management.azure.com/subscriptions/{subscription id}/resourcegroups/{resource group}/providers/microsoft.sql/servers/{servername}/providers/microsoft.insights/metrics?api-version=2017-05-01-preview&$filter=(name.value eq 'dtu_consumption_percent' ) , starttime eq 2017-09-10 , endtime eq 2017-09-11 , timegrain eq duration'pt1h' 

the above url passing data sql server metrics

the response getting :

{ "cost": 0, "timespan": "2017-09-12t03:56:27z/2017-09-12t04:56:27z", "interval": "pt1m", "value": [     {         "id": "/subscriptions/{subscription id}/resourcegroups/{resource group}/providers/microsoft.sql/servers/{server name}/providers/microsoft.insights/metrics/dtu_consumption_percent",         "type": "microsoft.insights/metrics",         "name": {             "value": "dtu_consumption_percent",             "localizedvalue": "dtu percentage"         },         "unit": "percent",         "timeseries": []     } ]} 

there no data in time series.

what issue ?

if not specify filters, dtu_consumption_percent (default metric) can returned when use " 2017-05-01-preview" api version.

enter image description here

data of timeseries:

enter image description here

if specify filters yours , use " 2017-05-01-preview" api version, 400 error.

enter image description here

under “retrieve metric values” section in this article, find:

note

to retrieve metric values using azure monitor rest api, use "2016-06-01" api version.

you can try use "2016-06-01" api version retrieve metric values.

enter image description here


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -