Microsoft Azure Monitor Metrics Definitions API

The Microsoft Azure Monitor Metrics Definitions API is a tool that allows users to access and retrieve detailed information about the various metrics available in their Azure resources. This API provides a comprehensive list of definitions for all the metrics that Azure Monitor collects, giving users the ability to understand and analyze the performance and health of their resources.

OpenAPI Specification

azure-monitor-metrics-definitions-api-openapi-original.yml Raw ↑
swagger: '2.0'
info:
  title: Microsoft Azure Azure Monitor Metrics Definitions API
  description: Provides APIs for getting the metric metadata for Azure resources.
  version: '2023-10-01'
host: management.azure.com
schemes:
  - https
consumes:
  - application/json
produces:
  - application/json
security:
  - azure_auth:
      - user_impersonation
securityDefinitions:
  azure_auth:
    type: oauth2
    authorizationUrl: https://login.microsoftonline.com/common/oauth2/authorize
    flow: implicit
    description: Azure Active Directory OAuth2 Flow
    scopes:
      user_impersonation: impersonate your user account
paths:
  /subscriptions/{subscriptionId}/providers/Microsoft.Insights/metricDefinitions:
    get:
      tags:
        - MetricDefinitions
      operationId: microsoftAzureMetricdefinitionsListatsubscriptionscope
      description: Lists the metric definitions for the subscription.
      parameters:
        - $ref: >-
            ../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter
        - $ref: >-
            ../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter
        - $ref: >-
            ../../../../common-types/v2/commonMonitoringTypes.json#/parameters/RegionParameter
        - $ref: >-
            ../../../../common-types/v2/commonMonitoringTypes.json#/parameters/MetricNamespaceParameter
      responses:
        '200':
          description: Successful request to get the list of metric definitions
          schema:
            $ref: '#/definitions/SubscriptionScopeMetricDefinitionCollection'
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: >-
              ../../../../common-types/v2/commonMonitoringTypes.json#/definitions/ErrorContract
      x-ms-pageable:
        nextLinkName:
      x-ms-examples:
        Get Subscription level Metric Definitions without filter:
          $ref: ./examples/GetMultiResourceMetricDefinitions.json
      summary: >-
        Microsoft Azure Get Subscriptions Subscriptionid Providers Microsoft Insights Metricdefinitions
  /{resourceUri}/providers/Microsoft.Insights/metricDefinitions:
    get:
      tags:
        - MetricDefinitions
      operationId: microsoftAzureMetricdefinitionsList
      description: Lists the metric definitions for the resource.
      parameters:
        - $ref: >-
            ../../../../common-types/v2/commonMonitoringTypes.json#/parameters/ResourceUriParameter
        - $ref: >-
            ../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter
        - $ref: >-
            ../../../../common-types/v2/commonMonitoringTypes.json#/parameters/MetricNamespaceParameter
      responses:
        '200':
          description: Successful request to get the list of metric definitions
          schema:
            $ref: '#/definitions/MetricDefinitionCollection'
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: >-
              ../../../../../common-types/resource-management/v1/types.json#/definitions/ErrorResponse
      x-ms-pageable:
        nextLinkName:
      x-ms-examples:
        Get Metric Definitions without filter:
          $ref: ./examples/GetMetricDefinitions.json
        Get Application Insights Metric Definitions without filter:
          $ref: ./examples/GetMetricDefinitionsApplicationInsights.json
        Get StorageCache Metric Definitions with metric class:
          $ref: ./examples/GetMetricDefinitionsMetricClass.json
      summary: Microsoft Azure Get Resourceuri Providers Microsoft Insights Metricdefinitions
