Category | Parameter | Description |
Basic information | Name | Specify a custom name for the alert template. The name must be unique. |
| Label | The global labels of the alert rule. They are mainly used for alert identification, grouping, deduplication, and route matching. A label consists of a key and a value.
tip When you configure multiple types of labels, the priorities of the labels are sorted in the following descending order: rule label > global label > PromQL label. |
Variable configuration | Variable types | Select the variable type. Valid values:
|
| Variable name | Configure the name and PromQL label for the variable.
tip
|
| Query statement | When you set the Variable type parameter to Query, you need to configure a PromQL query statement to obtain the variable value. Example: kube_node_info. |
| Match expression | When you set the Variable type parameter to Query, you need to configure a regular expression to obtain variable values. The system then obtains the variable values based on the Query statement and Match expression parameters. For example, you can use the /.*cluster="(.*?)".*/ expression to match any string in the PromQL statement that contains the cluster="any text" format, and capture the text between cluster=" and the closing " as a variable group. |
| Variable | When you set the Variable type parameter to Custom, enter the fixed values of the variable in the text box. The values can be separated by spaces. |
| Can select multiple variable values | Disabled by default. After you switch on this option, you can select multiple variable values when you select variables. |
| Add all selections | Disabled by default. After you switch on the "Add all selections" option, the variables include the All option, which allows you to select all variable values. |
Rule configuration | Rule name | Specify a name for the alert rule as a unique identifier. Duplicate names are not allowed. |
| PromQL | Use standard PromQL statements to configure monitoring objects or metrics. tip You can use $variable name in a PromQL statement to reference global variables. For example, if you have defined the cluster variable as Cluster, you can reference it by using node_cpu_seconds_total{cluster="$Cluster"}. |
| Trigger policy | Configure an alert trigger policy. You can specify the alert level, condition, threshold, and condition duration.
|
| Label | Configure the labels of the alert rule. Labels are primarily used for alert identification, grouping, deduplication, and route matching. A label consists of a key and a value.
tip When you configure multiple types of labels, the priorities of the labels are sorted in the following descending order: rule label > global label > PromQL label. Common configuration example: |
| Annotation | Configure the annotations for the alert rule. Annotations are primarily used to display key information. An annotation consists of a key and a value. Valid values:
Common configuration example: |
button, select Actions, and perform the corresponding operation. Use the import/export feature to import VMP alert templates exported from other regions into the current region for use.Actions | Description |
Export selected VMP templates | Exports the templates selected in the VMP alert template list to a local JSON file. tip
|
Export all VMP templates that meet search criteria | Export all VMP alert templates that meet the filter criteria to a local JSON file. The export is not affected by pagination. You can filter data by name. |
Import a JSON file to generate a VMP template | By using JSON files, you can import VMP alert templates exported from another account into the VMP alert template module of the current account for use. The import process allows you to configure the region and a name suffix. warning Only alert templates of the same type can be imported. For example, you can export a VMP alert template from account A and import it into account B for use. However, VMP alert templates cannot be imported into the Cloud Monitor template module. |