Microsoft.Insights metricAlerts

Bicep 資源定義

metricAlerts 資源類型可以使用目標作業進行部署:

如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄檔。

備註

如需部署監視解決方案的指引,請參閱 使用 Bicep 建立監視資源

資源格式

若要建立 Microsoft.Insights/metricAlerts 資源,請將下列 Bicep 新增至範本。

resource symbolicname 'Microsoft.Insights/metricAlerts@2018-03-01' = {
  name: 'string'
  location: 'string'
  tags: {
    tagName1: 'tagValue1'
    tagName2: 'tagValue2'
  }
  properties: {
    actions: [
      {
        actionGroupId: 'string'
        webHookProperties: {}
      }
    ]
    autoMitigate: bool
    criteria: {
      'odata.type': 'string'
      // For remaining properties, see MetricAlertCriteria objects
    }
    description: 'string'
    enabled: bool
    evaluationFrequency: 'string'
    scopes: [
      'string'
    ]
    severity: int
    targetResourceRegion: 'string'
    targetResourceType: 'string'
    windowSize: 'string'
  }
}

MetricAlertCriteria 物件

設定 odata.type 屬性以指定物件的類型。

針對 Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria,請使用:

  'odata.type': 'Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria'
  allOf: [
    {
      dimensions: [
        {
          name: 'string'
          operator: 'string'
          values: [
            'string'
          ]
        }
      ]
      metricName: 'string'
      metricNamespace: 'string'
      name: 'string'
      skipMetricValidation: bool
      timeAggregation: 'string'
      criterionType: 'string'
      // For remaining properties, see MultiMetricCriteria objects
    }
  ]

針對 Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria,請使用:

  'odata.type': 'Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria'
  allOf: [
    {
      criterionType: 'string'
      dimensions: [
        {
          name: 'string'
          operator: 'string'
          values: [
            'string'
          ]
        }
      ]
      metricName: 'string'
      metricNamespace: 'string'
      name: 'string'
      operator: 'string'
      skipMetricValidation: bool
      threshold: int
      timeAggregation: 'string'
    }
  ]

針對 Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria,請使用:

  'odata.type': 'Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria'
  componentId: 'string'
  failedLocationCount: int
  webTestId: 'string'

MultiMetricCriteria 物件

設定 criterionType 屬性以指定物件的類型。

針對 DynamicThresholdCriterion,請使用:

  criterionType: 'DynamicThresholdCriterion'
  alertSensitivity: 'string'
  failingPeriods: {
    minFailingPeriodsToAlert: int
    numberOfEvaluationPeriods: int
  }
  ignoreDataBefore: 'string'
  operator: 'string'

針對 StaticThresholdCriterion,請使用:

  criterionType: 'StaticThresholdCriterion'
  operator: 'string'
  threshold: int

屬性值

metricAlerts

名稱 描述
NAME 資源名稱 需要字串 ()

字元限制:1-260

合法字元:
不能使用:
*#&+:<>?@%{}\/ 或控制字元

不能以空格或句號結尾。
location 資源位置 需要字串 ()
tags 資源標籤 標記名稱和值的字典。 請參閱 範本中的標籤
properties 資源的警示規則屬性。 MetricAlertProperties (必要)

MetricAlertProperties

名稱 描述
動作 當警示規則變成作用中時,以及解決警示條件時所執行的動作陣列。 MetricAlertAction[]
autoMitigate 旗標,指出是否應該自動解決警示。 預設值是 true。 bool
準則 定義特定的警示準則資訊。 MetricAlertCriteria (必要)
description 將包含在警示電子郵件中的計量警示描述。 字串
已啟用 旗標,指出是否啟用計量警示。 bool (必要)
evaluationFrequency 以 ISO 8601 持續時間格式來評估計量警示的頻率。 需要字串 ()
範圍 此計量警示的範圍是資源標識碼的清單。 string[] (必要)
嚴重程度 警示嚴重性 {0, 1, 2, 3, 4} 需要 int ()
targetResourceRegion 建立/更新警示的目標資源區域 () 。 如果範圍包含訂用帳戶、資源群組或多個資源,則為必要專案。 字串
targetResourceType 目標資源的資源類型 (建立/更新警示) 。 如果範圍包含訂用帳戶、資源群組或多個資源,則為必要專案。 字串
windowSize ISO 8601 持續時間格式 (期間) ,用來根據閾值監視警示活動。 需要字串 ()

