Create an alert rule

Updated at:

You can use Lindorm to create alert rules for key instance metrics. If a metric crosses a specified threshold, Lindorm automatically sends an alert to the designated alert group, helping you pinpoint issues quickly. This topic shows you how to create an alert rule in both the Lindorm console and the CloudMonitor console.

Lindorm supports the following three ways to create alert rules:

Prerequisites

Limitations

Only Lindorm V1 and Lindorm instances support creating alert rules. To see if your instance is eligible, you can view the instance type on the console.

Create a global alert rule (ARMS console)

These alert rules apply to all Lindorm instances under your Alibaba Cloud account.

Important
  • If you use a RAM user to view monitoring information on the Lindorm console for the first time, the page might be blank. This indicates that you lack the required permissions. You must first use your Alibaba Cloud account to enable Managed Service for Prometheus. For instructions, see Grant monitoring permissions.

  • The ARMS service is free of charge.

Grant monitoring permissions

  1. Grant the AliyunARMSReadOnlyAccess permission to the RAM user. For more information, see Manage permissions for a RAM user.

  2. Log on to the ARMS console, and in the left navigation bar, select Prometheus Monitoring > Instances.

  3. Click Activate Now to enable Managed Service for Prometheus.

Create a global alert rule

  1. In the top navigation bar, select the China (Shanghai) region.

    Important

    The China (Shanghai) region consolidates monitoring data for Lindorm from all other regions. Therefore, to configure alert rules for all Lindorm instances under your Alibaba Cloud account, select the China (Shanghai) region.

  2. Log on to the ARMS console. In the left-side navigation pane, choose Prometheus Monitoring > Prometheus Alert Rules.

  3. On the Create Prometheus Alert Rule page, configure the following parameters:

    Static threshold

    Parameter

    Description

    Alert name

    The name of the alert rule.

    Detection type

    Select static threshold.

    Prometheus instance

    Select cloud-product-prometheus_cn-shanghai and Lindorm.

    Alert group

    Select an alert group, such as an engine, system, or storage.

    Note

    Lindorm does not currently support selecting the default alert group.

    Alert metric

    Select the metric to monitor.

    Alert condition

    Define the conditions that trigger the alert.

    Filter Condition

    Define the scope of the alert rule based on the selected metric. An alert is triggered for resources that meet both the filter conditions and the alert rule.

    Data preview

    The Data Preview section displays the PromQL statement that corresponds to the alert condition and displays the monitored metric as a time series curve.

    By default, this section displays the real-time value of the alert metric for one instance. You can select other resources and time ranges to preview their data.

    Note
    • The alert threshold is displayed as a red horizontal line on the time series chart. The portion of the curve that exceeds the threshold is shown in dark red, while the rest is shown in a different color.

    • Hover over the time series curve to view resource details at a specific point in time.

    • Select a time range on the time series chart to zoom in on that period.

    Duration

    • If an alert condition is met, an alert event is triggered immediately: An alert event is triggered if any data point meets the threshold.

    • An alert event is triggered only after an alert condition persists for N minutes: An alert event is triggered only if the time that the threshold is met is greater than or equal to N minutes.

    Alert severity

    Select an alert severity level. The levels, from lowest to highest, are Default, P4, P3, P2, and P1.

    Alert content

    Configure the content of the alert notification. You can use Go Template syntax to define custom parameter variables.

    Alert notification

    Two modes are available: Simple and Normal.

    • Simple mode: Allows you to set notification recipients, notification periods, and alert re-notification policies.

    • Normal mode: Allows you to quickly specify an existing notification policy. You can also click New Notification Policy to create a new one. For more information, see Create a notification policy.

    Evaluation interval

    The interval at which the system evaluates the alert rule. The default and minimum value is 1 minute.

    Check after data is complete

    Specifies whether to perform the check only after the data is fully collected. The default value is Yes and typically does not need to be changed.

    Tags

    Set alert tags. These tags can be used as conditions in the matching rules of notification policies.

    Annotations

    Set annotations for the alert.

    Custom PromQL

    Parameter

    Description

    Alert name

    The name of the alert rule.

    Detection type

    Select Custom PromQL.

    Prometheus instance

    Select cloud-product-prometheus_cn-shanghai and Lindorm.

    Reference alert group

    Select an alert group, such as an engine, system, or storage.

    Note

    Lindorm does not currently support selecting the default alert group.

    Custom PromQL statement

    Use PromQL to define the alert expression.

    Data preview

    The Data preview section displays a time series chart of metrics from resources that match the PromQL expression.

    By default, this section displays data for instances that match the PromQL expression. You can use the filters in this section to select the target resource and time range.

    Note
    • Hover the mouse over the time series curve to view resource details for a specific data point.

    • Select a time range on the curve to view the time series for that period.

    Duration

    • If an alert condition is met, an alert event is triggered immediately: An alert event is triggered if any data point meets the threshold.

    • An alert event is triggered only after an alert condition persists for N minutes: An alert event is triggered only if the time that the threshold is met is greater than or equal to N minutes.

    Alert severity

    Select an alert severity level. The levels, from lowest to highest, are Default, P4, P3, P2, and P1.

    Alert content

    Configure the content of the alert notification. You can use Go Template syntax to define custom parameter variables.

    Alert notification

    Two modes are available: Simple and Normal.

    • Simple mode: Allows you to set notification recipients, notification periods, and alert re-notification policies.

    • Normal mode: Allows you to quickly specify an existing notification policy. You can also click New Notification Policy to create a new one. For more information, see Create a notification policy.

    Evaluation interval

    The interval at which the system evaluates the alert rule. The default and minimum value is 1 minute.

    Check after data is complete

    Specifies whether to perform the check only after the data is fully collected. The default value is Yes and typically does not need to be changed.

    Tags

    Set alert tags. These tags can be used as conditions in the matching rules of notification policies.

    Annotations

    Set annotations for the alert.

