Azure Monitor 中的指标警报支持的资源Supported resources for metric alerts in Azure Monitor

Azure Monitor 现在支持新型指标警报类型,它比旧式经典指标警报具有显著的优势。Azure Monitor now supports a new metric alert type which has significant benefits over the older classic metric alerts. 指标可用于 Azure 服务的大型列表Metrics are available for large list of Azure services. 新型警报支持资源类型的一个(不断增长的)子集。The newer alerts support a (growing) subset of the resource types. 本文列出了该子集。This article lists that subset.

还可以对提取为指标的常用日志数据(在 Log Analytics 工作区中存储)使用新型指标警报。You can also use newer metric alerts on popular log data stored in a Log Analytics workspace extracted as metrics. 有关详细信息,请查看日志的指标警报For more information, view Metric Alerts for Logs.

门户、PowerShell、CLI、REST 支持Portal, PowerShell, CLI, REST support

目前,仅可在 Azure 门户、REST API资源管理器模板中创建新型指标警报。Currently, you can create newer metric alerts only in the Azure portal, REST API, or Resource Manager Templates. 对于使用 PowerShell 和 Azure CLI 2.0 及更高版本配置新型警报的支持即将推出。Support for configuring newer alerts using PowerShell and Azure CLI versions 2.0 and higher is coming soon.

指标和维度支持Metrics and Dimensions Supported

新型指标警报支持针对使用维度的指标发出警报。Newer metric alerts support alerting for metrics that use dimensions. 可以使用维度将指标筛选到适当级别。You can use dimensions to filter your metric to the right level. 所有受支持的指标以及适用的维度都可以从 Azure Monitor - 指标资源管理器中进行浏览和可视化。All supported metrics along with applicable dimensions can be explored and visualized from Azure Monitor - Metrics Explorer.

下面是新型警报支持的 Azure Monitor 指标源的完整列表:Here's the full list of Azure monitor metric sources supported by the newer alerts:

资源类型Resource type 支持维度Dimensions Supported 多资源警报Multi-resource alerts 可用指标Metrics Available
Microsoft.Aadiam/azureADMetricsMicrosoft.Aadiam/azureADMetrics Yes No
Microsoft.ApiManagement/serviceMicrosoft.ApiManagement/service Yes No API 管理API Management
Microsoft.AppConfiguration/configurationStoresMicrosoft.AppConfiguration/configurationStores Yes No 应用配置App Configuration
Microsoft.AppPlatform/SpringMicrosoft.AppPlatform/Spring Yes No Azure Spring CloudAzure Spring Cloud
Microsoft.Automation/automationAccountsMicrosoft.Automation/automationAccounts Yes No 自动化帐户Automation Accounts
Microsoft.AVS/privateCloudsMicrosoft.AVS/privateClouds No No
Microsoft.Batch/batchAccountsMicrosoft.Batch/batchAccounts Yes No Batch 帐户Batch Accounts
Microsoft.Cache/RedisMicrosoft.Cache/Redis Yes No 用于 Redis 的 Azure 缓存Azure Cache for Redis
Microsoft.ClassicStorage/storageAccountsMicrosoft.ClassicStorage/storageAccounts Yes No 存储帐户(经典)Storage Accounts (classic)
Microsoft.ClassicStorage/storageAccounts/blobServicesMicrosoft.ClassicStorage/storageAccounts/blobServices Yes No
Microsoft.ClassicStorage/storageAccounts/fileServicesMicrosoft.ClassicStorage/storageAccounts/fileServices Yes No
Microsoft.ClassicStorage/storageAccounts/queueServicesMicrosoft.ClassicStorage/storageAccounts/queueServices Yes No
Microsoft.ClassicStorage/storageAccounts/tableServicesMicrosoft.ClassicStorage/storageAccounts/tableServices Yes No
Microsoft.CognitiveServices/accountsMicrosoft.CognitiveServices/accounts Yes No 认知服务Cognitive Services
Microsoft.Compute/virtualMachinesMicrosoft.Compute/virtualMachines Yes Yes 虚拟机Virtual Machines
Microsoft.Compute/virtualMachineScaleSetsMicrosoft.Compute/virtualMachineScaleSets Yes No 虚拟机规模集Virtual machine scale sets
Microsoft.ContainerInstance/containerGroupsMicrosoft.ContainerInstance/containerGroups Yes No 容器组Container groups
Microsoft.ContainerRegistry/registriesMicrosoft.ContainerRegistry/registries No No 容器注册表Container Registries
Microsoft.ContainerService/managedClustersMicrosoft.ContainerService/managedClusters Yes No 托管群集Managed Clusters
Microsoft.DataBoxEdge/dataBoxEdgeDevicesMicrosoft.DataBoxEdge/dataBoxEdgeDevices Yes Yes Data BoxData Box
Microsoft.DataFactory/datafactoriesMicrosoft.DataFactory/datafactories Yes No 数据工厂 V1Data Factories V1
Microsoft.DataFactory/factoriesMicrosoft.DataFactory/factories Yes No 数据工厂 V2Data Factories V2
Microsoft.DataShare/accountsMicrosoft.DataShare/accounts Yes No
Microsoft.DBforMariaDB/serversMicrosoft.DBforMariaDB/servers No No DB for MariaDBDB for MariaDB
Microsoft.DBforMySQL/serversMicrosoft.DBforMySQL/servers No No 适用于 MySQL 的 DBDB for MySQL
Microsoft.DBforPostgreSQL/flexibleServersMicrosoft.DBforPostgreSQL/flexibleServers Yes No
Microsoft.DBforPostgreSQL/serversMicrosoft.DBforPostgreSQL/servers No No 适用于 PostgreSQL 的 DBDB for PostgreSQL
Microsoft.DBforPostgreSQL/serversv2Microsoft.DBforPostgreSQL/serversv2 No No DB for PostgreSQL V2DB for PostgreSQL V2
Microsoft.DBforPostgreSQL/singleserversMicrosoft.DBforPostgreSQL/singleservers No No DB for PostgreSQL(单一服务器)DB for PostgreSQL (single servers)
Microsoft.Devices/IotHubsMicrosoft.Devices/IotHubs Yes No IoT 中心IoT Hub
Microsoft.Devices/provisioningServicesMicrosoft.Devices/provisioningServices Yes No 设备预配服务Device Provisioning Services
Microsoft.DigitalTwins/digitalTwinsInstancesMicrosoft.DigitalTwins/digitalTwinsInstances Yes No
Microsoft.DocumentDB/databaseAccountsMicrosoft.DocumentDB/databaseAccounts Yes No Cosmos DBCosmos DB
Microsoft.EventGrid/domainsMicrosoft.EventGrid/domains Yes No 事件网格域Event Grid Domains
Microsoft.EventGrid/systemTopicsMicrosoft.EventGrid/systemTopics Yes No 事件网格系统主题Event Grid System Topics
Microsoft.EventGrid/topicsMicrosoft.EventGrid/topics Yes No 事件网格主题Event Grid Topics
Microsoft.EventHub/clustersMicrosoft.EventHub/clusters Yes No 事件中心群集Event Hubs Clusters
Microsoft.EventHub/namespacesMicrosoft.EventHub/namespaces Yes No 事件中心Event Hubs
Microsoft.HDInsight/clustersMicrosoft.HDInsight/clusters Yes No HDInsight 群集HDInsight Clusters
Microsoft.Insights/ComponentsMicrosoft.Insights/Components Yes No Application InsightsApplication Insights
Microsoft.KeyVault/vaultsMicrosoft.KeyVault/vaults Yes Yes 保管库Vaults
Microsoft.Kusto/ClustersMicrosoft.Kusto/Clusters Yes No 数据资源管理器群集Data Explorer Clusters
Microsoft.Logic/integrationServiceEnvironmentsMicrosoft.Logic/integrationServiceEnvironments Yes No 集成服务环境Integration Service Environments
Microsoft.Logic/workflowsMicrosoft.Logic/workflows No No 逻辑应用Logic Apps
Microsoft.MachineLearningServices/workspacesMicrosoft.MachineLearningServices/workspaces Yes No 机器学习Machine Learning
Microsoft.Maps/accountsMicrosoft.Maps/accounts Yes No Maps 帐户Maps Accounts
Microsoft.Media/mediaservicesMicrosoft.Media/mediaservices No No 媒体服务Media Services
Microsoft.Media/mediaservices/streamingEndpointsMicrosoft.Media/mediaservices/streamingEndpoints Yes No 媒体服务流式处理终结点Media Services Streaming Endpoints
Microsoft.NetApp/netAppAccounts/capacityPoolsMicrosoft.NetApp/netAppAccounts/capacityPools Yes Yes Azure NetApp 容量池Azure NetApp Capacity Pools
Microsoft.NetApp/netAppAccounts/capacityPools/volumesMicrosoft.NetApp/netAppAccounts/capacityPools/volumes Yes Yes Azure NetApp 卷Azure NetApp Volumes
Microsoft.Network/applicationGatewaysMicrosoft.Network/applicationGateways Yes No 应用程序网关Application Gateways
Microsoft.Network/azurefirewallsMicrosoft.Network/azurefirewalls Yes No 防火墙Firewalls
Microsoft.Network/dnsZonesMicrosoft.Network/dnsZones No No DNS 区域DNS Zones
Microsoft.Network/expressRouteCircuitsMicrosoft.Network/expressRouteCircuits 空值N/A No Express Route 线路Express Route Circuits
Microsoft.Network/loadBalancers(仅限标准 SKU)Microsoft.Network/loadBalancers (only for Standard SKUs) Yes No 负载均衡器Load Balancers
Microsoft.Network/natGatewaysMicrosoft.Network/natGateways No No
Microsoft.Network/privateEndpointsMicrosoft.Network/privateEndpoints No No
Microsoft.Network/privateLinkServicesMicrosoft.Network/privateLinkServices No No
Microsoft.Network/publicipaddressesMicrosoft.Network/publicipaddresses No No 公共 IP 地址Public IP Addresses
Microsoft.Network/trafficManagerProfilesMicrosoft.Network/trafficManagerProfiles Yes No 流量管理器配置文件Traffic Manager Profiles
Microsoft.OperationalInsights/workspacesMicrosoft.OperationalInsights/workspaces Yes No Log Analytics 工作区Log Analytics workspaces
Microsoft.Peering/peeringsMicrosoft.Peering/peerings Yes No 对等互连Peerings
Microsoft.Peering/peeringServicesMicrosoft.Peering/peeringServices Yes No 对等互连服务Peering Services
Microsoft.PowerBIDedicated/capacitiesMicrosoft.PowerBIDedicated/capacities No No 容量Capacities
Microsoft.Relay/namespacesMicrosoft.Relay/namespaces Yes No 中继Relays
Microsoft.Search/searchServicesMicrosoft.Search/searchServices No No 搜索服务Search services
Microsoft.ServiceBus/namespacesMicrosoft.ServiceBus/namespaces Yes No 服务总线Service Bus
Microsoft.Sql/managedInstancesMicrosoft.Sql/managedInstances No Yes SQL 托管实例SQL Managed Instances
Microsoft.Sql/servers/databasesMicrosoft.Sql/servers/databases No Yes SQL 数据库SQL Databases
Microsoft.Sql/servers/elasticPoolsMicrosoft.Sql/servers/elasticPools No Yes SQL 弹性池SQL Elastic Pools
Microsoft.Storage/storageAccountsMicrosoft.Storage/storageAccounts Yes No 存储帐户Storage Accounts
Microsoft.Storage/storageAccounts/servicesMicrosoft.Storage/storageAccounts/services Yes No Blob 服务文件服务队列服务表服务Blob Services, File Services, Queue Services and Table Services
Microsoft.StorageCache/cachesMicrosoft.StorageCache/caches Yes No
Microsoft.StorageSync/storageSyncServicesMicrosoft.StorageSync/storageSyncServices Yes No 存储同步服务Storage Sync Services
Microsoft.StreamAnalytics/streamingjobsMicrosoft.StreamAnalytics/streamingjobs Yes No 流分析Stream Analytics
Microsoft.VMWareCloudSimple/virtualMachinesMicrosoft.VMWareCloudSimple/virtualMachines Yes No CloudSimple 虚拟机CloudSimple Virtual Machines
Microsoft.Web/hostingEnvironments/multiRolePoolsMicrosoft.Web/hostingEnvironments/multiRolePools Yes No 应用服务环境多角色池App Service Environment Multi-Role Pools
Microsoft.Web/hostingEnvironments/workerPoolsMicrosoft.Web/hostingEnvironments/workerPools Yes No 应用服务环境工作线程池App Service Environment Worker Pools
Microsoft.Web/serverfarmsMicrosoft.Web/serverfarms Yes No 应用服务计划App Service Plans
Microsoft.Web/sitesMicrosoft.Web/sites Yes No 应用程序服务FunctionsApp Services and Functions
Microsoft.Web/sites/slotsMicrosoft.Web/sites/slots Yes No 应用服务槽App Service slots

负载架构Payload schema

备注

还可以使用常见警报架构,它的优点是可以跨 Azure Monitor 中的所有警报服务提供单个可扩展且统一的警报有效负载,用于 Webhook 集成。You can also use the common alert schema, which provides the advantage of having a single extensible and unified alert payload across all the alert services in Azure Monitor, for your webhook integrations. 了解常见的警报架构定义。Learn about the common alert schema definitions.

使用适当配置的操作组时,POST 操作对于所有准新型指标警报包含以下 JSON 有效负载和架构:The POST operation contains the following JSON payload and schema for all near newer metric alerts when an appropriately configured action group is used:

{
  "schemaId": "AzureMonitorMetricAlert",
  "data": {
    "version": "2.0",
    "status": "Activated",
    "context": {
      "timestamp": "2018-02-28T10:44:10.1714014Z",
      "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Contoso/providers/microsoft.insights/metricAlerts/StorageCheck",
      "name": "StorageCheck",
      "description": "",
      "conditionType": "SingleResourceMultipleMetricCriteria",
      "severity":"3",
      "condition": {
        "windowSize": "PT5M",
        "allOf": [
          {
            "metricName": "Transactions",
            "metricNamespace":"microsoft.storage/storageAccounts",
            "dimensions": [
              {
                "name": "AccountResourceId",
                "value": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Contoso/providers/Microsoft.Storage/storageAccounts/diag500"
              },
              {
                "name": "GeoType",
                "value": "Primary"
              }
            ],
            "operator": "GreaterThan",
            "threshold": "0",
            "timeAggregation": "PT5M",
            "metricValue": 1
          }
        ]
      },
      "subscriptionId": "00000000-0000-0000-0000-000000000000",
      "resourceGroupName": "Contoso",
      "resourceName": "diag500",
      "resourceType": "Microsoft.Storage/storageAccounts",
      "resourceId": "/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/Contoso/providers/Microsoft.Storage/storageAccounts/diag500",
      "portalLink": "https://portal.azure.cn/#resource//subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Contoso/providers/Microsoft.Storage/storageAccounts/diag500"
    },
    "properties": {
      "key1": "value1",
      "key2": "value2"
    }
  }
}

后续步骤Next steps