MetricAlertAction

名稱 描述
actionGroupId 要使用的動作群組標識碼。 字串
webHookProperties 此欄位允許指定自定義屬性,這會附加至傳送為 Webhook 輸入的警示承載。 物件 (object)

MetricAlertCriteria

名稱 描述
odata.type 設定物件類型 Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria
Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria
Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria (必要)

MetricAlertMultipleResourceMultipleMetricCriteria

名稱 描述
odata.type 會指定警示準則的類型。 'Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria' (必要)
allOf 此「全部」作業的多個計量準則清單。 MultiMetricCriteria[]

MultiMetricCriteria

名稱 描述
dimensions 維度條件的清單。 MetricDimension[]
metricName 計量的名稱。 需要字串 ()
metricNamespace 計量的命名空間。 字串
NAME 準則的名稱。 需要字串 ()
skipMetricValidation 藉由導致略過計量驗證,允許針對尚未發出的自訂計量建立警示規則。 bool
timeAggregation 準則時間匯總類型。 'Average'
'Count'
'Maximum'
'Minimum'
必要) 'Total' (
criterionType 設定物件類型 DynamicThresholdCriterion
StaticThresholdCriterion (必要)

MetricDimension

名稱 描述
NAME 維度的名稱。 需要字串 ()
! 運算子之後 維度運算子。 僅支援 'Include' 和 'Exclude' 需要字串 ()
維度值的清單。 string[] (必要)

DynamicMetricCriteria

名稱 描述
criterionType 指定臨界值準則的類型 'DynamicThresholdCriterion' (必要)
alertSensitivity 觸發警示所需的偏差範圍。 這會影響臨界值與計量系列模式的緊密程度。 'High'
'Low'
必要) 'Medium' (
failingPeriods 在引發警示所需的所選回溯時間範圍內,所需的違規次數下限。 需要 DynamicThresholdFailingPeriods ()
ignoreDataBefore 使用此選項可設定開始學習計量歷程記錄數據的日期,並以ISO8601格式計算動態閾值 () 字串
! 運算子之後 用來比較計量值與閾值的運算符。 'GreaterOrLessThan'
'GreaterThan'
需要 『LessThan』 ()

DynamicThresholdFailingPeriods

名稱 描述
minFailingPeriodsToAlert 觸發警示的違規次數。 應小於或等於 numberOfEvaluationPeriods。 需要 int ()
numberOfEvaluationPeriods 匯總回溯點的數目。 回溯時間範圍是根據匯總數據粒度計算, (windowSize) 和選取的匯總點數目。 需要 int ()

MetricCriteria

名稱 描述
criterionType 指定臨界值準則的類型 'DynamicThresholdCriterion'
'StaticThresholdCriterion' (必要)
dimensions 維度條件的清單。 MetricDimension[]
metricName 計量的名稱。 字串 (必要)
metricNamespace 計量的命名空間。 字串
NAME 準則的名稱。 字串 (必要)
! 運算子之後 criteria 運算子。 'Equals'
'GreaterThan'
'GreaterThanOrEqual'
'LessThan'
'LessThanOrEqual' (必要)
skipMetricValidation 藉由導致略過計量驗證,允許針對尚未發出的自訂計量建立警示規則。 bool
threshold 啟動警示的準則臨界值。 int (必要)
timeAggregation 準則時間匯總類型。 'Average'
'Count'
'Maximum'
'Minimum'
必要) 的「總計」 (

MetricAlertSingleResourceMultipleMetricCriteria

名稱 描述
odata.type 指定警示準則的類型。 'Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria' (必要)
allOf 此「全部」作業的計量準則清單。 MetricCriteria[]

WebtestLocationAvailabilityCriteria

名稱 描述
odata.type 指定警示準則的類型。 'Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria' (必要)
componentId Application Insights 資源標識符。 字串 (必要)
failedLocationCount 失敗的位置數目。 int (必要)
webTestId Application Insights Web 測試標識符。 字串 (必要)

快速入門範本

下列快速入門範本會部署此資源類型。

範本 描述
BrowserBox Azure Edition

部署至 Azure
此範本會在 Azure Ubuntu Server 22.04 LTS、Debian 11 或 RHEL 8.7 LVM VM 上部署 BrowserBox。
可調整的 Umbraco CMS Web 應用程式

部署至 Azure
此範本提供在 Azure App 服務 Web Apps 上部署 umbraco CMS Web 應用程式的簡單方式。
為您的 應用程式閘道 建立警示

部署至 Azure
使用這些範本輕鬆地為您的 Azure 應用程式閘道 建立一些重要的事件警示。
後端最後位元組回應計量的警示

部署至 Azure
使用這類範本,輕鬆地為您的 Azure 應用程式閘道 建立一些重要的事件警示。
狀況不良主機計數計量的警示

部署至 Azure
使用這類範本,輕鬆地為您的 Azure 應用程式閘道 建立一些重要的事件警示。
Enterprise Governance-AppService、SQL DB、AD、OMS、Runbook

部署至 Azure
企業或大型的雲端採用需要負責任且有效率的治理模型,才能從其雲端部署衍生價值。 CloudWise (解決方案的程式代碼名稱) ,是 Azure 合作夥伴快速入門提供的複合解決方案,是客戶、系統整合者和合作夥伴的採用啟用者,可提供可自助、自動化的治理和作業解決方案,著重於優化成本、改善您的應用程式 () 可靠性、降低商務風險。 解決方案強調可見度和控制的核心治理要素。
動態 Web 測試建立

部署至 Azure
建立任意數目的 App Insights Web (ping) 測試。
部署 Application Insight 並在其中建立警示

部署至 Azure
此範本可讓您部署Application Insight,並在其中建立警示
具有動態閾值的計量警示規則

部署至 Azure
此範本會建立計量警示規則,以使用動態閾值條件類型監視虛擬機的 CPU 百分比計量。
具有靜態閾值的計量警示規則

部署至 Azure
此範本會建立計量警示規則,以使用靜態閾值條件類型監視虛擬機的 CPU 百分比計量。
可用性測試的計量警示規則

部署至 Azure
此範本會建立 Application Insights 可用性測試,以及監視它的計量警示規則。

ARM 範本資源定義

metricAlerts 資源類型可以使用目標作業來部署:

如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄

備註

如需部署監視解決方案的指引,請參閱 使用 Bicep 建立監視資源

資源格式

若要建立 Microsoft.Insights/metricAlerts 資源,請將下列 JSON 新增至您的範本。

{
  "type": "Microsoft.Insights/metricAlerts",
  "apiVersion": "2018-03-01",
  "name": "string",
  "location": "string",
  "tags": {
    "tagName1": "tagValue1",
    "tagName2": "tagValue2"
  },
  "properties": {
    "actions": [
      {
        "actionGroupId": "string",
        "webHookProperties": {}
      }
    ],
    "autoMitigate": "bool",
    "criteria": {
      "odata.type": "string"
      // For remaining properties, see MetricAlertCriteria objects
    },
    "description": "string",
    "enabled": "bool",
    "evaluationFrequency": "string",
    "scopes": [ "string" ],
    "severity": "int",
    "targetResourceRegion": "string",
    "targetResourceType": "string",
    "windowSize": "string"
  }
}

MetricAlertCriteria 物件

設定 odata.type 屬性以指定物件的類型。

針對 Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria,請使用:

  "odata.type": "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
  "allOf": [
    {
      "dimensions": [
        {
          "name": "string",
          "operator": "string",
          "values": [ "string" ]
        }
      ],
      "metricName": "string",
      "metricNamespace": "string",
      "name": "string",
      "skipMetricValidation": "bool",
      "timeAggregation": "string",
      "criterionType": "string"
      // For remaining properties, see MultiMetricCriteria objects
    }
  ]

針對 Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria,請使用:

  "odata.type": "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria",
  "allOf": [
    {
      "criterionType": "string",
      "dimensions": [
        {
          "name": "string",
          "operator": "string",
          "values": [ "string" ]
        }
      ],
      "metricName": "string",
      "metricNamespace": "string",
      "name": "string",
      "operator": "string",
      "skipMetricValidation": "bool",
      "threshold": "int",
      "timeAggregation": "string"
    }
  ]

針對 Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria,請使用:

  "odata.type": "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria",
  "componentId": "string",
  "failedLocationCount": "int",
  "webTestId": "string"

MultiMetricCriteria 物件

設定 criterionType 屬性以指定物件的類型。

針對 DynamicThresholdCriterion,請使用:

  "criterionType": "DynamicThresholdCriterion",
  "alertSensitivity": "string",
  "failingPeriods": {
    "minFailingPeriodsToAlert": "int",
    "numberOfEvaluationPeriods": "int"
  },
  "ignoreDataBefore": "string",
  "operator": "string"

針對 StaticThresholdCriterion,請使用:

  "criterionType": "StaticThresholdCriterion",
  "operator": "string",
  "threshold": "int"

屬性值

metricAlerts

名稱 描述
類型 資源類型 'Microsoft.Insights/metricAlerts'
apiVersion 資源 API 版本 '2018-03-01'
NAME 資源名稱 字串 (必要)

字元限制:1-260

合法字元:
不能使用:
*#&+:<>?@%{}\/ 或控制字元

不能以空格或句號結尾。
location 資源位置 字串 (必要)
tags 資源標籤 標記名稱和值的字典。 請參閱 範本中的標記
properties 資源的警示規則屬性。 MetricAlertProperties (必要)

MetricAlertProperties

名稱 描述
動作 當警示規則變成作用中時,以及解決警示條件時所執行的動作陣列。 MetricAlertAction[]
autoMitigate 指出是否應該自動解決警示的旗標。 預設值是 true。 bool
準則 定義特定的警示準則資訊。 MetricAlertCriteria (必要)
description 將包含在警示電子郵件中的計量警示描述。 字串
已啟用 指出是否啟用計量警示的旗標。 bool (必要)
evaluationFrequency 以 ISO 8601 持續時間格式來評估計量警示的頻率。 字串 (必要)
範圍 此計量警示的範圍為的資源標識符清單。 string[] (必要)
嚴重程度 警示嚴重性 {0, 1, 2, 3, 4} int (必要)
targetResourceRegion 建立/更新警示的目標資源 () 區域。 如果範圍包含訂用帳戶、資源群組或多個資源,則為必要。 字串
targetResourceType 建立/更新警示的目標資源 () 的資源類型。 如果範圍包含訂用帳戶、資源群組或多個資源,則為必要。 字串
windowSize ISO 8601 持續時間格式 (期間) ,用來根據閾值監視警示活動。 字串 (必要)

MetricAlertAction

名稱 描述
actionGroupId 要使用的動作群組標識碼。 字串
webHookProperties 此欄位允許指定自定義屬性,這會附加至傳送為 Webhook 輸入的警示承載。 物件 (object)

MetricAlertCriteria

名稱 描述
odata.type 設定物件類型 Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria
Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria
Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria (必要)

MetricAlertMultipleResourceMultipleMetricCriteria

名稱 描述
odata.type 會指定警示準則的類型。 'Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria' (必要)
allOf 此「全部」作業的多個計量準則清單。 MultiMetricCriteria[]

MultiMetricCriteria

名稱 描述
dimensions 維度條件的清單。 MetricDimension[]
metricName 計量的名稱。 需要字串 ()
metricNamespace 計量的命名空間。 字串
NAME 準則的名稱。 需要字串 ()
skipMetricValidation 藉由導致略過計量驗證,允許針對尚未發出的自訂計量建立警示規則。 bool
timeAggregation 準則時間匯總類型。 'Average'
'Count'
'Maximum'
'Minimum'
必要) 'Total' (
criterionType 設定物件類型 DynamicThresholdCriterion
StaticThresholdCriterion (必要)

MetricDimension

名稱 描述
NAME 維度的名稱。 需要字串 ()
! 運算子之後 維度運算子。 僅支援 'Include' 和 'Exclude' 需要字串 ()
維度值的清單。 string[] (必要)

DynamicMetricCriteria

名稱 描述
criterionType 指定臨界值準則的類型 'DynamicThresholdCriterion' (必要)
alertSensitivity 觸發警示所需的偏差範圍。 這會影響臨界值與計量系列模式的緊密程度。 'High'
'Low'
必要) 'Medium' (
failingPeriods 在引發警示所需的所選回溯時間範圍內,所需的違規次數下限。 需要 DynamicThresholdFailingPeriods ()
ignoreDataBefore 使用此選項可設定開始學習計量歷程記錄數據的日期,並以ISO8601格式計算動態閾值 () 字串
! 運算子之後 用來比較計量值與閾值的運算符。 'GreaterOrLessThan'
'GreaterThan'
需要 『LessThan』 ()

DynamicThresholdFailingPeriods

名稱 描述
minFailingPeriodsToAlert 觸發警示的違規次數。 應小於或等於 numberOfEvaluationPeriods。 需要 int ()
numberOfEvaluationPeriods 匯總回溯點的數目。 回溯時間範圍是根據匯總數據粒度計算, (windowSize) 和選取的匯總點數目。 需要 int ()

MetricCriteria

名稱 描述
criterionType 指定臨界值準則的類型 'DynamicThresholdCriterion'
'StaticThresholdCriterion' (必要)
dimensions 維度條件的清單。 MetricDimension[]
metricName 計量的名稱。 需要字串 ()
metricNamespace 計量的命名空間。 字串
NAME 準則的名稱。 需要字串 ()
! 運算子之後 criteria 運算子。 'Equals'
'GreaterThan'
'GreaterThanOrEqual'
'LessThan'
'LessThanOrEqual' (必要)
skipMetricValidation 藉由導致略過計量驗證,允許針對尚未發出的自訂計量建立警示規則。 bool
threshold 啟動警示的準則閾值。 需要 int ()
timeAggregation 準則時間匯總類型。 'Average'
'Count'
'Maximum'
'Minimum'
必要) 'Total' (

MetricAlertSingleResourceMultipleMetricCriteria

名稱 描述
odata.type 會指定警示準則的類型。 'Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria' (必要)
allOf 此「全部」作業的計量準則清單。 MetricCriteria[]

WebtestLocationAvailabilityCriteria

名稱 描述
odata.type 會指定警示準則的類型。 'Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria' (必要)
componentId Application Insights 資源標識符。 需要字串 ()
failedLocationCount 失敗的位置數目。 需要 int ()
webTestId Application Insights Web 測試標識符。 需要字串 ()

快速入門範本

下列快速入門範本會部署此資源類型。

範本 描述
BrowserBox Azure Edition

部署至 Azure
此範本會在 Azure Ubuntu Server 22.04 LTS、Debian 11 或 RHEL 8.7 LVM VM 上部署 BrowserBox。
可調整的 Umbraco CMS Web 應用程式

部署至 Azure
此範本提供在 Azure App 服務 Web Apps 上部署 umbraco CMS Web 應用程式的簡單方式。
為您的 應用程式閘道 建立警示

部署至 Azure
使用這些範本,輕鬆地為您的 Azure 應用程式閘道 建立一些重要的事件警示。
後端最後位元組回應計量的警示

部署至 Azure
使用這類範本,輕鬆地為您的 Azure 應用程式閘道 建立一些重要的事件警示。
狀況不良主機計數計量的警示

部署至 Azure
使用這類範本,輕鬆地為您的 Azure 應用程式閘道 建立一些重要的事件警示。
Enterprise Governance-AppService、SQL DB、AD、OMS、Runbook

部署至 Azure
企業或大型的雲端採用需要負責任且有效率的治理模型,才能從其雲端部署衍生價值。 CloudWise (解決方案) 的程式代碼名稱,是 Azure 合作夥伴快速入門中提供的複合解決方案,是客戶、系統整合者和合作夥伴的採用啟用者,可提供自助式、自動化的治理和作業解決方案,著重於優化成本、改善應用程式 () 可靠性、降低商務風險。 此解決方案強調可見度和控制的核心治理要素。
動態 Web 測試建立

部署至 Azure
建立任意數目的 App Insights Web (ping) 測試。
部署 Application Insight 並在其中建立警示

部署至 Azure
此範本可讓您部署Application Insight,並在其中建立警示
具有動態閾值的計量警示規則

部署至 Azure
此範本會建立計量警示規則,以使用動態閾值條件類型監視虛擬機的 CPU 百分比計量。
具有靜態閾值的計量警示規則

部署至 Azure
此範本會建立計量警示規則,以使用靜態閾值條件類型監視虛擬機的 CPU 百分比計量。
可用性測試的計量警示規則

部署至 Azure
此範本會建立 Application Insights 可用性測試,以及監視它的計量警示規則。

Terraform (AzAPI 提供者) 資源定義

metricAlerts 資源類型可以使用目標作業來部署:

  • 資源群組

如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄

資源格式

若要建立 Microsoft.Insights/metricAlerts 資源,請將下列 Terraform 新增至您的範本。

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.Insights/metricAlerts@2018-03-01"
  name = "string"
  location = "string"
  parent_id = "string"
  tags = {
    tagName1 = "tagValue1"
    tagName2 = "tagValue2"
  }
  body = jsonencode({
    properties = {
      actions = [
        {
          actionGroupId = "string"
          webHookProperties = {}
        }
      ]
      autoMitigate = bool
      criteria = {
        odata.type = "string"
        // For remaining properties, see MetricAlertCriteria objects
      }
      description = "string"
      enabled = bool
      evaluationFrequency = "string"
      scopes = [
        "string"
      ]
      severity = int
      targetResourceRegion = "string"
      targetResourceType = "string"
      windowSize = "string"
    }
  })
}

