Updated on 2026-07-29 GMT+08:00

Managing Prometheus Monitoring Alarm Templates

Prometheus monitoring alarm templates are a group of alarm rule templates. AOM provides Prometheus monitoring alarm templates. You can associate these templates with Prometheus instances and clusters in batches for quickly creating alarm rules. AOM provides multiple default Prometheus monitoring alarm templates, and also allows you to create custom alarm templates.

Constraints

You can create up to 150 alarm templates. If the number of alarm templates reaches 150, delete unnecessary templates and create new ones.

Background

AOM provides multiple default template groups, each of which contains multiple Prometheus monitoring alarm templates. These templates are displayed on the Default tab page under Alarm Templates > Prometheus Monitoring.

Creating a Custom Template Group for Prometheus Monitoring

  1. Log in to the AOM 2.0 console.
  2. In the navigation pane, choose Alarm Center > Alarm Templates.
  3. On the Alarm Templates page, create a custom template group for Prometheus monitoring in either of the following ways:

  4. Set the basic information about an alarm template group. Table 1 describes the parameters.

    Table 1 Alarm template group parameters

    Parameter

    Description

    Group Name

    Name of an alarm template group.

    Enter a maximum of 100 characters. Only letters, digits, underscores (_), and hyphens (-) are allowed. Do not start or end with a special character.

    Enterprise Project

    Enterprise project.

    • If Enterprise Project is set to All on the global settings page, select an enterprise project from the drop-down list here.
    • If you have already selected an enterprise project on the global settings page, this option will be grayed and cannot be changed.
    • To select the newly created enterprise project during the creation of an alarm message template, wait for about 10 minutes after the enterprise project is created.

    Description (Optional)

    Description of the template group. Enter up to 1,024 characters.

    Variable

    Variables are used in the query statements of alarm templates. Example: cpu_usage{clusterId='${clusterId}'}.

    Click Add Variable and set a variable key and value. A maximum of 50 variables can be added.

    Each variable key can contain a maximum of 32 characters. Only letters, digits, and underscores (_) are allowed. Each variable value can contain a maximum of 1,024 characters.

  5. Click Confirm.

    After a custom template group is created, you can perform the following operations on the template group if needed.

    Table 2 Related operations

    Operation

    Description

    Create a template

    Create an alarm rule template for a custom template group.

    Select the target template group and click Create Template in the alarm rule template area to create a template. For details, see Creating a Custom Alarm Rule Template for Prometheus Monitoring. (Custom templates cannot be created under default alarm template groups.)

    Apply a template group

    Associate alarm rule templates in a default or custom template group in batches with Prometheus instances and clusters.

    Select the target template group and click Apply in the displayed dialog box. For details, see Applying the Alarm Rule Templates in a Prometheus Monitoring Template Group.

    Copy

    The copied template group is displayed on the Custom tab page. You can modify the alarm rule templates in the template group.
    • To copy a default template group, click the Default tab under Prometheus Monitoring, select the template group to be copied in the Default Template Groups area and click Copy in the displayed dialog box. Then set the template group name, enterprise project, and description.
    • To copy a custom template group, click the Custom tab under Prometheus Monitoring, select the template group to be copied in the Custom Template Groups area, and choose More > Copy in the displayed dialog box. Then set the template group name, enterprise project, and description.

    Edit

    Edit a custom template group.

    In the Custom Template Groups area, select the target template group. In the displayed dialog box, choose More > Edit to edit the custom template group. (Default alarm template groups cannot be edited.)

    Delete

    Delete a custom template group.

    In the Custom Template Groups area, select the target template group. In the displayed dialog box, choose More > Delete to delete the custom template group. (Default alarm template groups cannot be deleted.)

    Export

    Export a custom template group file. To reuse the alarm rule templates in a custom template group in other regions or by other users, export the template group file and then import it.

    Select the target template group. In the displayed dialog box, click Export to export a JSON file.

    Import

    Import a template group file. To reuse alarm rule templates in other regions or by other users, export the template group file and then import it.

    In the Default Template Groups or Custom Template Groups area, click and configure the following information:
    1. Group Name: Enter a maximum of 100 characters and do not start or end with an underscore (_) or hyphen (-). Only letters, digits, underscores, and hyphens are allowed.
    2. Enterprise Project: Select an enterprise project from the drop-down list.
    3. Upload the exported JSON file or drag it to the upload area.
    4. Click OK.

