Application Real-Time Monitoring Service (ARMS) allows you to create alert rules to monitor Kubernetes clusters. When an alert rule is triggered, ARMS sends an alert notification over the specified notification methods. You can send notifications to contacts or DingTalk groups. Notifications are useful to remind the relevant persons to take necessary actions to resolve issues in a timely manner.

Create an alert rule

  1. Log on to the ARMS console .
  2. In the left-side navigation pane, click Kubernetes Monitoring.
  3. In the top navigation bar of the MNS console, select the region where your cluster is deployed.
  4. On the Kubernetes Monitoring page, click the name of the Kubernetes cluster for which you want to create an alert rule.
  5. In the left-side navigation pane, click Alert Configuration.
  6. On the Kubernetes Monitoring Alert Rules page, click Create Kubernetes Monitoring Alert Rules in the upper-right corner.
  7. On the Create Kubernetes Monitoring Alert Rules page, set the parameters as required and click Save.
    Parameter Description Example
    Alert Name The name of the alert rule to be created for Kubernetes Monitoring Number of errors greater than 0
    Alert Group The default value is Kubernetes Monitoring and cannot be modified. Kubernetes Monitoring
    Alert Metrics The metrics that are monitored. For more information about the alert metrics that are supported by Kubernetes Monitoring, see Alert metrics for Kubernetes Monitoring. Number of errors
    Alert Conditions The threshold of the alert metric to trigger an alert. When the number of errors is greater than 0
    Filter Conditions The scope of Kubernetes clusters to which the alert rule applies. If all the Kubernetes cluster resources that meet the filtering conditions exceed the threshold of the specified metric, an alert is triggered.

    Different alert metrics support different conditions used to filter the scope of alert rules from five dimensions (protocol, namespace, type, name, and request content). Set the filtering conditions of each dimension based on the alert metric that you selected.

    Default value: Traversal. Valid values:
    • Traversal: The alert rule applies to all resources.
    • Equal: If you select this condition, you must specify the value of the filter. The alert rule applies only to the specified resources. You can specify only one value for a dimension filter.
    • Not Equal: If you select this condition, you must specify the value of the filter. The alert rule applies only to resources other than the specified resources. You can specify only one value for a dimension filter.
    • Regular Expression Match: If you select this condition, you must specify the regular expression based on your business requirements. The alert rule applies only to all resources that match the regular expression.
    • Regular Expression Mismatch: If you select this condition, you must specify the regular expression based on your business requirements. The alert rule applies only to resources other than the resources that match the regular expression.
    Note After you set the filter conditions, the Data Preview section appears.
    • Protocol: Traversal
    • Namespace: Traversal
    • Type: Traversal
    • Name: Traversal
    • Request Content: Traversal
    Data Preview The Data Preview section displays the PromQL statements of the specified alert conditions and a times series graph of the specified metrics for the specified resources over time based on your alert settings.

    By default, only the alert data of the first resource is displayed. You can select the target resource and the time interval in the filter box to query the corresponding alert data.

    Note
    • In the time series graph, the red line indicates the alert threshold, the curve above the threshold line is displayed in dark red, and the curve beneath the threshold line is displayed in blue.
    • You can move the pointer over the curve of a metric to view the statistics at a specific point-in-time.
    • You can move the pointer over the curve of a metric and click-and-drag the pointer to select a time period. Then, you can view the time series curve of the selected time period.
    None
    Duration An alert is triggered only when the metric of the resource exceeds the defined threshold continuously for the duration window. For example, if Duration is set to 1, an alert is triggered only when the metric of the resource exceeds the threshold for more than 1 minute. 1
    Alert Level The severity level of the alert. Default value: Default. Valid values: Default, P4, P3, P2, and P1. Default indicates the lowest severity level, while P1 indicates the highest severity level. Default
    Alert Message The alert message that you want to send to the specified contacts or DingTalk groups. The system displays the default alert message based on the specified alert metric. You can also use the Go template syntax to customize the parameter variables in the alert message. Protocol: {{$ labels.protocol}} / Namespace: {{$labels.name space}} / Kind: {{$ labels.type}} / name: {{$labels.name}} / Request content:{{$labels.content_key }}, the number of errors exceeds the threshold, current value {{ printf "%.2f" $value }}
    Specify Notification Policies
    • Do Not Specify Notification Rules: If you select this option, you can create a notification policy on the Notification policy page after you create the alert rule. On the Notification policy page, you can specify dispatch rules and notification conditions (such as the names of alert rules). When the alert rule is triggered, an alert event is generated and an alert notification is sent to the contacts specified in the notification policy. For more information, see Notification policies.
    • Specify Notification Rules: You can select an existing notification policy from the drop-down list or create a new notification policy. When an alert is triggered, ARMS sends alert notifications by using the notification method that is configured in a specified notification policy. For more information, see Notification policies.
      Note To view the details of the notification policy, click View.
    Do Not Specify Notification Rules
    Advanced Settings
    Tags The tag of the alert rule. The tags are used to specify the notification dispatch rules on the Notification policy page. None
    Annotations The annotation of the alert rule. None

Manage an alert rule

On the Kubernetes Monitoring Alert Rules page, you can enable, disable, modify, or delete the alert rule. You can also view the details of the alert rule.

  1. Log on to the ARMS console .
  2. In the left-side navigation pane, click Kubernetes Monitoring.
  3. In the top navigation bar of the MNS console, select the region where your cluster is deployed.
  4. On the Kubernetes Monitoring page, click the name of the Kubernetes cluster.
  5. In the left-side navigation pane, click Alert Configuration.
  6. On the Kubernetes Monitoring Alert Rules page, find the alert rule that you want to manage. You can perform the following operations in the Actions column:
    Alert list for Kubernetes Monitoring
    • To modify an alert rule, click Edit. On the Edit Kubernetes Monitoring Alert Rules page, modify the alert rule and click Save.
    • To delete an alert rule, click Delete. In the Cue message, click OK.
    • To enable an alert rule, click Start. In the Cue message, click OK.
    • To disable an alert rule, click Stop. In the Cue message, click OK.
    • To view historical alert events or historical alert sending records, click Alert History. Then, you can click Alert Event History or Alert Sending History in the left-side navigation pane to view the corresponding historical records.