Rules #
Here you can create, delete, enable, and disable alarm rules.

Create alarm rules #

In the list of alarm rules, the process of adding an alarm rule is as follows:
- Associate instance and resource information.
- To add a rule to a rule group, you need to ensure that the rule group where the rule to be added exists already exists. If it does not exist, you need to create it.
- Configure the alarm application. Link with the alarm platform here, if it does not exist, you can click to create an alarm application.
- Alarm rules. Customize and add alarm rules. Examples are as follows:
[
{
"name":"up.rules",
"rules":[
{
"alert":"VM Component survival status analysis",
"expr":"up!=1",
"for":"5m",
"labels":{
"team":"tsdb",
"status":"Serious alarm",
"level":"1",
"appkey":"e7f30ece-b325-455e-bfcb-0e967a11caa6"
},
"annotations":{
"description":"{{ $labels.instance }}Unusual component status"
}
}
]
}
]
- Notification method. Select the corresponding alarm notification group, notifier, notification method and alarm level.
- Create an alarm rule.
Alarm rule access process of other platforms #
- Determine the instance ID, which can be viewed on the instance details page;
- Determine the resource
UUID, the unique identifier of the current resource in this platform that the user will return when accessing the platform; - To determine the alarm application, the user needs to go to the alarm platform to create an alarm application, obtain the
appkey, and then create an alarm rule on this platform, otherwise, the alarm data will be mistaken for dirty data and cleaned up when it is sent to the alarm platform; - Determine the alarm rule group;
- Determine the alarm rules;
The writing specification is as follows:
{
"instance_id": "ts_565082230750187520" ,
"uuid": "c950b2e6-9b53-11eb-b4f9-c28d0e0c8a10",
"groups": [
{
"name": "up.rules",
"rules": [
{
"alert": "VM Component Status Analysis",
"expr": "up!=1",
"for": "5m",
"labels": {
"team": "tsdb",
"level": "1",
"service": "Timing platform",
"appkey": "e7f30ece-b325-455e-bfcb-0e967a11caa6"
},
"annotations": {
"description": "{{ $labels.instance }}Component status is abnormal"
}
}
]
}
]
}