Azure Monitor Metric Definitions API

Operations for listing metric definitions

Documentation

📖
Documentation
https://learn.microsoft.com/en-us/rest/api/monitor/metrics
📖
Authentication
https://learn.microsoft.com/en-us/azure/azure-monitor/essentials/rest-api-walkthrough
📖
GettingStarted
https://learn.microsoft.com/en-us/azure/azure-monitor/essentials/rest-api-walkthrough
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/monitor/metric-definitions
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/monitor/metrics-batch
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/loganalytics/
📖
GettingStarted
https://learn.microsoft.com/en-us/azure/azure-monitor/logs/api/overview
📖
Documentation
https://learn.microsoft.com/en-us/azure/azure-monitor/logs/logs-ingestion-api-overview
📖
GettingStarted
https://learn.microsoft.com/en-us/azure/azure-monitor/logs/tutorial-logs-ingestion-api
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/monitor/alertrules
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/monitor/scheduledqueryrule-2021-08-01/scheduled-query-rules
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/monitor/action-groups
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/monitor/autoscale-settings
📖
GettingStarted
https://learn.microsoft.com/en-us/azure/azure-monitor/autoscale/autoscale-best-practices
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/application-insights/
📖
GettingStarted
https://learn.microsoft.com/en-us/azure/azure-monitor/app/opentelemetry-enable
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/monitor/diagnostic-settings
📖
GettingStarted
https://learn.microsoft.com/en-us/azure/azure-monitor/essentials/diagnostic-settings
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/monitor/activity-logs
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/monitor/data-collection-rules
📖
GettingStarted
https://learn.microsoft.com/en-us/azure/azure-monitor/data-collection/data-collection-rule-create-edit
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/monitor/data-collection-endpoints
📖
GettingStarted
https://learn.microsoft.com/en-us/azure/azure-monitor/data-collection/data-collection-endpoint-overview
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/monitor/private-link-scopes
📖
GettingStarted
https://learn.microsoft.com/en-us/azure/azure-monitor/logs/private-link-configure

Specifications

Schemas & Data

Other Resources

OpenAPI Specification

microsoft-azure-monitor-metric-definitions-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Azure Monitor Action Groups Metric Definitions API
  description: Create and manage action groups that define notification and automation actions triggered by Azure Monitor alerts, including email, SMS, webhooks, and Azure Functions.
  version: '2022-06-01'
  contact:
    name: Microsoft Azure Support
    url: https://azure.microsoft.com/en-us/support/options/
  license:
    name: Microsoft API License
    url: https://azure.microsoft.com/en-us/support/legal/
servers:
- url: https://management.azure.com
  description: Azure Resource Manager
security:
- oauth2:
  - https://management.azure.com/.default
tags:
- name: Metric Definitions
  description: Operations for listing metric definitions
paths:
  /subscriptions/{subscriptionId}/providers/Microsoft.Insights/metricDefinitions:
    get:
      operationId: MetricDefinitions_ListAtSubscriptionScope
      summary: Azure Monitor List metric definitions at subscription scope
      description: Lists the metric definitions for the subscription. Returns the available metric definitions that can be queried at the subscription level.
      tags:
      - Metric Definitions
      parameters:
      - $ref: '#/components/parameters/SubscriptionIdParameter'
      - $ref: '#/components/parameters/ApiVersionParameter'
      - $ref: '#/components/parameters/RegionParameter'
      - $ref: '#/components/parameters/MetricNamespaceParameter'
      responses:
        '200':
          description: Successful request to get the list of metric definitions.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetricDefinitionCollection'
        default:
          description: Error response describing why the operation failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /{resourceUri}/providers/Microsoft.Insights/metricDefinitions:
    get:
      operationId: MetricDefinitions_List
      summary: Azure Monitor List metric definitions for a resource
      description: Lists the metric definitions for the resource. Returns the available metric definitions and their properties for the specified resource.
      tags:
      - Metric Definitions
      parameters:
      - $ref: '#/components/parameters/ResourceUriParameter'
      - $ref: '#/components/parameters/ApiVersionParameter'
      - $ref: '#/components/parameters/MetricNamespaceParameter'
      responses:
        '200':
          description: Successful request to get the list of metric definitions.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetricDefinitionCollection'
        default:
          description: Error response describing why the operation failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  parameters:
    ApiVersionParameter:
      name: api-version
      in: query
      required: true
      description: Client API version.
      schema:
        type: string
        default: '2023-10-01'
    RegionParameter:
      name: region
      in: query
      required: false
      description: The region where the metrics you want reside.
      schema:
        type: string
    MetricNamespaceParameter:
      name: metricNamespace
      in: query
      required: false
      description: Metric namespace to query metric definitions for.
      schema:
        type: string
    ResourceUriParameter:
      name: resourceUri
      in: path
      required: true
      description: The identifier of the resource.
      schema:
        type: string
    SubscriptionIdParameter:
      name: subscriptionId
      in: path
      required: true
      description: The ID of the target subscription.
      schema:
        type: string
  schemas:
    ErrorResponse:
      type: object
      properties:
        code:
          type: string
          description: Error code.
        message:
          type: string
          description: Error message indicating why the operation failed.
    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: '#/components/schemas/LocalizableString'
        displayDescription:
          type: string
          description: Detailed description of this metric.
        category:
          type: string
          description: Custom category name for this metric.
        metricClass:
          type: string
          enum:
          - Availability
          - Transactions
          - Errors
          - Latency
          - Saturation
          description: The class of the metric.
        unit:
          type: string
          enum:
          - Count
          - Bytes
          - Seconds
          - CountPerSecond
          - BytesPerSecond
          - Percent
          - MilliSeconds
          - ByteSeconds
          - Unspecified
          - Cores
          - MilliCores
          - NanoCores
          - BitsPerSecond
          description: The unit of the metric.
        primaryAggregationType:
          type: string
          enum:
          - None
          - Average
          - Count
          - Minimum
          - Maximum
          - Total
          description: The primary aggregation type value defining how to use the values.
        supportedAggregationTypes:
          type: array
          items:
            type: string
            enum:
            - None
            - Average
            - Count
            - Minimum
            - Maximum
            - Total
          description: The collection of what aggregation types are supported.
        metricAvailabilities:
          type: array
          items:
            $ref: '#/components/schemas/MetricAvailability'
          description: The collection of what aggregation intervals are available.
        id:
          type: string
          description: The resource identifier of the metric definition.
        dimensions:
          type: array
          items:
            $ref: '#/components/schemas/LocalizableString'
          description: The name and the display name of the dimension, i.e. the localized string representation.
    MetricDefinitionCollection:
      type: object
      required:
      - value
      properties:
        value:
          type: array
          items:
            $ref: '#/components/schemas/MetricDefinition'
          description: The values for the metric definitions.
    LocalizableString:
      type: object
      required:
      - value
      properties:
        value:
          type: string
          description: The invariant value.
        localizedValue:
          type: string
          description: The display name.
    MetricAvailability:
      type: object
      properties:
        timeGrain:
          type: string
          description: The time grain specifies the aggregation interval in ISO 8601 duration format.
        retention:
          type: string
          description: The retention period for the metric in ISO 8601 duration format.
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://login.microsoftonline.com/{tenantId}/oauth2/v2.0/token
          scopes:
            https://management.azure.com/.default: Access Azure Management API