All Products
Search
Document Center

Microservices Engine:Manage alert rules

Last Updated:May 31, 2024

The cloud-native gateways of Microservices Engine (MSE) provide the alerting feature based on Application Real-Time Monitoring Service (ARMS). If alert rules are matched, MSE sends alert notifications to you by using emails, text messages, or DingTalk in real time. This helps you identify errors at the earliest opportunity. On the Alerts page, you can manage custom alert rules of your account and query the history of alert events and alert notifications.

Prerequisites

A contact group is created. For more information, see Create a contact group.

Background information

An alert control is used to display data in datasets. When you create an alert control, a dataset is also created to store the underlying data of the alert control.

Note

New alert rules take effect within 10 minutes. If an alert rule is matched, MSE reports an alert with a delay of 1 to 3 minutes.

Create an alert rule

  1. Log on to the MSE console. In the top navigation bar, select a region.

  2. In the left-side navigation pane, choose Cloud-native Gateway > Alerts > Alert Policies.

  3. On the Alert Policies page, click Create MSE Alert Rule.

  4. On the Create MSE Alert Rule page, configure the parameters and click Completed. The following table describes the parameters.

    Parameter

    Description

    Alert Rule Name

    The name of the alert rule.

    Gateway

    The gateway that you want to manage.

    Alert Contact Group

    The alert group.

    Alert Metric

    Select an alert metric based on your business requirements. Different alert groups support different alert metrics.

    Alert Condition

    The condition of the alert rule. For example, if the number of requests that the gateway receives per second decreases by 20% compared with the previous day, MSE sends alert notifications.

    Filter Conditions

    Default value: No Filter. The default value indicates that no filter conditions are required.

    Duration

    Specify the time when the alert event is generated.

    Alert Level

    The severity of the alert. Valid values: Default, P4, P3, P2, and P1. The values are listed in ascending order by severity.

    Alert Message

    The alert content that you want to display when an alert is triggered. You can configure alert variables for the Alert Message parameter by using the Go template syntax. Example:

    ID of the instance on which alerting is enabled: {{$label.envoy_clusterid}}
    Alert threshold: {{$labels.metrics_params_value}}
    Actual value for alert triggering: {{ printf "%.2f" $value }}

    The alert information varies based on alert metrics.

    Advanced Settings

    Click the 展开图标 icon. You can configure parameters such as Tags and Annotations.

    Alert Check Cycle

    The interval between which alert rule-based checks are performed.

    Alert Notification

    Select Simple Mode or Standard Mode.

    Specify Notification Policy

    If Standard Mode is selected for Alert Notification, the alert center of ARMS dispatches and processes alert events and sends alert notifications based on the notification policy that you configured.

    Tags

    Click Create Tag to create a tag for the alert rule. The tag is used as an option for the dispatching rule.

    Annotations

    Click Create Annotation. Set Key to message and set Value to a value in the format of {{Variable name}}Alert information. The annotation that you created is in the message:{{$labels.pod_name}}Restart}}Alert information format. Example: message:{{$labels.pod_name}}Restart.

What to do next

  • On the Alert Policies page, find the alert rule that you want to manage and click an option in the Actions column to perform one of the following operations on the alert rule:

    • To modify the alert rule, click Edit in the Actions column. On the Edit MSE Alert Rule page, modify the alert rule and click Save.

    • To enable or disable the alert rule, click Start or Stop in the Actions column. In the message that appears, click OK.

    • To delete the alert rule, click Delete in the Actions column. In the message that appears, click OK.

    • To view the alert history, click Alert Event History in the Actions column. On the Events page, you can view the alert history.

  • Optional. To manage multiple alert rules at a time, select the rules and perform one of the following operations:

    • To enable multiple alert rules at a time, click Batch Operations in the lower-left corner of the page and click Enable Alert Rules. In the message that appears, click OK.

    • To disable multiple alert rules at a time, click Batch Operations in the lower-left corner of the page and click Disable Alert Rules. In the message that appears, click OK.

    • To delete multiple alert rules at a time, click Batch Operations in the lower-left corner of the page, and click Delete Alert Rules. In the message that appears, click OK.