Creating a Custom Alarm Rule Template for Prometheus Monitoring

  1. Log in to the AOM 2.0 console.
  2. In the navigation pane, choose Alarm Center > Alarm Templates.
  3. Switch to the Custom tab under Prometheus Monitoring and select the target template group.
  4. In the Alarm Rule Templates area, click Create Template. On the displayed page, configure basic information about the alarm rule template. Table 3 describes the parameters.

    Table 3 Basic information

    Parameter

    Description

    Template Name

    Alarm rule template name. Enter a maximum of 256 characters. Only letters, digits, underscores (_), and hyphens (-) are allowed. Do not start or end with an underscore or hyphen.

    Description

    Description of the alarm rule template. Enter a maximum of 1,024 characters.

  5. Set the details and advanced settings of the alarm template rule.

  6. Click OK.

    After a custom alarm rule template is created, you can perform the following operations in the Alarm Rule Templates area if needed.
    Table 4 Related operations

    Operation

    Description

    Viewing alarm rule templates

    View alarm rule templates in a default or custom template group.

    Select a template group. In the Alarm Rule Templates area, filter alarm rule templates by the number of associated alarms, template name, or other criteria.

    Setting the alarm rule template list

    Click in the upper right corner of the list. In the displayed dialog box, set column display.
    • Basic settings
      • Table Text Wrapping: This feature is enabled by default. If you enable this feature, excess text will move down to the next line; otherwise, the text will be truncated.
      • Data Columns: You can select Freeze none, Freeze first, or Freeze first two.
      • Operation Column: Select Freeze. Then the operation column will always be in the last column and visible.
    • Custom Columns: Select or deselect the columns to display.

    Applying templates

    Associate multiple alarm rule templates in a default or custom template group with Prometheus instances and clusters.

    Select a template group. In the Alarm Rule Templates area, select one or more alarm rule templates and click Apply Template above the template list. For details, see Applying the Alarm Rule Templates in a Prometheus Monitoring Template Group.

    Applying a template

    Associate an alarm rule template in a default or custom template group with a Prometheus instance and cluster.

    Select a template group. In the Alarm Rule Templates area, locate a target alarm rule template and click Apply in the Operation column. For details, see Applying the Alarm Rule Templates in a Prometheus Monitoring Template Group.

    Copying a template

    Copy an alarm rule template in a custom template group.

    Select a template group. In the Alarm Rule Templates area, locate a target alarm rule template and choose More > Copy in the Operation column.

    Deleting a template

    Delete an alarm rule template in a custom template group.

    • Select a template group. In the alarm rule template area, select one or more templates and click Delete Template above the template list.
    • Select a template group. In the Alarm Rule Templates area, locate a target alarm rule template and choose More > Delete in the Operation column.

    Edit

    Edit an alarm rule template in a custom template group.

    Select a template group. In the Alarm Rule Templates area, locate a target alarm rule template and click Edit in the Operation column.

Applying the Alarm Rule Templates in a Prometheus Monitoring Template Group

  1. Log in to the AOM 2.0 console.
  2. In the navigation pane, choose Alarm Center > Alarm Templates.
  3. Switch to the Default or Custom tab under Prometheus Monitoring.

    • Applying a template group: In the Default Template Groups or Custom Template Groups area, select the target template group, click Apply, and then configure the alarm template information. In this way, all alarm rule templates in the template group can be associated with Prometheus instances and clusters.
    • Applying templates in batches: In the Default Template Groups or Custom Template Groups area, select a template group. Then in the Alarm Rule Templates area, select multiple templates to be used, click Apply Template above the list, and then configure the alarm template information. In this way, multiple alarm rule templates in the template group can be associated with Prometheus instances and clusters in batches.
    • Applying a template: In the Default Template Groups or Custom Template Groups area, select a template group, locate an alarm rule template in the Alarm Rule Templates area, click Apply in the Operation column, and then configure the alarm template information. In this way, the alarm rule template in the template group can be associated with a Prometheus instance and cluster.

  4. Configure the information for applying an alarm template. Table 5 describes the parameters.

    Table 5 Parameters for applying an alarm template

    Parameter

    Description

    Prometheus Instance

    Select a target Prometheus instance from the drop-down list. Alarm rule templates in template groups (except CCE template groups) can be associated with Prometheus instances.

    • Unbinding Prometheus instances will delete their alarm rules.
    • Alarm rules will be created, modified, and deleted based on the Prometheus instance and cluster you selected. Each original rule name must be: {Alarm rule template name}_{Alarm rule template group name}_{Prometheus instance/Cluster ID}_{36-bit random number}.

    Cluster

    Select the CCE cluster to be associated from the drop-down list. Only alarm rule templates in CCE template groups can be associated with CCE clusters.

    • Unbinding clusters will delete their alarm rules.
    • Alarm rules will be created, modified, and deleted based on the Prometheus instance and cluster you selected. Each original rule name must be: {Alarm rule template name}_{Alarm rule template group name}_{Prometheus instance/Cluster ID}_{36-bit random number}.
    • To associate an alarm rule template with a CCE cluster, obtain the CCE permissions in advance. For details, see Permissions.

    Enterprise Project

    Select an enterprise project. Your settings here are applicable only to new rules.

    Update Alarm Rules

    Whether to update the alarm rules associated with the template.
    • Enable: The existing alarm rules associated with the alarm template will be updated. This function is enabled by default.
    • Disable: The existing alarm rules associated with the alarm template will not be updated.

    Notify When

    Set the scenario for sending alarm notifications.

    • Alarm triggered: If the alarm trigger condition is met, the system sends an alarm notification to the specified personnel by email or SMS.
    • Alarm cleared: If the alarm clearance condition is met, the system sends an alarm notification to the specified personnel by email or SMS.

    Alarm Mode

    • Direct alarm reporting: An alarm is directly sent when the alarm condition is met. If you select this mode, set the notification frequency and specify whether to enable Notification Rule.
    • Alarm noise reduction: Alarms are sent only after being processed based on noise reduction rules, preventing alarm storms. If you select this mode, specify whether to enable Grouping Rule.

    Frequency

    Set the frequency for sending alarm notifications.

    Notification Rule

    Enable Notification Rule and select a notification rule. (If Notification Rule is disabled, the template cannot be used.) Then the system sends alarm notifications based on the associated SMN topic and message template. If the existing alarm notification rules cannot meet your requirements, create one by referring to Creating an AOM Alarm Notification Rule.

    Grouping Rule

    After this function is enabled, select a grouping rule from the drop-down list. Select a grouping rule name from the drop-down list. (The grouping rule name is the display name you set when creating the rule.) If existing grouping rules cannot meet your requirements, create one by referring to Creating an AOM Alarm Grouping Rule.

  5. Click Confirm.