All Products
Search
Document Center

Microservices Engine:Manage alert rules

Last Updated:Apr 11, 2024

Microservices Engine (MSE) provides the alerting feature. 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. This topic describes how to create and manage alert rules.

Prerequisites

A contact group is created. For more information, see Create a contact group in the "Manage alert contacts" topic.

Background information

An alert control is a method 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

A new alert rule takes effect within 10 minutes. The system determines whether to generate an alert based on an alert rule within 1 to 3 minutes.

Create an alert rule

  1. Log on to the MSE console and select a region in the top navigation bar.

  2. In the left-side navigation pane, choose Microservices Registry > Alarm management > Policies.

  3. In the upper-left corner of the MSE alarm list page, click Create MSE Alert Rule.

  4. On the Create MSE Alert Rule page, configure the parameters and click Save.

    Parameter

    Description

    Alert Rule Name

    The name of the alert rule that you want to create.

    MSE Cluster

    The MSE instance on which you want the alert rule to take effect. The content that is enclosed in the parentheses () next to the instance name indicates the registry type of the instance. You can create alert rules for only Nacos and ZooKeeper registries.

    Alert Contact Group

    The alert group.

    Alert Metric

    The alert metric that you want to select based on your business requirements. Alert metrics that are displayed in the drop-down list vary based on the alert group that you specify.

    Alert Condition

    The trigger condition for the alert rule. For example, you can specify a condition to trigger an alert if the number of services exceeds 100.

    Filter Conditions

    Retain the No Filter value.

    Data Preview

    Click the blank area after you specify the alert condition. The system automatically displays the preview data of the alert rule that you want to create. You can specify an event cycle to filter data. If you move the pointer over the chart, the data at the specific point in time is displayed.

    Note

    You must configure this parameter if you select Nacos cluster status monitoring for Alert Metric.

    Duration

    The duration.

    Alert Level

    The severity of the alert. The alert severity increases in the following order: Default, P4, P3, P2, and P1.

    Alert Message

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

    ID of the instance on which alerting is enabled: {{$label.service_cluster_id}}
    Name of the instance node on which alerting is enabled: {{$label.kubernetes_pod_name}}
    Threshold value of the metric: {{$labels.metrics_params_value}}
    Actual value based on which you want to trigger the alert: {{ printf "%.2f" $value }}

    The alert information varies based on the alert metrics.

    Alert Notification

    Select a mode and configure the parameters. You can select Simple Mode or Standard Mode.

    Specify Notification Policy

    You must configure this parameter if you set Alert Notification to Standard Mode.

    If an alert is triggered, the alert center of Application Real-Time Monitoring Service (ARMS) dispatches and processes alert events and sends alert notifications based on the notification policy that you configured.

    You can select a created notification policy from the Specify Notification Policy drop-down list. You can also click Create Notification Policy on the Notification Policy page to create a custom notification policy. For more information, see Create and manage a notification policy.

    Advanced Settings

    Alert Check Cycle

    The interval at which alert rule-based checks are performed. Default value: 1. Unit: minutes.

    Check after the data is complete

    Specifies whether data integrity is required for checks.

    Tags

    Click Create Tag to create a tag for the alert rule. The tag that you created 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

The alert rules that you created on the Create MSE Alert Rule page are displayed on the MSE alarm list page.

  • On the MSE alarm list 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 Completed.

    • 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 alerting history, click Alert Event History in the Actions column. On the Events page, you can view the historical alerting information.

  • Optional. If you want to manage multiple alert rules at the same time, select multiple alert rules, click Batch operation, and then select Enable Alert Rules, Disable Alert Rules, or Delete Alert Rules. In the message that appears, click OK.