You can use CloudMonitor to view the status and metrics of Application Load Balancer (ALB) resources to quickly troubleshoot issues when requests to your ALB instance time out or traffic throttling is triggered. You can view the monitoring information about ALB resources by using the console, API, or 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 the monitoring information.
View the monitoring data on the Instances page
On the Instances page, find the NLB instance that you want to manage and click in the Monitoring column.
In the Monitoring Information panel, you can click the ALB Instance, Listener, or VIP (Zone) tab to view the monitoring data.
View the data on the instance details page
On the Instances page, find the instance that you want to manage and click its ID. On the Instance Details tab, click the Charts tab.
On the Charts tab, you can click NLB Instance, Listener, or VIP (Zone) to view the monitoring data.
NoteYou can view the metrics on the VIP (Zone) tab only if your ALB instance is assigned a static IP address. To create alert rules for the metrics on the VIP (Zone) tab, log on to the CloudMonitor console. For more information, see Configure alert rules for ALB metrics.
If the instance is a dual-stack ALB instance, you can 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 metrics.
On the Listener tab, you can select a listener from the Listener drop-down list to view all metrics of the listener. You can also select Listener, Server Group, or Forwarding Rule from the Dimension drop-down list to view the metrics of the corresponding resource. To view the metrics of a server group or forwarding rule, select the ID of the server group or forwarding rule from the drop-down list.
You can set Time to specify a period of time. If you turn on Auto Refresh, the monitoring data is refreshed every minute.
Query monitoring information by calling API operations
This section describes how to query the monitoring metrics and detailed monitoring data of an ALB instance by calling CloudMonitor API operations.
The following figure describes the procedure.
Perform the following steps:
Query the namespace. Call the
DescribeProjectMeta
operation to query the namespace of ALB in CloudMonitor.Optional: Query existing metrics. Call the
DescribeMetricMetaList
operation to query the descriptions of time series metrics supported by CloudMonitor. You can also view the descriptions of the metrics in ALB monitoring metrics.Query the monitoring data of a metric.
Call the
DescribeMetricLast
operation to query the latest monitoring data of an ALB metric.Call the
DescribeMetricList
operation to query the monitoring data of an ALB metric within period of time.
DescribeProjectMeta
Call the DescribeProjectMeta
operation to query the namespace of ALB in CloudMonitor. For more information, see DescribeProjectMeta.
Set the Labels parameter to
[{"name":"product","value":"alb"}]
and use the default values for the other parameters. Then, click Initiate Call.Obtain the namespace of ALB in CloudMonitor based on the response parameters. In this example, the value of Namespace is
acs_alb
.
DescribeMetricMetaList
Call the DescribeMetricMetaList
operation to query the descriptions of time series metrics supported by CloudMonitor. For more information, see DescribeMetricMetaList.
Set the Namespace parameter to
acs_alb
and use the default values for the other parameters. Then, click Initiate Call.View the time series metrics of ALB based on the response parameters.
DescribeMetricLast
Call the DescribeMetricLast
operation to query the latest monitoring data of an ALB metric. The following example describes how to query the number of healthy servers associated with a listener based on the ListenerHealthyHostCount metric. For more information, see DescribeMetricLast.
Set the request parameters for ListenerHealthyHostCount and click Initiate Call.
Configure the following parameters and use the default values for the other parameters.
MetricName: the metric name. In this example, ListenerHealthyHostCount is used.
Dimensions: the resource whose monitoring information you want to query. In this example,
[{"loadBalancerId":"alb-t93aj3yndojot5****"}]
is used.Namespace: the namespace of the service. In this example, acs_alb is used.
View the latest monitoring information about ListenerHealthyHostCount based on the response parameters.
DescribeMetricList
Call the DescribeMetricList
operation to query the monitoring data of an ALB metric within a time period. The following example describes how to query the monitoring data of RuleHealthyHostCount within a time period. For more information, see DescribeMetricList.
Set the request parameters for RuleHealthyHostCount and click Initiate Call.
Configure the following parameters and use the default values for the other parameters:
MetricName: the metric name. In this example, RuleHealthyHostCount is used.
Namespace: the namespace of the service. In this example, acs_alb is used.
Dimensions: the resource whose monitoring data you want to query. In this example,
[{"loadBalancerId":"alb-2c9oquqqdcgbf8****"}]
is used.StartTime the start time. This value must not be greater than or equal to the value of EndTime. In this example, 2022-09-14 14:10:00 is used.
Supported formats:
UNIX timestamp: the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC
UTC time: the UTC time that follows the YYYY-MM-DDThh:mm:ssZ format
EndTime: the end time. The supported formats are the same as those supported by the start time. In this example,
2022-09-14 14:11:00
is used.
View the monitoring of RuleHealthyHostCount within the specific time period based on the response parameters.
Query monitoring information by using the SDK
This section describes how to query the metrics and detailed monitoring data of ALB by using the SDK. The following example describes how to query the number of active connections to an ALB instance by using the SDK to call the DescribeMetricList
operation.
You can also download the SDK to query the monitoring information. For more information, see SDK references.
Configure the following parameters and use the default values for the other parameters.
MetricName: the metric name. In this example, LoadBalancerActiveConnection is used.
Namespace: the namespace of the service. In this example, acs_alb is used.
Dimensions: the resource whose monitoring data you want to query. In this example,
[{"loadBalancerId":"alb-2c9oquqqdcgbf8****"}]
is used.StartTime the start time. This value must not be greater than or equal to the value of EndTime. In this example, 2022-09-14 14:10:00 is used.
Supported formats:
UNIX timestamp: the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC
UTC time: the UTC time that follows the YYYY-MM-DDThh:mm:ssZ format
EndTime: the end time. The supported formats are the same as those supported by the start time. In this example,
2022-09-14 14:11:00
is used.
Choose and click Example.
In the panel below, view the results.
References
For more information about ALB instance metrics, see ALB monitoring metrics.
For more information about how to create alert rules for ALB metrics, see Configure alert rules for ALB metrics.
If you want to view data at intervals of 1 second, enable the access log feature for the ALB instance. For more information, see Access logs.