MetricAlertCriteria 物件

設定 odata.type 屬性以指定物件的類型。

針對 Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria,請使用:

  odata.type = "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria"
  allOf = [
    {
      dimensions = [
        {
          name = "string"
          operator = "string"
          values = [
            "string"
          ]
        }
      ]
      metricName = "string"
      metricNamespace = "string"
      name = "string"
      skipMetricValidation = bool
      timeAggregation = "string"
      criterionType = "string"
      // For remaining properties, see MultiMetricCriteria objects
    }
  ]

針對 Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria,請使用:

  odata.type = "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria"
  allOf = [
    {
      criterionType = "string"
      dimensions = [
        {
          name = "string"
          operator = "string"
          values = [
            "string"
          ]
        }
      ]
      metricName = "string"
      metricNamespace = "string"
      name = "string"
      operator = "string"
      skipMetricValidation = bool
      threshold = int
      timeAggregation = "string"
    }
  ]

針對 Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria,請使用:

  odata.type = "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria"
  componentId = "string"
  failedLocationCount = int
  webTestId = "string"

MultiMetricCriteria 物件

設定 criterionType 屬性以指定物件的類型。

針對 DynamicThresholdCriterion,請使用:

  criterionType = "DynamicThresholdCriterion"
  alertSensitivity = "string"
  failingPeriods = {
    minFailingPeriodsToAlert = int
    numberOfEvaluationPeriods = int
  }
  ignoreDataBefore = "string"
  operator = "string"