Create an instance-level alert rule

An alert rule created using this method applies only to the current instance.

  1. Log on to the Lindorm console. In the upper-left corner of the page, select the region of the instance. On the Instances page, click the ID of the target instance or click View Instance Details in the Actions column for the instance.

  2. In the left-side navigation pane, click Alerts to view the alert rules for the instance. On the Lindorm alert list page, you can view created alert rules and their status, and filter them by check type, alert group, and status.

  3. Click Create Lindorm Alert Rules.

  4. On the Create Lindorm Alert Rules page, configure the following parameters.

    Note

    The required parameters depend on the check type.

    Static threshold

    Parameter

    Description

    Alert name

    The name of the alert rule.

    Check type

    Select Static Threshold.

    Lindorm cluster

    The Lindorm instance for which to create the alert rule. This is the current instance.

    Alert group

    Select an alert group, such as a group for an engine, a system, or storage.

    For information about the recommended settings for each engine, see Best practices for alert rules.

    Alert metric

    From the drop-down list, select the metric for the alert rule.

    Alert condition

    Set the condition that triggers an alert event based on the selected alert metric.

    Filter condition

    Specifies conditions to filter which resources the alert rule applies to. An alert is triggered if a resource meets these filter conditions and the alert condition.

    Data preview

    The Data preview section plots the monitored metric on a time series curve.

    By default, this section displays real-time values for the alert metric. Use the filters in this section to view data for different time ranges or resources.

    Note
    • The alert threshold is displayed as a red line on the time series curve. The parts of the curve that breach the threshold are shown in dark red, and the other parts are displayed in different colors.

    • Hover over the time series curve to view resource details at a specific point in time.

    • On the time series curve, select a time range to zoom in.

    Duration

    • If an alert condition is met, an alert event is triggered immediately: An alert event is triggered if any data point meets the threshold.

    • An alert event is triggered only after an alert condition persists for N minutes: An alert event is triggered only if the time that the threshold is met is greater than or equal to N minutes.

    Alert level

    Customize the alert level. The severity levels, from lowest to highest, are Default, P4, P3, P2, and P1.

    Alert content

    Defines the content for alert notifications. You can use Go template syntax to include variables in the alert content.

    Alert notification

    Two modes are available: Simple Mode and Normal Mode.

    • Simple Mode: Set notification recipients, notification periods, and alert repeat policies.

    • Normal mode: You can quickly select an existing notification policy. You can also click New Notification Policy to create a new notification policy. For more information, see Create a notification policy.

    Check interval

    The frequency for evaluating the alert condition. The default and minimum value is 1 minute.

    Check after data is complete

    Specifies whether to evaluate the alert rule only after data collection is complete. The default value is Yes. The default setting is recommended for most use cases.

    Label

    Labels to attach to the alert rule. These labels can be used as matching criteria in notification policies.

    Annotation

    Annotations to attach to the alert rule.

    Custom PromQL

    Parameter

    Description

    Alert name

    The name of the alert rule.

    Check type

    Select Custom PromQL.

    Lindorm cluster

    The Lindorm instance for which to create the alert rule. This is the current instance.

    Reference alert group

    This option is not supported for Lindorm instances.

    Custom PromQL statement

    The PromQL expression that defines the alert condition.

    Data preview

    The Data Preview section plots the time series for metrics that match the PromQL expression.

    By default, this section displays data for all resources matching the PromQL expression. You can filter the view by selecting a specific resource or time range.

    Note
    • Hover the mouse over the time series curve to view resource details for a specific data point.

    • Select a time range on the curve to view the time series for that period.

    Duration

    • If an alert condition is met, an alert event is triggered immediately: An alert event is triggered if any data point meets the threshold.

    • An alert event is triggered only after an alert condition persists for N minutes: An alert event is triggered only if the time that the threshold is met is greater than or equal to N minutes.

    Alert level

    The severity of the alert. The levels, from lowest to highest, are Default, P4, P3, P2, and P1. The default level is Default.

    Alert content

    Defines the content for alert notifications. You can use Go template syntax to include variables in the alert content.

    Alert notification

    Two modes are available: Simple Mode and Normal Mode.

    • Simple Mode: Set notification recipients, notification periods, and alert repeat policies.

    • Normal mode: You can quickly specify an existing notification policy. You can also click New Notification Policy to create a new notification policy. For more information, see Create a notification policy.

    Check interval

    The frequency for evaluating the alert condition. The default and minimum value is 1 minute.

    Check after data is complete

    Specifies whether to evaluate the alert rule only after data collection is complete. The default value is Yes. The default setting is recommended for most use cases.

    Label

    Labels to attach to the alert rule. These labels can be used as matching criteria in notification policies.

    Annotation

    Annotations to attach to the alert rule.

