All Products
Search
Document Center

Server Load Balancer:Configure alert rules for ALB metrics

Last Updated:Oct 30, 2023

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

  1. Log on to the CloudMonitor console.
  2. In the left-side navigation pane, choose Alerts > Alert Rules.

  3. On the Alert Rules page, click Create Alert Rule.

  4. 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:

    1. Click Add Rule.

    1. 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.

        1. Metric: For more information, see ALB metrics.

        2. Select Dimension: Specify the listener protocol and listener port.

        3. 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.

    1. Click Ok.

  1. Click Confirm.

What to do next

On the Alert Rules page, you can perform the following operations:

  • Modify an alert rule

    1. On the Alert Rules page, find the alert rule that you want to modify and click Modify in the Actions column.

    2. In the Modify Alert Rule panel, configure the parameters.

  • Disable alert rules

    • Disable a single alert rule

      1. Find the alert rule that you want to disable, click the More icon in the Actions column, and then click Disable.

      2. In the Disable Alert Rule message, click Confirm.

    • Disable multiple alert rules at a time

      1. Select the check boxes of the alert rules that you want to disable and click Disable in the lower-left corner of the page.

      2. In the Disable Alert Rule message, click Confirm.

  • Enable alert rules

    • Enable a single alert rule
      1. Find the alert rule that you want to enable, click the More icon in the Actions column, and then click Enable.
      2. In the Enable Alert Rule message, click Confirm.
    • Enable multiple alert rules at a time
      1. Select the check boxes of the alert rules that you want to enable and click Enable in the lower-left corner of the page.
      2. In the Enable Alert Rule message, click Confirm.
  • Delete alert rules

    • Delete a single alert rule
      1. On the Alert Rules page, find the alert rule that you want to delete, click the More icon in the Actions column, and then click Delete.
      2. In the Delete Alert message, click Confirm.
    • Delete multiple alert rules at a time
      1. Select the alert rules that you want to delete and click Delete in the lower-left corner of the page.
      2. In the Delete Alert message, click Confirm.
  • 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.通过API设置报警规则_流程图

  1. 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.

  2. Call the PutContact operation to create or modify an alert contact.

  3. Call the PutContactGroup operation to create or modify an alert contact group.

  4. Call the PutResourceMetricRule operation to configure a threshold-based alert rule for a performance metric of a resource.

  5. 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.

  1. Set Namespace to acs_alb and use the default values for other parameters in the request.

  2. 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.

  1. 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.

  2. 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.

  1. 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.

  2. 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.

  1. 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.

  2. 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.

  1. 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.

  2. 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.通过API设置报警规则_流程图

  1. 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.

  2. Call the PutContact operation to create or modify an alert contact.

  3. Call the PutContactGroup operation to create or modify an alert contact group.

  4. Call the PutResourceMetricRule operation to configure a threshold-based alert rule for a performance metric of a resource.

  5. Call the DescribeMetricRuleList operation to query alert rules.

For more information, see OpenAPI Explorer.

References