針對 StaticThresholdCriterion,請使用:

  criterionType = "StaticThresholdCriterion"
  operator = "string"
  threshold = int

屬性值

metricAlerts

名稱 描述
類型 資源類型 “Microsoft.Insights/metricAlerts@2018-03-01”
NAME 資源名稱 字串 (必要)

字元限制:1-260

合法字元:
不能使用:
*#&+:<>?@%{}\/ 或控制字元

不能以空格或句號結尾。
location 資源位置 字串 (必要)
parent_id 若要部署至資源群組,請使用該資源群組的標識碼。 字串 (必要)
tags 資源標籤 標記名稱和值的字典。
properties 資源的警示規則屬性。 MetricAlertProperties (必要)

MetricAlertProperties

名稱 描述
動作 當警示規則變成作用中時,以及解決警示條件時所執行的動作陣列。 MetricAlertAction[]
autoMitigate 指出是否應該自動解決警示的旗標。 預設值是 true。 bool
準則 定義特定的警示準則資訊。 MetricAlertCriteria (必要)
description 將包含在警示電子郵件中的計量警示描述。 字串
已啟用 指出是否啟用計量警示的旗標。 bool (必要)
evaluationFrequency 以 ISO 8601 持續時間格式來評估計量警示的頻率。 字串 (必要)
範圍 此計量警示的範圍為的資源標識符清單。 string[] (必要)
嚴重程度 警示嚴重性 {0, 1, 2, 3, 4} int (必要)
targetResourceRegion 建立/更新警示的目標資源 () 區域。 如果範圍包含訂用帳戶、資源群組或多個資源,則為必要。 字串
targetResourceType 建立/更新警示的目標資源 () 的資源類型。 如果範圍包含訂用帳戶、資源群組或多個資源,則為必要。 字串
windowSize ISO 8601 持續時間格式 (期間) ,用來根據閾值監視警示活動。 字串 (必要)

MetricAlertAction

名稱 描述
actionGroupId 要使用的動作群組標識碼。 字串
webHookProperties 此欄位允許指定自定義屬性,這會附加至傳送為 Webhook 輸入的警示承載。 物件 (object)

MetricAlertCriteria

名稱 描述
odata.type 設定物件類型 Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria
Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria
Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria (必要)

MetricAlertMultipleResourceMultipleMetricCriteria

名稱 描述
odata.type 會指定警示準則的類型。 “Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria” (必要)
allOf 此「全部」作業的多個計量準則清單。 MultiMetricCriteria[]

MultiMetricCriteria

名稱 描述
dimensions 維度條件的清單。 MetricDimension[]
metricName 計量的名稱。 需要字串 ()
metricNamespace 計量的命名空間。 字串
NAME 準則的名稱。 需要字串 ()
skipMetricValidation 藉由導致略過計量驗證,允許針對尚未發出的自訂計量建立警示規則。 bool
timeAggregation 準則時間匯總類型。 “Average”
“Count”
“最大值”
“最小值”
“Total” (必要)
criterionType 設定物件類型 DynamicThresholdCriterion
StaticThresholdCriterion (必要)

MetricDimension

名稱 描述
NAME 維度的名稱。 需要字串 ()
! 運算子之後 維度運算子。 僅支援 'Include' 和 'Exclude' 需要字串 ()
維度值的清單。 string[] (必要)

DynamicMetricCriteria

名稱 描述
criterionType 指定臨界值準則的類型 “DynamicThresholdCriterion” (必要)
alertSensitivity 觸發警示所需的偏差範圍。 這會影響臨界值與計量系列模式的緊密程度。 "High"
"Low"
“Medium” (必要)
failingPeriods 在引發警示所需的所選回溯時間範圍內,所需的違規次數下限。 需要 DynamicThresholdFailingPeriods ()
ignoreDataBefore 使用此選項可設定開始學習計量歷程記錄數據的日期,並以ISO8601格式計算動態閾值 () 字串
! 運算子之後 用來比較計量值與閾值的運算符。 “GreaterOrLessThan”
“GreaterThan”
“LessThan” (必要)

DynamicThresholdFailingPeriods

名稱 描述
minFailingPeriodsToAlert 觸發警示的違規次數。 應小於或等於 numberOfEvaluationPeriods。 需要 int ()
numberOfEvaluationPeriods 匯總回溯點的數目。 回溯時間範圍是根據匯總數據粒度計算, (windowSize) 和選取的匯總點數目。 需要 int ()

MetricCriteria

名稱 描述
criterionType 指定臨界值準則的類型 “DynamicThresholdCriterion”
“StaticThresholdCriterion” (必要)
dimensions 維度條件的清單。 MetricDimension[]
metricName 計量的名稱。 字串 (必要)
metricNamespace 計量的命名空間。 字串
NAME 準則的名稱。 字串 (必要)
! 運算子之後 criteria 運算子。 “Equals”
“GreaterThan”
“GreaterThanOrEqual”
“LessThan”
必要 (“LessThanOrEqual”)
skipMetricValidation 藉由導致略過計量驗證,允許針對尚未發出的自訂計量建立警示規則。 bool
threshold 啟動警示的準則臨界值。 int (必要)
timeAggregation 準則時間匯總類型。 “Average”
“Count”
“最大值”
“Minimum”
「總計」 (必要)

MetricAlertSingleResourceMultipleMetricCriteria

名稱 描述
odata.type 指定警示準則的類型。 “Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria” (必要)
allOf 此「全部」作業的計量準則清單。 MetricCriteria[]

WebtestLocationAvailabilityCriteria

名稱 描述
odata.type 指定警示準則的類型。 “Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria” (必要)
componentId Application Insights 資源標識符。 字串 (必要)
failedLocationCount 失敗的位置數目。 int (必要)
webTestId Application Insights Web 測試標識符。 字串 (必要)