You can use CloudMonitor to view the status and metrics of Application Load Balancer (ALB) resources. This helps you quickly troubleshoot issues, such as request timeouts and traffic throttling, and understand the load and performance of your ALB instance. You can view monitoring information using the console, an Application Programming Interface (API), or a software development kit (SDK).
View monitoring information in the ALB console
Log on to the ALB console.
In the top navigation bar, select the region where the ALB instance is deployed.
Use one of the following methods to view monitoring information.
View on the Instance List page
On the Instances page, find the target instance, and in the Monitoring column, click
.In the Monitoring Information panel that appears, click the Instance, Listener, or VIP (Zone) tab to view the monitoring data.
View data on the instance details page
On the Instances page, find the target instance and click its ID. On the Instance Details tab, click the Charts tab.
On the Charts tab, click the Instance, Listener, or VIP (Zone) tab to view the monitoring data.
NoteBy default, upgraded ALB instances support VIP (zone) metrics. Before the upgrade, this feature was available only for ALB instances in static IP mode and was not supported for ALB instances in dynamic IP mode.
To set alarm rules for the VIP (zone) metrics of an ALB instance, go to the CloudMonitor console. For more information, see Set alarm rules for ALB metrics.
If the instance is a dual-stack ALB instance, select All, IPv4, or IPv6 from the Metric Type drop-down list in the upper-left corner of the Monitoring Information panel to view the corresponding metrics.
On the Listener tab, you can select a listener from the Listener drop-down list to view its metrics. From the Dimension drop-down list, you can select Listener, Server Group, or Forwarding Rule. You can also select a specific server group or forwarding rule to view its metrics.
You can set Time to specify a time range for the monitoring charts and turn on Auto-refresh to refresh the monitoring data every minute.
View monitoring information using an API
This section describes how to use CloudMonitor APIs to view the metrics and monitoring data of an Application Load Balancer instance.
The following figure shows the process of viewing monitoring data using an API.
The process is as follows:
Query the data namespace. Call the
DescribeProjectMetaoperation to query the namespace of ALB in CloudMonitor.Optional: Query existing metrics. Call the
DescribeMetricMetaListoperation to query the descriptions of time series metrics supported by CloudMonitor. You can also view the descriptions of the metrics in ALB monitoring metrics.View the monitoring data of a specific metric.
Call the
DescribeMetricLastoperation to query the latest monitoring data for a specified monitored object in ALB.You can call the
DescribeMetricListoperation to query the time series monitoring data for a specified ALB monitored object within a specific time period.
DescribeProjectMeta
Call the DescribeProjectMeta operation to query the namespace of ALB in CloudMonitor. For more information, see DescribeProjectMeta.
Set the Labels parameter, which is used to filter product tags, to
[{"name":"product","value":"alb"}]. Keep the default values for the other parameters, and then click Initiate Call.In the response, the value of Namespace for the ALB data in CloudMonitor is
acs_alb.
DescribeMetricMetaList
Call the DescribeMetricMetaList operation to query the descriptions of time series metrics available in CloudMonitor. For more information, see DescribeMetricMetaList.
Set the Namespace parameter to
acs_alb, keep the default values for the other parameters, and then click Initiate Call.View the time series metrics for ALB in the response.
DescribeMetricLast
Call the DescribeMetricLast operation to query the latest monitoring data for a specified monitored object of ALB. This topic provides an example of using the ListenerHealthyHostCount metric, which indicates the number of healthy backend servers of a listener. For more information, see DescribeMetricLast.
In the request parameters, set the following parameters to query ListenerHealthyHostCount, and then click Initiate Call.
Set the following parameters and keep the default values for the other parameters.
MetricName: The name of the metric. In this example, set this parameter to ListenerHealthyHostCount.
Dimensions: The dimensions that are used to query the monitoring data of a specified resource. In this example, set this parameter to
[{"loadBalancerId":"alb-t93aj3yndojot5****"}].Namespace: The namespace of the service. This parameter is used to differentiate services. In this example, set this parameter to acs_alb.
View the latest monitoring data for ListenerHealthyHostCount in the response.
DescribeMetricList
Call the DescribeMetricList operation to query the time series monitoring data of an ALB instance within a specified time period. This topic uses the number of healthy backend servers for a listener within a specified time period as an example. For more information, see DescribeMetricList.
In the request parameters, set the parameters to query the monitoring data of RuleHealthyHostCount within a specified time period, and then click Initiate Call.
Set the following parameters and keep the default values for the other parameters.
MetricName: The name of the metric. In this example, set this parameter to RuleHealthyHostCount.
Namespace: The namespace of the service. This parameter is used to differentiate services. In this example, set this parameter to acs_alb.
Dimensions: The dimensions that are used to query the monitoring data of a specified resource. In this example, set this parameter to
[{"loadBalancerId":"alb-2c9oquqqdcgbf8****"}].StartTime: The start of the time range to query. The value of StartTime cannot be the same as or later than the value of EndTime. In this example, set this parameter to
2022-09-14 14:10:00.Supported formats:
UNIX timestamp: The number of milliseconds that have elapsed since 00:00:00 UTC on January 1, 1970.
Format: YYYY-MM-DDThh:mm:ssZ.
EndTime: The end of the time range to query. The supported formats are the same as those for StartTime. In this example, set this parameter to
2022-09-14 14:11:00.
View the monitoring data of RuleHealthyHostCount for the specified time period in the response.
View monitoring information using an SDK
This section describes how to use an SDK to view the metrics and monitoring data of an ALB instance. This topic describes how to use an SDK to call the DescribeMetricList operation to query the number of active connections for an ALB instance.
In the request parameters, set the following parameters and keep the default values for the other parameters.
MetricName: The name of the metric. In this example, set this parameter to LoadBalancerActiveConnection.
Namespace: The data namespace for the product, which is used to distinguish between different products. In this topic, this parameter is set to acs_alb.
Dimensions: The dimensions that are used to query the monitoring data of a specified resource. In this example, set this parameter to
[{"loadBalancerId":"alb-2c9oquqqdcgbf8****"}].StartTime: The start of the time range to query. The value of StartTime cannot be the same as or later than the value of EndTime. In this example, set this parameter to
2022-09-14 14:10:00.Supported formats:
UNIX timestamp: The number of milliseconds that have elapsed since 00:00:00 UTC on January 1, 1970.
Format: YYYY-MM-DDThh:mm:ssZ.
EndTime: The end of the time range to query. The supported formats are the same as those for StartTime. In this example, set this parameter to
2022-09-14 14:11:00.
On the tab, click Run.
On the operation call page, view the result in the panel at the bottom.
References
For more information about the metrics of ALB instances, see ALB metrics.
To set alert rules for ALB metrics, see Set alert rules for ALB metrics.
If you require second-level monitoring, you can enable the access log feature to view second-level monitoring information. For more information, see ALB access logs.