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.
data of timeseries:
if specify filters yours , use " 2017-05-01-preview" api version, 400 error.
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.
Comments
Post a Comment