List metric definitions for a resource in Azure Monitor REST API
Updated: September 26, 2016
See common parameters and header for headers and parameters that are used by all requests related to metrics.
| Method | Request URI |
|---|---|
| GET | https://management.azure.com/{resource-id}/providers/microsoft.insights/metricdefinitions?api-version={api-version} |
Status code: 200
{
"id": "/subscriptions/1ef6a1b6-06c8-4dae-8ace-b6bc3f7394a3/resourceGroups/myResourceGroup/providers/Microsoft.Logic/workflows/myLogicApp/providers/microsoft.insights/metricdefinitions",
"value": [
{
"resourceId": "/subscriptions/1ef6a1b6-06c8-4dae-8ace-b6bc3f7394a3/resourceGroups/myResourceGroup/providers/Microsoft.Logic/workflows/myLogicApp",
"name": {
"value": "RunsStarted",
"localizedValue": "Runs Started"
},
"unit": "Count",
"primaryAggregationType": "Total",
"metricAvailabilities": [
{
"timeGrain": "PT1M",
"retention": "P30D"
},
{
"timeGrain": "PT1H",
"retention": "P30D"
}
],
"id": "/subscriptions/1ef6a1b6-06c8-4dae-8ace-b6bc3f7394a3/resourceGroups/myResourceGroup/providers/Microsoft.Logic/workflows/myLogicApp/providers/microsoft.insights/metricdefinitions/RunsStarted"
},
{
"resourceId": "/subscriptions/1ef6a1b6-06c8-4dae-8ace-b6bc3f7394a3/resourceGroups/myResourceGroup/providers/Microsoft.Logic/workflows/myLogicApp",
"name": {
"value": "RunsCompleted",
"localizedValue": "Runs Completed"
},
"unit": "Count",
"primaryAggregationType": "Total",
"metricAvailabilities": [
{
"timeGrain": "PT1M",
"retention": "P30D"
},
{
"timeGrain": "PT1H",
"retention": "P30D"
}
],
"id": "/subscriptions/1ef6a1b6-06c8-4dae-8ace-b6bc3f7394a3/resourceGroups/myResourceGroup/providers/Microsoft.Logic/workflows/myLogicApp/providers/microsoft.insights/metricdefinitions/RunsCompleted"
}
]
}
| Element name | Type | Description |
|---|---|---|
| id | String | Unique identifier for the command on this resource. |
| value | Complex Type | Array of JSON blobs where each blob is a metric definition. |
| resourceId | String | Resource ID of the resource that this metric definition is for. |
| name | Complex Type | LocalizableString object containing the name and a localized value (display name) for the metric. |
| unit | String | Unit of measurement for this metric. |
| primaryAggregationType | String | Enumeration value defining how to use the values for display. Possible values are: None, Average, Count, Total, Minimum, Maximum. |
| metricAvailabilities | Complex Type | Array of availability information. Describes what time grains are available for querying and what the retentions of those time grains are. |
| timeGrain | String | The granularity of time data for the metric, between 12 hours and 1 minute. ISO 8601 duration format. |
| retention | String | Describes the amount of time history for the metric at that time grain is stored (the amount of history that can be queried off of) in ISO 8601 duration format. For example, 'P30D' indicates that the metric for that time grain has historical data for up to 30 days in the past. |
Show: