The ALIYUN::CMS::GroupMetricRule resource creates an alert rule for an application group.
Syntax
{
"Type": "ALIYUN::CMS::GroupMetricRule",
"Properties": {
"NoEffectiveInterval": String,
"SilenceTime": Integer,
"Category": String,
"RuleId": String,
"Dimensions": String,
"Period": Integer,
"EffectiveInterval": String,
"Namespace": String,
"GroupId": String,
"MetricName": String,
"Escalations": Map,
"EmailSubject": String,
"Webhook": String,
"RuleName": String,
"Interval": Integer,
"NoDataPolicy": String,
"ExtraDimensionJson": Map,
"Options": String,
"ContactGroups": List
}
}Properties
Parameter | Type | Required | Updates allowed | Description | Constraints |
Category | String | Yes | No | The abbreviation of the Alibaba Cloud service name. | Valid values:
Note CloudMonitor continuously adds support for more services, so this list may not be exhaustive. |
Escalations | Map | Yes | Yes | The alert settings. | For more information, see Escalations properties. |
GroupId | String | Yes | Yes | The ID of the application group. | None. |
MetricName | String | Yes | Yes | The name of the metric. For more information, see DescribeMetricMetaList or Major metrics of Alibaba Cloud services. | None. |
Namespace | String | Yes | No | The namespace of the service. For more information, see DescribeMetricMetaList or Major metrics of Alibaba Cloud services. | None. |
RuleId | String | Yes | No | The ID of the alert rule. | The caller must generate this ID to ensure it is unique. |
RuleName | String | Yes | Yes | The name of the alert rule. | None. |
ContactGroups | List | No | Yes | The alert contact groups. | You can specify a maximum of 200 contacts. |
Dimensions | String | No | Yes | The extended resource dimensions. | By default, an alert rule for an application group applies to all instances within that group. Use this parameter to specify additional resource dimensions. For example, to monitor the disk usage of the root partition for all instances in the group, you can set this parameter to |
EffectiveInterval | String | No | Yes | The time period when the alert rule is active. | None. |
EmailSubject | String | No | Yes | The subject of the alert notification email. | None. |
ExtraDimensionJson | Map | No | Yes | The secondary or tertiary dimensions of the alert rule. | Format: A collection of key-value pairs in the If the primary dimension of an alert rule is |
Interval | Integer | No | Yes | The interval at which to check the alert rule. The default value is the minimum polling frequency of the metric. | Unit: seconds. We recommend setting this interval to the same value as the data reporting period. If the check interval is shorter than the reporting period, alerts may not be triggered due to insufficient data. |
NoDataPolicy | String | No | Yes | The method to handle alerts when no monitoring data is available. | Valid values:
|
NoEffectiveInterval | String | No | Yes | The time period when the alert rule is inactive. | None. |
Options | String | No | Yes | Advanced settings. | Specifies advanced settings in JSON format: |
Period | Integer | No | Yes | The aggregation period for the metric data. | The value must be 60 or an integer multiple of 60. Unit: seconds. Default value: 300. Note For a period of 300 seconds, the system aggregates raw data from a 5-minute window into a single data point for evaluation, based on the specified statistics method. For example, if data is reported every minute, the system averages the five data points within the period. |
SilenceTime | Integer | No | Yes | The duration of the silence time. If an alert is triggered, no new notifications are sent until the silence time ends. | Unit: seconds. Minimum value: 3600 (1 hour). Default value: 86400 (1 day). |
Webhook | String | No | Yes | The webhook URL to which CloudMonitor sends a notification when an alert is triggered. | None. |
Escalations syntax
"Escalations": {
"Critical": Map,
"Info": Map,
"Warn": Map
}Escalations properties
Parameter | Type | Required | Updates allowed | Description | Constraints |
Critical | Map | No | Yes | The settings for Critical-level alerts. | For more information, see Critical properties. |
Info | Map | No | Yes | The settings for Info-level alerts. | For more information, see Info properties. |
Warn | Map | No | Yes | The settings for Warn-level alerts. | For more information, see Warn properties. |
Critical syntax
"Critical": {
"ComparisonOperator": String,
"Times": Integer,
"Statistics": String,
"Threshold": Integer
}Critical properties
Parameter | Type | Required | Updates allowed | Description | Constraints |
ComparisonOperator | String | Yes | Yes | The operator for comparing the metric value to the threshold. | Valid values:
|
Statistics | String | Yes | Yes | The statistics method. | For valid values of the statistics method for each severity, see DescribeSystemEventMetaList. |
Times | Integer | Yes | Yes | The number of consecutive times the metric value must meet the alert condition to trigger an alert. | None. |
Threshold | Integer | Yes | Yes | The alert threshold. | None. |
Info syntax
"Info": {
"ComparisonOperator": String,
"Times": Integer,
"Statistics": String,
"Threshold": Integer
}Info properties
Parameter | Type | Required | Updates allowed | Description | Constraints |
ComparisonOperator | String | Yes | Yes | The operator for comparing the metric value to the threshold. | Valid values:
|
Statistics | String | Yes | Yes | The statistics method. | For valid values of the statistics method for each severity, see DescribeSystemEventMetaList. |
Threshold | Integer | Yes | Yes | The alert threshold. | None. |
Times | Integer | Yes | Yes | The number of consecutive times the metric value must meet the alert condition to trigger an alert. | None. |
Warn syntax
"Warn": {
"ComparisonOperator": String,
"Times": Integer,
"Statistics": String,
"Threshold": Integer
}Warn properties
Parameter | Type | Required | Updates allowed | Description | Constraints |
ComparisonOperator | String | Yes | Yes | The operator for comparing the metric value to the threshold. | Valid values:
|
Statistics | String | Yes | Yes | The statistics method. | For valid values of the statistics method for each severity, see DescribeSystemEventMetaList. |
Threshold | Integer | Yes | Yes | The alert threshold. | None. |
Times | Integer | Yes | Yes | The number of consecutive times the metric value must meet the alert condition to trigger an alert. | None. |
Return values
Fn::GetAtt
RuleId: The ID of the alert rule.
Examples
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
Category:
Type: String
Description: |-
The abbreviation of the Alibaba Cloud service name. Valid values:
ecs: Elastic Compute Service (ECS)
rds: ApsaraDB RDS
ads: AnalyticDB for MySQL
slb: Server Load Balancer (SLB)
vpc: Virtual Private Cloud (VPC)
apigateway: API Gateway
cdn: Alibaba Cloud CDN (CDN)
cs: Container Service for Kubernetes (ACK)
dcdn: Dynamic Content Delivery Network (DCDN)
ddos: Anti-DDoS Pro/Premium
eip: Elastic IP Address (EIP)
elasticsearch: Elasticsearch
emr: E-MapReduce (EMR)
ess: Auto Scaling
hbase: ApsaraDB for HBase
iot_edge: Link IoT Edge
k8s_pod: ACK pod
kvstore_sharding: Tair (Redis OSS-compatible) of the cluster architecture
kvstore_splitrw: Tair (Redis OSS-compatible) of the read/write splitting architecture
kvstore_standard: Tair (Redis OSS-compatible) of the standard architecture
memcache: ApsaraDB for Memcache (new version)
mongodb: ApsaraDB for MongoDB replica set instance
mongodb_cluster: ApsaraDB for MongoDB standalone instance
mongodb_sharding: ApsaraDB for MongoDB sharded cluster instance
mq_topic: Simple Message Queue (SMQ) topic
ocs: ApsaraDB for Memcache (original version)
opensearch: OpenSearch
oss: Object Storage Service (OSS)
polardb: PolarDB
petadata: HybridDB for MySQL
sharebandwidthpackages: Internet Shared Bandwidth
sls: Simple Log Service (SLS)
smq: Simple Message Queue (SMQ)
vpn: VPN Gateway
Default: ecs
RuleId:
Type: String
Description: The ID of the alert rule. This ID must be generated by the caller to ensure its uniqueness.
Default: uuid_aad57415dswer23124sfsg9***
Namespace:
Type: String
Description: |-
The data namespace of the service. For more information, call DescribeMetricMetaList
or see Major metrics of Alibaba Cloud services.
Default: acs_ecs_dashboard
GroupId:
Type: String
Description: The ID of the application group.
Default: 6102***
MetricName:
Type: String
Description: The name of the metric. For more information, call DescribeMetricMetaList or see Major metrics of Alibaba Cloud services.
Default: cpu_cores
Escalations:
Type: Json
Description: The alert settings.
Default:
Critical:
ComparisonOperator: GreaterThanOrEqualToThreshold
Times: 3
Statistics: Value
Threshold: '100'
RuleName:
Type: String
Description: The name of the alert rule.
Default: mytest
Resources:
GroupMetricRule:
Type: ALIYUN::CMS::GroupMetricRule
Properties:
Category:
Ref: Category
RuleId:
Ref: RuleId
Namespace:
Ref: Namespace
GroupId:
Ref: GroupId
MetricName:
Ref: MetricName
Escalations:
Ref: Escalations
RuleName:
Ref: RuleName
Outputs:
RuleId:
Description: The ID of the alert rule.
Value:
Fn::GetAtt:
- GroupMetricRule
- RuleId{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"Category": {
"Type": "String",
"Description": "The abbreviation of the Alibaba Cloud service name. Valid values:\necs: Elastic Compute Service (ECS)\nrds: ApsaraDB RDS\nads: AnalyticDB for MySQL\nslb: Server Load Balancer (SLB)\nvpc: Virtual Private Cloud (VPC)\napigateway: API Gateway\ncdn: Alibaba Cloud CDN (CDN)\ncs: Container Service for Kubernetes (ACK)\ndcdn: Dynamic Content Delivery Network (DCDN)\nddos: Anti-DDoS Pro/Premium\neip: Elastic IP Address (EIP)\nelasticsearch: Elasticsearch\nemr: E-MapReduce (EMR)\ness: Auto Scaling\nhbase: ApsaraDB for HBase\niot_edge: Link IoT Edge\nk8s_pod: ACK pod\nkvstore_sharding: Tair (Redis OSS-compatible) of the cluster architecture\nkvstore_splitrw: Tair (Redis OSS-compatible) of the read/write splitting architecture\nkvstore_standard: Tair (Redis OSS-compatible) of the standard architecture\nmemcache: ApsaraDB for Memcache (new version)\nmongodb: ApsaraDB for MongoDB replica set instance\nmongodb_cluster: ApsaraDB for MongoDB standalone instance\nmongodb_sharding: ApsaraDB for MongoDB sharded cluster instance\nmq_topic: Simple Message Queue (SMQ) topic\nocs: ApsaraDB for Memcache (original version)\nopensearch: OpenSearch\noss: Object Storage Service (OSS)\npolardb: PolarDB\npetadata: HybridDB for MySQL\nsharebandwidthpackages: Internet Shared Bandwidth\nsls: Simple Log Service (SLS)\nSMQ: Simple Message Queue (SMQ)\nvpn: VPN Gateway",
"Default": "ecs"
},
"RuleId": {
"Type": "String",
"Description": "The ID of the alert rule. This ID must be generated by the caller to ensure its uniqueness.",
"Default": "uuid_aad57415dswer23124sfsg9***"
},
"Namespace": {
"Type": "String",
"Description": "The data namespace of the service. For more information, call DescribeMetricMetaList or see Major metrics of Alibaba Cloud services.",
"Default": "acs_ecs_dashboard"
},
"GroupId": {
"Type": "String",
"Description": "The ID of the application group.",
"Default": "6102***"
},
"MetricName": {
"Type": "String",
"Description": "The name of the metric. For more information, call DescribeMetricMetaList or see Major metrics of Alibaba Cloud services.",
"Default": "cpu_cores"
},
"Escalations": {
"Type": "Json",
"Description": "The alert settings.",
"Default": {
"Critical": {
"ComparisonOperator": "GreaterThanOrEqualToThreshold",
"Times": 3,
"Statistics": "Value",
"Threshold": "100"
}
}
},
"RuleName": {
"Type": "String",
"Description": "The name of the alert rule.",
"Default": "mytest"
}
},
"Resources": {
"GroupMetricRule": {
"Type": "ALIYUN::CMS::GroupMetricRule",
"Properties": {
"Category": {
"Ref": "Category"
},
"RuleId": {
"Ref": "RuleId"
},
"Namespace": {
"Ref": "Namespace"
},
"GroupId": {
"Ref": "GroupId"
},
"MetricName": {
"Ref": "MetricName"
},
"Escalations": {
"Ref": "Escalations"
},
"RuleName": {
"Ref": "RuleName"
}
}
}
},
"Outputs": {
"RuleId": {
"Description": "The ID of the alert rule.",
"Value": {
"Fn::GetAtt": [
"GroupMetricRule",
"RuleId"
]
}
}
}
}