Azure 監視器中計量警示所支援的資源Supported resources for metric alerts in Azure Monitor

Azure 監視器現已可支援新的計量警示類型,此類型具有遠優於傳統計量警示的優點。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 APIResource Manager 範本中建立新版計量警示。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 監視器 - 計量瀏覽器,即可探索並以視覺化方式檢視所有支援的計量及適用的維度。All supported metrics along with applicable dimensions can be explored and visualized from Azure Monitor - Metrics Explorer.

以下是新版警示所支援的 Azure 監視器計量來源完整清單:Here's the full list of Azure monitor metric sources supported by the newer alerts:

資源類型Resource type 支援的維度Dimensions Supported 可用的計量Metrics Available
Microsoft.ApiManagement/serviceMicrosoft.ApiManagement/service Yes API 管理API Management
Microsoft.Automation/automationAccountsMicrosoft.Automation/automationAccounts Yes 自動化帳戶Automation Accounts
Microsoft.Batch/batchAccountsMicrosoft.Batch/batchAccounts N/AN/A Batch 帳戶Batch Accounts
Microsoft.Cache/RedisMicrosoft.Cache/Redis N/AN/A Azure Cache for RedisAzure Cache for Redis
Microsoft.CognitiveServices/accountsMicrosoft.CognitiveServices/accounts N/AN/A 認知服務Cognitive Services
Microsoft.Compute/virtualMachinesMicrosoft.Compute/virtualMachines N/AN/A 虛擬機器Virtual Machines
Microsoft.Compute/virtualMachineScaleSetsMicrosoft.Compute/virtualMachineScaleSets N/AN/A 虛擬機器擴展集Virtual machine scale sets
Microsoft.ContainerInstance/containerGroupsMicrosoft.ContainerInstance/containerGroups Yes 容器群組Container groups
Microsoft.ContainerService/managedClustersMicrosoft.ContainerService/managedClusters Yes 受控叢集Managed Clusters
Microsoft.DataFactory/datafactoriesMicrosoft.DataFactory/datafactories Yes 資料處理站 V1Data Factories V1
Microsoft.DataFactory/factoriesMicrosoft.DataFactory/factories Yes 資料處理站 (V2)Data Factories V2
Microsoft.DBforMySQL/serversMicrosoft.DBforMySQL/servers N/AN/A 適用於 MySQL 的 DBDB for MySQL
Microsoft.DBforPostgreSQL/serversMicrosoft.DBforPostgreSQL/servers N/AN/A 適用於 PostgreSQL 的 DBDB for PostgreSQL
Microsoft.Devices/IotHubsMicrosoft.Devices/IotHubs N/AN/A IoT 中樞計量IoT Hub Metrics
Microsoft.Devices/provisioningServicesMicrosoft.Devices/provisioningServices Yes DPS 計量DPS Metrics
Microsoft.EventHub/namespacesMicrosoft.EventHub/namespaces Yes 事件中樞Event Hubs
Microsoft.KeyVault/vaultsMicrosoft.KeyVault/vaults No 保存庫Vaults
Microsoft.Logic/workflowsMicrosoft.Logic/workflows N/AN/A Logic AppsLogic Apps
Microsoft.Network/applicationGatewaysMicrosoft.Network/applicationGateways N/AN/A 應用程式閘道Application Gateways
Microsoft.Network/dnsZonesMicrosoft.Network/dnsZones N/AN/A DNS 區域DNS Zones
Microsoft.Network/expressRouteCircuitsMicrosoft.Network/expressRouteCircuits N/AN/A 快速路由線路Express Route Circuits
Microsoft.Network/loadBalancers (僅適用於標準 SKU)Microsoft.Network/loadBalancers (only for Standard SKUs) Yes 負載平衡器Load Balancers
Microsoft.Network/publicipaddressesMicrosoft.Network/publicipaddresses N/AN/A 公用 IP 位址Public IP Addresses
Microsoft.Network/trafficManagerProfilesMicrosoft.Network/trafficManagerProfiles Yes 流量管理員設定檔Traffic Manager Profiles
Microsoft.OperationalInsights/workspacesMicrosoft.OperationalInsights/workspaces Yes Log Analytics 工作區Log Analytics workspaces
Microsoft.PowerBIDedicated/capacitiesMicrosoft.PowerBIDedicated/capacities N/AN/A 容量Capacities
Microsoft.Search/searchServicesMicrosoft.Search/searchServices N/AN/A 搜尋服務Search services
Microsoft.ServiceBus/namespacesMicrosoft.ServiceBus/namespaces Yes 服務匯流排Service Bus
Microsoft.Storage/storageAccountsMicrosoft.Storage/storageAccounts Yes 儲存體帳戶Storage Accounts
Microsoft.Storage/storageAccounts/servicesMicrosoft.Storage/storageAccounts/services Yes Blob 服務檔案服務佇列服務資料表服務Blob Services, File Services, Queue Services and Table Services
Microsoft.StreamAnalytics/streamingjobsMicrosoft.StreamAnalytics/streamingjobs N/AN/A 串流分析Stream Analytics
Microsoft.Web/serverfarmsMicrosoft.Web/serverfarms Yes App Service 方案App Service Plans
Microsoft.Web/sitesMicrosoft.Web/sites Yes App Service函式App Services and Functions
Microsoft.Web/sites/slotsMicrosoft.Web/sites/slots Yes App Service 位置App Service slots

承載結構描述Payload schema

注意

您也可以使用一般警示架構, 讓您的 webhook 整合能夠在 Azure 監視器的所有警示服務中擁有單一可延伸和整合的警示承載。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.com/#resource//subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Contoso/providers/Microsoft.Storage/storageAccounts/diag500"
    },
    "properties": {
      "key1": "value1",
      "key2": "value2"
    }
  }
}

後續步驟Next steps