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 messages 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 the "Create a contact group" section in Manage alert contacts.
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.
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
Log on to the MSE console, and select a region in the top navigation bar.
In the left-side navigation pane, choose Microservices Registry > Alerts > Alert Policies.
In the upper-left corner of the MSE Alert List page, click Create MSE Alert Rule.
On the Create MSE Alert Rule page, configure the parameters and click Save.
Parameter
Description
Alert Rule Name
The name of the alert rule.
MSE Instance
The MSE instance on which you want the alert rule to take effect. The content that is enclosed in parentheses
()
next to the instance name indicates the type of the instance. You can create alert rules only for Nacos and ZooKeeper instances.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.
Duration
The duration.
Alert Level
The severity of the alert. Valid values: Default, P4, P3, P2, and P1. The alert severity increases in the following order: Default, P4, P3, P2, and P1.
Alarm 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 relevant parameters. You can select Simple Mode or Standard Mode.
Specify Notification Policy
You must configure this parameter if you select 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 click Create Notification Policy and create a custom notification policy on the Notification Policy page. You can also select an existing notification policy from the drop-down list. 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 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 all displayed on the MSE Alert List page.
On the MSE Alert List page, find the alert rule that you want to manage, and click an option in the Actions column to perform the following operations on the alert rule based on your business requirements:
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 Operations, and then select Enable Alert Rules, Disable Alert Rules, Delete Alert Rules, or Configure Tags. In the message that appears, click OK.