definitions:
  MetricAvailability:
    type: object
    properties:
      timeGrain:
        type: string
        format: duration
        description: >-
          The time grain specifies a supported aggregation interval for the
          metric. Expressed as a duration 'PT1M', 'P1D', etc.
      retention:
        type: string
        format: duration
        description: >-
          The retention period for the metric at the specified timegrain.  Expressed as a duration 'PT1M', 'P1D', etc.
    description: >-
      Metric availability specifies the time grain (aggregation interval or
      frequency) and the retention period for that time grain.
  AggregationType:
    type: string
    description: The aggregation type of the metric.
    enum:
      - None
      - Average
      - Count
      - Minimum
      - Maximum
      - Total
    x-ms-enum:
      name: AggregationType
      modelAsString: false
  MetricAggregationType:
    type: string
    description: The aggregation type of the metric.
    enum:
      - None
      - Average
      - Count
      - Minimum
      - Maximum
      - Total
    x-ms-enum:
      name: MetricAggregationType
      modelAsString: true
  MetricClass:
    type: string
    description: The class of the metric.
    enum:
      - Availability
      - Transactions
      - Errors
      - Latency
      - Saturation
    x-ms-enum:
      name: MetricClass
      modelAsString: true
  MetricDefinition:
    type: object
    properties:
      isDimensionRequired:
        type: boolean
        description: Flag to indicate whether the dimension is required.
      resourceId:
        type: string
        description: The resource identifier of the resource that emitted the metric.
      namespace:
        type: string
        description: The namespace the metric belongs to.
      name:
        $ref: >-
          ../../../../common-types/v2/commonMonitoringTypes.json#/definitions/LocalizableString
        description: >-
          The name and the display name of the metric, i.e. it is a localizable
          string.
      displayDescription:
        type: string
        description: Detailed description of this metric.
      category:
        type: string
        description: Custom category name for this metric.
      metricClass:
        $ref: '#/definitions/MetricClass'
        description: The class of the metric.
      unit:
        $ref: >-
          ../../../../common-types/v2/commonMonitoringTypes.json#/definitions/Unit
        description: The unit of the metric.
      primaryAggregationType:
        $ref: '#/definitions/AggregationType'
        description: >-
          The primary aggregation type value defining how to use the values for
          display.
      supportedAggregationTypes:
        type: array
        items:
          $ref: '#/definitions/AggregationType'
        description: The collection of what aggregation types are supported.
      metricAvailabilities:
        type: array
        items:
          $ref: '#/definitions/MetricAvailability'
        x-ms-identifiers:
          - timeGrain
        description: >-
          The collection of what aggregation intervals are available to be
          queried.
      id:
        type: string
        description: The resource identifier of the metric definition.
      dimensions:
        type: array
        items:
          $ref: >-
            ../../../../common-types/v2/commonMonitoringTypes.json#/definitions/LocalizableString
        x-ms-identifiers:
          - value
        description: >-
          The name and the display name of the dimension, i.e. it is a
          localizable string.
    description: Metric definition class specifies the metadata for a metric.
  MetricDefinitionCollection:
    type: object
    properties:
      value:
        type: array
        items:
          $ref: '#/definitions/MetricDefinition'
        description: The values for the metric definitions.
    required:
      - value
    description: Represents collection of metric definitions.
  SubscriptionScopeMetricDefinition:
    type: object
    description: Metric definition class specifies the metadata for a metric.
    properties:
      isDimensionRequired:
        type: boolean
        description: Flag to indicate whether the dimension is required.
      resourceId:
        type: string
        description: The resource identifier of the resource that emitted the metric.
      namespace:
        type: string
        description: The namespace the metric belongs to.
      name:
        $ref: >-
          ../../../../common-types/v2/commonMonitoringTypes.json#/definitions/LocalizableString
        description: >-
          The name and the display name of the metric, i.e. it is a localizable
          string.
      displayDescription:
        type: string
        description: Detailed description of this metric.
      category:
        type: string
        description: Custom category name for this metric.
      metricClass:
        $ref: '#/definitions/MetricClass'
        description: The class of the metric.
      unit:
        $ref: >-
          ../../../../common-types/v2/commonMonitoringTypes.json#/definitions/Unit
        description: The unit of the metric.
      primaryAggregationType:
        $ref: '#/definitions/MetricAggregationType'
        description: >-
          The primary aggregation type value defining how to use the values for
          display.
      supportedAggregationTypes:
        type: array
        items:
          $ref: '#/definitions/MetricAggregationType'
        description: The collection of what aggregation types are supported.
      metricAvailabilities:
        type: array
        items:
          $ref: '#/definitions/MetricAvailability'
        x-ms-identifiers:
          - timeGrain
        description: >-
          The collection of what aggregation intervals are available to be
          queried.
      id:
        type: string
        description: The resource identifier of the metric definition.
      dimensions:
        type: array
        items:
          $ref: >-
            ../../../../common-types/v2/commonMonitoringTypes.json#/definitions/LocalizableString
        x-ms-identifiers:
          - value
        description: >-
          The name and the display name of the dimension, i.e. it is a
          localizable string.
  SubscriptionScopeMetricDefinitionCollection:
    type: object
    description: Represents collection of metric definitions.
    properties:
      value:
        type: array
        items:
          $ref: '#/definitions/SubscriptionScopeMetricDefinition'
        description: The values for the metric definitions.
    required:
      - value
tags:
  - name: MetricDefinitions