Help Center/ Application Operations Management/ Best Practices/ Creating an APM Alarm Rule and Configuring Alarm Notification
Updated on 2025-08-15 GMT+08:00

Creating an APM Alarm Rule and Configuring Alarm Notification

AOM allows you to create an APM alarm rule to monitor and manage key metrics in real time. In this way, you will be able to improve application performance and stability.

Scenario

O&M personnel of an e-commerce platform want to visualize key metrics to monitor the application health status in real time and then to ensure stable platform running and user experience.

Constraints

APM alarm rules are available only in AP-Singapore, CN-Hong Kong, CN East-Shanghai1, and CN East-Shanghai2.

Solution

  1. Connecting an Agent: Create an APM application and connect it to an Agent.
  2. Creating an APM Alarm Rule: Visualize key metrics to monitor the application health status in real time.

Connecting an Agent

AOM provides a unified entry for observability analysis of cloud services. Through the access center, you can create an APM application and connect it to an Agent to monitor its performance graphs and metrics.

  1. Log in to the AOM 2.0 console.
  2. In the navigation pane on the left, choose Access Center > Access Center to go to the new access center.

    If the old access center is displayed, click Try New Version in the upper right corner.

  3. Select the check box next to Components under Types to filter out component cards.
  4. Click Ingest Trace (APM) on the card to quickly ingest traces.

    In this example, an application named apmtest-performance has been created and an Agent has also been connected.
    Table 1 Connecting components to AOM

    Card

    Related Operations

    Java component

    Obtain the traces of a Java application. For details, see Ingesting Traces of Java Components (APM).

Creating an APM Alarm Rule

  1. In the navigation pane, choose Alarm Center > Alarm Rules.
  2. On the Prometheus Monitoring tab page, click Create Alarm Rule.
  3. Set basic information about the alarm rule by referring to Table 2.

    Table 2 Basic information

    Parameter

    Description

    Example Value

    Original Rule Name

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

    apm-rule

    Rule Name

    Rule name. Enter a maximum of 256 characters and do not start or end with an underscore (_) or hyphen (-). Only letters, digits, underscores, and hyphens are allowed. In this example, leave this parameter blank.

    -

    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.

    default

    Description

    Description of the rule. Enter up to 1,024 characters. In this example, leave this parameter blank.

    -

  4. Set parameters about the alarm rule.

    1. Set Rule Type to APM rule.
    2. Specify Select from all metrics for Configuration Mode.
    3. Select an application and metric type. Select apmtest-performance (created in Connecting an Agent) for Application and select JVMInfo and info for Metric Type.
      Figure 1 Metric source

  5. Set the detailed information about the alarm rule. Table 3 describes the parameters.

    In this example, select the apm_JVMInfo_info_availableProcessors_ORIGIN metric.
    Table 3 Alarm rule details

    Parameter

    Description

    Example Value

    Multiple Metrics

    The system performs calculation based on the configured metrics and alarm conditions. There are two scenarios:

    • Triggered if all conditions are met: An alarm is triggered if all metric conditions are met.
    • Triggered if any condition is met: An alarm is triggered if any of metric conditions is met.

    Triggered if any condition is met

    Metric

    Metric to be monitored. Click the Metric text box. In the resource tree on the right, you can select a target metric by resource type.

    apm_JVMInfo_info_availableProcessors_ORIGIN

    Conditions

    Metric monitoring scope. When creating an APM alarm rule, you need to set the _businessName (application), _appName (component), and _envName (environment) dimensions for your metric.

    _businessName: test-grid

    _appName: apmtest-performance

    _envName: default

    Grouping Condition

    Aggregate metric data by the specified field and calculate the aggregation result.

    Not grouped

    Rule

    The detection rule consists of the statistical mode (Avg, Min, Max, Sum, and Samples), determination criterion (, , >, and <), and threshold value.

    Avg > 1

    Statistical Period

    Interval at which metric data is collected.

    1 minute

    Trigger Condition

    When the metric value meets the alarm condition for a specified number of consecutive periods, a metric alarm will be generated. For Consecutive Periods, the value ranges from 1 to 30. This parameter is displayed only when you select Triggered if any condition is met.

    3

    Alarm Severity

    Severity of a metric alarm.

    (Critical)

  6. Click Advanced Settings and set information such as Check Interval and Alarm Clearance. For details about the parameters, see Table 4.

    Table 4 Advanced settings

    Parameter

    Description

    Example Value

    Check Interval

    Interval at which metric query and analysis results are checked.

    Custom interval: 1 minute

    Alarm Clearance

    The alarm will be cleared when the alarm condition is not met for a specified number of consecutive periods.

    1

    Action Taken for Insufficient Data

    Action to be taken when no metric data is generated or metric data is insufficient for a specified number of consecutive periods. You can set this option based on your requirements.

    Disabled

    Tags

    Click to add tags for alarm rules. They will be synchronized to Tag Management Service (TMS). They can be used to filter alarm rules and group alarms to reduce noise. They can also be referenced as "${event.metadata.tag key}" in message templates. In this example, leave this parameter blank.

    -

    Annotations

    Click to add attributes (key-value pairs) for alarm rules. Annotations will not be synchronized to TMS, but can be used to group alarms to reduce noise and referenced as "${event.annotations.annotation key}" in message templates. In this example, leave this parameter blank.

    -

  7. Set an alarm notification policy. For details, see Table 5.

    Figure 2 Setting an alarm notification policy
    Table 5 Alarm notification policy parameters

    Parameter

    Description

    Example Value

    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 triggered

    Alarm cleared

    Alarm Mode

    • Direct alarm reporting: An alarm is directly sent when the alarm condition is met. If you select this mode, set an interval for notification and specify whether to enable a notification rule.
    • Frequency: interval for sending alarm notifications. Select a desired value from the drop-down list.
    • Notification Rule: After the rule is enabled, the system sends notifications based on the associated SMN topic and message template. If there is no alarm notification rule you want to select, click Add Rule in the drop-down list to create one. For details about how to set alarm notification rules, see Creating an AOM Alarm Notification Rule.

    Alarm Mode: Select Direct alarm reporting.

    Frequency: Select Once.

    Notification Rule: Enter 01.

    Notification Template

    Template for sending alarm notifications. You can use variables (that is, dimensions) in a notification template. The format is "${Dimension}". You can click Insert Variable Symbol to add ${}.

    • Inserting a variable: Hover the cursor over a variable under Variables Preview and click Insert to insert the variable to the notification template.
    • Copying a variable: Hover the cursor over a variable under Variables Preview and click Copy to copy the variable.
    • Viewing preset variables: The system provides preset variables.

    ${hostInfo}${envPath}

  8. Click Confirm. Then click View Rule to view the created rule.

    If a metric value meets the configured alarm condition, an APM alarm is generated on the alarm list page. To view the alarm, choose Alarm Center > Alarm List in the navigation pane. If the preset notification policy is met, the system sends an alarm notification to the specified personnel by email or SMS.