This topic describes how to configure alert rules in CloudMonitor to monitor the usage of temporary storage spaces of elastic container instances and obtain information about elastic container instances whose temporary storage space are insufficient. Then, you can create new elastic container instances to replace the instances in a timely manner. This prevents data writing failure due to insufficient storage space and interruption of your business.
Background information
CloudMonitor can monitor metrics such as CPU utilization, memory usage, and storage capacity of elastic container instances. You can configure alert rules based on these metrics to obtain the running status of elastic container instances in a timely manner and handle abnormal instances. For more information about the metrics of elastic container instances that CloudMonitor monitors, see Use CloudMonitor to monitor elastic container instances.
Procedure
Click Create Alert Rule.
In the panel that appears, configure parameters and then click Confirm.
The following table describes major parameters. Use default values for other parameters. For more information about how to configure alert rules, see Create an alert rule.
Parameter
Description
Product
Select Elastic Container Instance (ECI).
Resource Range
Select the range of resources to which the alert rule applies. In this example, the value of Instances is selected. Valid values:
All Resources: The alert rule applies to all resources of the specified cloud service that are created after the alert rule is created.
Application Groups: The alert rule applies to all resources that are created after the alert rule is created in the specified application group of the specified cloud service.
Instances: The alert rule applies to the specified resources of the specified cloud service.
Associated Resources
If you select Instance as the resource range, you can specify elastic container instances.
Click Add Instance. In the dialog box that appears, select the elastic container instances that you want to monitor.
Rule Description
Click Add Rule and select Simple Indicators. In the panel that appears, configure the alert rule.
In this example, the alert rule has the following configurations:
Alert Rule: test
Metric Type: Simple Indicators
Metric: volume
Threshold and Alarm Level
Critical: 3 consecutive cycles (1 cycle = 1 minute), average ≥ 90
Warn: 3 consecutive cycles (1 cycle =1 minute), average ≥ 80
Info: 3 consecutive cycles (1 cycle = 1 minute), average ≥ 70
Dimension: EphemeralVolume
For information about how to configure complex alert conditions, see Alert rule expressions.
Alert Contact Group
CloudMonitor automatically adds your Alibaba Cloud account as an alert contact to the default alert contact group.
You can also go to the Alert Contacts page to create alert contacts and alert contact groups. For more information, see Create an alert contact or alert contact group.
What to do next
After you create an alert rule, if the specified metric reaches the alert threshold, the system automatically sends a notification to the specified contact.
You can also find the alert rule that you configure on the Alert Rules page and click Alert History in the Actions column to view relevant alerts.
After you receive an alert notification, you can handle the alert based on your business requirements. For example, you can create a new elastic container instance and scale up its temporary storage space to replace the elastic container instance that has insufficient storage space.
References
If you use elastic container instances in Kubernetes, you can add the k8s.aliyun.com/eci-eviction-enable: "true"
annotation to Elastic Container Instance-based pods to automatically evict a pod when the temporary storage space of the pod is insufficient to be less than 100 MiB. For more information, see Automatically evict pods whose temporary storage spaces are insufficient.