You need to enable JavaScript to run this app.
Observability Platform

Observability Platform

Copy page
Download PDF
VMP alert configuration
Creating VMP alert templates
Copy page
Download PDF
Creating VMP alert templates
In addition to the preset alerting rule templates provided by the system, you can also create custom alerting rule templates based on your business requirements to quickly configure alerting rules for cloud services. This topic describes how to create a custom alerting rule template.​
Procedure​
​
Method 1: Create an alert template
Method 2: Import or export alert templates via JSON
​
You can create an alert template from scratch in the console by configuring information such as the query statement, match expression, and PromQL in sequence. After you save the template, you can reuse it to quickly create alert rules. Applicable to scenarios that require personalized configurations or the establishment of standard templates.​
  1. In the left navigation pane, click Alert Center > Alert Configuration to go to the Alert Configuration management page.​
  1. In the Alert Configuration section on the left, select VMP and click the Alert Template tab.​
  1. Click Create alert template and configure the relevant parameters for the VMP alert template as needed. After completion, click Submit.​
  • ​
    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. ​
    • Key: The key is a string. It can start with a letter or an underscore (_), but cannot start with a double underscore (__). Allows 1–256 characters, which can contain letters, digits, and underscores (_).​
    • Value: The value is a string. It can contain Chinese characters, letters, digits, and special characters and must be 1 to 512 characters in length.​
    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:​
    • Query: the dynamic PromQL variable. You can only define the name, not the value, for this type of variable. For example, cluster metrics such as cluster IDs and namespaces always have values generated dynamically. The values of dynamic variables can be obtained by specifying PromQL statements and regular expressions.​
    • Custom: a type of variables that have predefined values. For example, in cluster metrics, the workload type is fixed (such as Deployment, StatefulSet, DaemonSet) and can be directly specified.​
    ​
    Variable name​
    Configure the name and PromQL label for the variable.​
    • Variable name: Match the specific label in the PromQL statement. The variable name can contain uppercase and lowercase letters and digits and must be 1 to 32 characters in length.​
    • Label: Describe the meaning and purpose of the variable, which is displayed in the console for users to understand. The label can contain Chinese characters, uppercase and lowercase letters, digits, and special characters and must be 1 to 20 characters in length.​
    tip​
    • Variables are used for more fine-grained filtering of cloud service resources in monitoring data. For example, in Volcengine Kubernetes Engine (VKE), you can select a VKE cluster or namespace by using variables.​
    • A variable name needs to start with an uppercase letter and use CamelCase convention. For example, ClusterNode.​
    ​
    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.​
    • Alert level: Select P0, P1, or P2 to set different alert levels. If you do not select an option, alerts at this level are not configured.​
    • Comparison condition: Specify the comparison condition between the PromQL statement and the threshold. You can configure multiple comparison conditions. Valid values: Greater than, Greater than or equal to, Less than, Less than or equal to, Equal to, and Not equal to.​
    • Threshold: Set the threshold of the metric.​
    • Condition duration: Configures the duration for which the metric meets the condition. Valid values:​
    • Trigger immediately: An alert is triggered immediately when the alert condition is met.​
    • Custom duration: Select an alert trigger time. Available options include 1 minute, 2 minutes, 5 minutes, 10 minutes, 20 minutes, 30 minutes, 1 hour, 3 hours, 6 hours, and 12 hours. For example, 1 minute means that the alert will be triggered after the condition has been met for 1 minute.​
    ​
    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. ​
    • Key: The key is a string. It can start with a letter or an underscore (_), but cannot start with a double underscore (__). Allows 1–256 characters, which can contain letters, digits, and underscores (_).​
    • Value: The value is a string. It can contain Chinese characters, letters, digits, and special characters and must be 1 to 512 characters in length.​
    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:​
    ​
    labels:​
    severity: critical # Alert level​
    business: pay # Business line​
    alert_type: resource # Alert type​
    ​
    ​
    ​
    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:​
    • Key: The key is a string. It can start with a letter or an underscore (_), but cannot start with a double underscore (__). Allows 1–256 characters, which can contain letters, digits, and underscores (_).​
    • Value: The value is a string. It can contain Chinese characters, letters, digits, and special characters and must be 1 to 512 characters in length.​
    Common configuration example:​
    ​
    annotations:​
    summary: "High CPU usage on instance {{ $labels.instance }}"​
    description: "Current CPU usage is {{ $value | humanizePercentage }}, threshold is 80%"​
    runbook_url: "https://xxx/docs/cpu-alert"​
    dashboard_url: "https://grafana/xxx"​
    ​
    ​
    ​
​
​
What to do next​
Configure the workspace, notification policy, and aggregation policy, and then apply the alert template. Based on the template, alert rules and one alert rule group are automatically generated to monitor resources. For detailed descriptions, see Creating VMP alert rule groups.​
Last updated: 2026.09.07 19:40:07