After you activate CloudMonitor, you can configure alert rules for Application Load Balancer (ALB) instances by using the CloudMonitor console, calling API operations, or using SDKs.
Prerequisites
An ALB instance is created. Listeners are configured and health checks are enabled for the ALB instance. For more information, see the following topics:
Configure alert rules in the CloudMonitor console
Create an alert rule
- Log on to the CloudMonitor console.
In the left-side navigation pane, choose .
On the Alert Rules page, click Create Alert Rule.
In the Create Alert Rule panel, configure the parameters. The following table describes the parameters.
This topic describes only the key parameters. For more information about other parameters, see Alert rules.
Parameter
Description
Product
Select the Alibaba Cloud service that you want to monitor. Application Load Balancer (ALB) is selected in this example.
Resource Range
Select the range of the resources to which the alert rule is applied. Valid values:
All Resources: The alert rule applies to all resources of the specified cloud service.
Application Groups: The alert rule applies to all resources in the specified application group of the specified cloud service.
Instances: The alert rule applies to the specified resources of the specified cloud service.
Rule Description
Specify the content of the alert rule. If a metric meets a specific condition, an alert is triggered. To specify a condition, perform the following steps:
Click Add Rule.
In the Add Rule Description panel, specify the rule name, metric type, metrics, thresholds, and alert levels.
You can select a single metric, multiple metrics, or dynamic thresholds. In this example, a single metric is used.
Metric: For more information, see ALB metrics.
Select Dimension: Specify the listener protocol and listener port.
Threshold and Alert Level: Specify the thresholds for different alert levels.
The notification method that can be used for alerts of the Info type is Email + WebHook.
For more information about how to configure multi-metric alert rule expressions, see Alert rule expressions.
Click Ok.
Click Confirm.
What to do next
On the Alert Rules page, you can perform the following operations:
Modify an alert rule
On the Alert Rules page, find the alert rule that you want to modify and click Modify in the Actions column.
In the Modify Alert Rule panel, configure the parameters.
Disable alert rules
Disable a single alert rule
Find the alert rule that you want to disable, click the icon in the Actions column, and then click Disable.
In the Disable Alert Rule message, click Confirm.
Disable multiple alert rules at a time
Select the check boxes of the alert rules that you want to disable and click Disable in the lower-left corner of the page.
In the Disable Alert Rule message, click Confirm.
Enable alert rules
- Enable a single alert rule
- Find the alert rule that you want to enable, click the icon in the Actions column, and then click Enable.
- In the Enable Alert Rule message, click Confirm.
- Enable multiple alert rules at a time
- Select the check boxes of the alert rules that you want to enable and click Enable in the lower-left corner of the page.
- In the Enable Alert Rule message, click Confirm.
- Enable a single alert rule
Delete alert rules
- Delete a single alert rule
- On the Alert Rules page, find the alert rule that you want to delete, click the icon in the Actions column, and then click Delete.
- In the Delete Alert message, click Confirm.
- Delete multiple alert rules at a time
- Select the alert rules that you want to delete and click Delete in the lower-left corner of the page.
- In the Delete Alert message, click Confirm.
- Delete a single alert rule
On the Alert Rules page, find the alert rule that you want to manage and click Alert History in the Actions column.
You can view the details, alert contact group, alert history, and resource of the alert rule.
Configure alert rules by calling CloudMonitor API operations
The following figure shows the procedure for configuring alert rules by calling API operations.
Optional: Call the DescribeMetricMetaList operation to query the descriptions of ALB time series metrics supported by CloudMonitor or view the descriptions of the metrics in ALB metrics.
Call the PutContact operation to create or modify an alert contact.
Call the PutContactGroup operation to create or modify an alert contact group.
Call the PutResourceMetricRule operation to configure a threshold-based alert rule for a performance metric of a resource.
Call the DescribeMetricRuleList operation to query alert rules.
DescribeMetricMetaList
Call the DescribeMetricMetaList operation to query the descriptions of time series metrics that are available in CloudMonitor.
Set Namespace to acs_alb and use the default values for other parameters in the request.
View the time series metrics of ALB based on the returned parameters. For more information about the response, visit OpenAPI Explorer.
PutContact
Call the PutContact operation to create an alert contact. If an alert contact exists, you can call this operation to modify the alert contact.
Set the name and contact information of the alert contact in the request parameters.
In this example, configure the following parameters and use the default values for other parameters.
ContactName: the name of the alert contact.
Channels.Mail: the email address of the alert contact. After you add or modify an email address, the recipient receives an email that contains an activation link. The system adds the recipient to the list of alert contacts only after the recipient activates the email address.
Check whether the alert contact is created based on the value of Success in the response.
PutContactGroup
Call the PutContactGroup operation to create an alert contact group. If an alert contact group already exists, you can call this operation to modify the alert contact group.
Set the name and description of an alert contact group, and the names of the alert contacts in the group in the request parameters.
In this example, configure the following parameters and use the default values for other parameters.
ContactGroupName: the name of the alert contact group.
Describe: the description of the alert contact group.
ContactNames: the names of the alert contacts in the group.
Check whether the alert contact group is created based on the value of Success in the response.
PutResourceMetricRule
Call the PutResourceMetricRule operation to configure a threshold-based alert rule for a performance metric of a resource.
Configure threshold-based alert rule in the request parameters. The following section describes only some parameters. Configure the other parameters based on your business requirements.
Namespace: Set the value to acs_alb.
Resources: the resource to which the alert rule is applied. Specify an ALB instance in the
[{"instanceId":"alb-bp1rbwvouu******"}]
format.
Check whether the alert rule is created based on the value of Success in the response.
DescribeMetricRuleList
Call the DescribeMetricRuleList operation to query alert rules.
Set the ALB namespace and alert metrics to query detailed information about the alert metrics in the request parameters.
In this example, configure the following parameters and set other parameters to default values:
Namespace: Set the value to acs_alb.
MetricName: Specify the metrics to be queried.
View the details of the alert metrics specified in this example based on the returned parameters.
Configure alert rules by using SDKs
The following figure shows the procedure for configuring alert rules by using CloudMonitor SDKs.
Optional: Call the DescribeMetricMetaList operation to query the descriptions of ALB time series metrics supported by CloudMonitor or view the descriptions of the metrics in ALB metrics.
Call the PutContact operation to create or modify an alert contact.
Call the PutContactGroup operation to create or modify an alert contact group.
Call the PutResourceMetricRule operation to configure a threshold-based alert rule for a performance metric of a resource.
Call the DescribeMetricRuleList operation to query alert rules.
For more information, see OpenAPI Explorer.