Create a global or instance-level alert rule (Cloud Monitor console)

You can use Cloud Monitor to create an alert rule for all instances or a specific instance in your Alibaba Cloud account.

  1. Log on to the CloudMonitor console.

  2. In the left-side navigation pane, choose Alerts > Alert Rules.

  3. On the Alert Rules page, click Create Alert Rule.

  4. In the Create Alert Rule panel, configure the following parameters.

    Parameter

    Description

    Product

    Select Lindorm.

    Resource Range

    The resources to which the alert rule applies. Valid values:

    • All Resources: Indicates that the rule applies to all instances of Lindorm under the current Alibaba Cloud account.

    • Application Groups: Specifies that the rule applies to all instances within the specified application group of Lindorm.

    • Instances: The rule applies to a specific Lindorm instance.

    Rule Description

    The core settings of the alert rule. An alert is triggered when monitoring data meets the alert condition. Configure the rule as follows:

    1. Click Add Rule.

    2. In the Add Rule Description panel, configure parameters such as the rule name, metric type, monitoring metric, dimension, threshold, alert level, and alert notification method.

    3. Click Determine.

    Related Resource

    Select the application group name or instance ID of Lindorm.

    Note

    This parameter is required when Application Groups is set to Instances or Instance.

    Mute Period

    The period during which repeated alerts for the same issue are suppressed. Valid values: 5 minutes, 15 minutes, 30 minutes, 60 minutes, 3 hours, 6 hours, 12 hours, and 24 hours.

    When a monitoring metric crosses the alert threshold, Cloud Monitor sends an alert notification. If the metric continues to exceed the threshold during the silence period, Cloud Monitor does not send duplicate notifications. If the metric is still abnormal after the silence period ends, Cloud Monitor sends another notification.

    Note

    Click Advanced Settings to configure this parameter.

    Effective Period

    The period during which the alert rule is active. The rule checks monitoring data and triggers alerts only during this period.

    Note

    Click Advanced Settings to configure this parameter.

    Tag

    Tags for the alert rule, specified as key-value pairs.

    Alert Contact Group

    The alert contact group that receives alert notifications.

    Alert notifications are sent to the contacts in this alert contact group. A group can include one or more alert contacts. For more information about how to create alert contacts and alert contact groups, see Create an alert contact or an alert contact group.

    Alert Callback

    Pushes alert notifications to a specified URL by using an HTTP or HTTPS POST request. For more information about how to use alert callbacks, see Use threshold-triggered alert callbacks.

    Auto Scaling

    Turn on Auto Scaling to trigger a scaling rule when an alert occurs. You must specify the region, scaling group, and scaling rule.

    Simple Log Service

    Turn on Simple Log Service to write alert information to a Log Service Logstore when an alert occurs. You must specify the region, Project, and Logstore. For more information about how to create a Project and a Logstore, see Use LoongCollector to collect and analyze text logs from ECS instances.

    Simple Message Queue (formerly MNS) - Topic

    Turn on Simple Message Queue (formerly MNS) - Topic to send alert information to a Message Service (MNS) topic when an alert occurs. You must specify the region and topic. For more information about how to create a topic, see Create a topic.

    method for handling no data

    Specifies how Cloud Monitor handles alerts when no monitoring data is available. Valid values:

    • Do not do anything (default)

    • Send alert notifications

    • Treat as recovered

  5. After configuring the parameters, click Determine.