Platform Alerts
CloudBase platform alerting is built on Tencent Cloud Observability Platform (TCOP)'s alarm policy system. It automatically triggers alert notifications when resources in your CloudBase environment experience anomalies (e.g., elevated Cloud Function error rates, surging database slow queries, CloudBase Run 5xx errors, etc.).
Via Generic Cloud API
Advanced operations related to platform alerts (such as creating/modifying/deleting alarm policies, querying alarm history, etc.) can be performed via Tencent Cloud Observability Platform API.
Refer to the Generic Cloud API documentation and use tcb api monitor <action> to call the following APIs:
- CreateAlarmPolicy (
CreateAlarmPolicy) - Other alarm-related APIs can be found in the Tencent Cloud Observability Platform API Documentation
Example: Create a CVM Alarm Policy
The following example creates a CVM monitoring alarm policy with both metric trigger conditions and event trigger conditions, and binds notification rules and trigger tasks:
tcb api monitor CreateAlarmPolicy \
--version 2018-07-24 \
--body '{
"Module": "monitor",
"PolicyName": "云服务器告警策略",
"Remark": "这是一句备注",
"MonitorType": "MT_QCE",
"Enable": 1,
"ProjectId": 0,
"Namespace": "cvm_device",
"Condition": {
"IsUnionRule": 1,
"Rules": [
{
"MetricName": "CvmDiskUsage",
"Period": 60,
"Operator": "ge",
"Value": "99.9",
"ContinuePeriod": 1,
"NoticeFrequency": 3600,
"IsPowerNotice": 0
}
]
},
"EventCondition": {
"Rules": [
{
"MetricName": "ping_unreach"
}
]
},
"NoticeIds": [
"notice-bv9b4ghqbg",
"notice-gj2n9wnt29"
],
"TriggerTasks": [
{
"Type": "AS",
"TaskConfig": "{\"Region\":\"ap-guangzhou\",\"Group\":\"asg-0zhspjx\",\"Policy\":\"asp-ganig28\"}"
}
]
}'
For the full parameter definition, refer to the CreateAlarmPolicy API Documentation.