Metrics

Lists the metric values for multiple resources.

post/subscriptions/{subscriptionId}/metrics:getBatch

Path parameters

subscriptionIdstring uuid required

The subscription identifier for the resources in this batch.

Query parameters

starttimestring

The start time of the query. It is a string in the format 'yyyy-MM-ddTHH:mm:ss.fffZ'. If you have specified the endtime parameter, then this parameter is required. If only starttime is specified, then endtime defaults to the current time. If no time interval is specified, the default is 1 hour.

endtimestring

The end time of the query. It is a string in the format 'yyyy-MM-ddTHH:mm:ss.fffZ'.

intervalstring

The interval (i.e. timegrain) of the query in ISO 8601 duration format. Defaults to PT1M. Special case for 'FULL' value that returns single datapoint for entire time span requested. Examples: PT15M, PT1H, P1D, FULL

metricnamespacestring required

Metric namespace that contains the requested metric names.

metricnamesstring[] required

The names of the metrics (comma separated) to retrieve.

filterstring

The filter is used to reduce the set of metric data returned.<br>Example:<br>Metric contains metadata A, B and C.<br>- Return all time series of C where A = a1 and B = b1 or b2<br>filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’<br>- Invalid variant:<br>filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’<br>This is invalid because the logical or operator cannot separate two different metadata names.<br>- Return all time series where A = a1, B = b1 and C = c1:<br>filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’<br>- Return all time series where A = a1<br>filter=A eq ‘a1’ and B eq ‘’ and C eq ‘.

api-versionstring required

Client Api Version.

Parameters

./common-types/v2/commonMonitoringTypes.json#/components/parameters/AggregationsParameter — unresolved $ref
./common-types/v2/commonMonitoringTypes.json#/components/parameters/TopParameter — unresolved $ref
./common-types/v2/commonMonitoringTypes.json#/components/parameters/OrderByParameter — unresolved $ref
./common-types/v2/commonMonitoringTypes.json#/components/parameters/RollUpByParameter — unresolved $ref

Request body

resourceidsstring[]

The list of resource IDs to query metrics for.

Example request

{
  "resourceids": [
    "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage1",
    "/subscriptions/123456728-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage2"
  ]
}

Response

The response to a metrics query.

Changes