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.

MethodRequest URI
GEThttps://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 nameTypeDescription
idStringUnique identifier for the command on this resource.
valueComplex TypeArray of JSON blobs where each blob is a metric definition.
resourceIdStringResource ID of the resource that this metric definition is for.
nameComplex TypeLocalizableString object containing the name and a localized value (display name) for the metric.
unitStringUnit of measurement for this metric.
primaryAggregationTypeStringEnumeration value defining how to use the values for display. Possible values are: None, Average, Count, Total, Minimum, Maximum.
metricAvailabilitiesComplex TypeArray of availability information. Describes what time grains are available for querying and what the retentions of those time grains are.
timeGrainStringThe granularity of time data for the metric, between 12 hours and 1 minute. ISO 8601 duration format.
retentionStringDescribes 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: