If your Network Load Balancer (NLB) instance encounters network issues, such as request timeouts and throttling, or you need to check the load and performance of your NLB instance, you can use CloudMonitor to collect and query the monitoring metrics of your NLB instance. This topic describes how to query NLB monitoring data in the NLB console or by using the API or SDK.
Query monitoring data in the console
- Log on to the NLB console.
In the top navigation bar, select the region in which the NLB instance is deployed.
On the Instances page, use one of the following methods to view the monitoring data of your NLB instance:
View the monitoring data on the Instances page
On the Instances page, find the instance that you want to manage and click in the Monitoring column.
In the Monitoring Information panel, you can click the NLB Instance, Listener, or VIP (Zone) tab to view the monitoring data.
View the data on the instance details page
On the Instances page, click the ID of the instance that you want to manage.
On the instance details page, click the Monitoring Chart tab.
On the Monitoring Chart tab, you can click NLB Instance, Listener, or VIP (Zone) to view the monitoring data.
NoteFor more information about the metrics, see NLB monitoring metrics.
By default, the monitoring data within the last hour is displayed. You can also query monitoring data within the last 3, 6, or 12 hours, or specify a custom time range.
After you enable auto refresh, the monitoring chart is updated every minute.
Query monitoring information by calling API operations
This section describes how to query the monitoring metrics and detailed monitoring data of an NLB instance by calling CloudMonitor API operations.
The following figure shows the procedure.
Perform the following steps:
Query the namespace. Call the DescribeProjectMeta operation to query the namespace of NLB in CloudMonitor.
Optional. Query existing metrics. Call the DescribeMetricMetaList operation to query the descriptions of the time series metrics supported by CloudMonitor or view the descriptions of the metrics in the NLB monitoring metrics topic.
Query the monitoring data of a metric.
Call the DescribeMetricLast operation to query the latest monitoring data of an NLB metric.
Call the DescribeMetricList operation to query the monitoring data of an NLB metric within a specified time period.
DescribeProjectMeta
Call the DescribeProjectMeta operation to query the namespace of NLB in CloudMonitor. For more information, see DescribeProjectMeta.
Set the Labels parameter to
[{"name":"product","value":"NLB"}]
and use the default values for the other parameters. Then, click Initiate Call.Obtain the namespace of NLB in CloudMonitor based on the response parameters. In this example, the value of Namespace is
acs_nlb
.
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_nlb
and use the default values for the other parameters. Then, click Initiate Call.View the time series metrics of NLB based on the response parameters.
DescribeMetricLast
Call the DescribeMetricLast operation to query the latest value of an NLB metric. In this example, the value of the InstanceNewConnection metric is queried. For more information, see DescribeMetricLast.
Set the following request parameters for the InstanceNewConnection metric, and then click Initiate Call.
Set the following parameters and use the default values for the other parameters:
MetricName: the name of the metric. This parameter is set to InstanceNewConnection in this example.
Dimensions: the resource whose monitoring information you want to query. In this example,
[{"instanceId":"nlb-defs3vztfty3nm****"}]
is used.Namespace: the namespace of the service. In this example, acs_nlb is used.
View the latest value of the InstanceNewConnection metric based on the response parameters.
DescribeMetricList
Call the DescribeMetricList operation to query the values of an NLB metric within a specified time period. The following example describes how to query the values of the InstanceMaxConnection metric within a specified time period. For more information, see DescribeMetricList.
Set the following request parameters for the InstanceMaxConnection metric, and then click Initiate Call.
Set the following parameters and use the default values for the other parameters:
MetricName: the metric name. In this example, the parameter is set to InstanceMaxConnection.
Namespace: the namespace of the service. In this example, the parameter is set to acs_nlb.
Dimensions: the resource whose monitoring information you want to query. In this example, the parameter is set to
[{"instanceId":"nlb-q5515xt60rx5s2****"}]
.StartTime: the start time. This value must not be greater than or equal to the value of EndTime. In this example, the parameter is set to
2022-10-13 20:45:03
.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-10-13 20:47:03
is used.
View the values of the InstanceMaxConnection metric within the specified time based on the response parameters.
Query monitoring information by using the SDK
This section describes how to query the monitoring metrics and detailed monitoring data of NLB by using the SDK. The following example describes how to query the maximum number of concurrent connections to the NLB instance per second by using the SDK to call the DescribeMetricList operation.
You can also download the SDK to query the monitoring data. For more information, see SDK references.
Set the following parameters and use the default values for the other parameters.
MetricName: the metric name. In this example, the parameter is set to InstanceMaxConnection.
Namespace: the namespace of the service. In this example, the parameter is set to acs_nlb.
Dimensions: the resource whose monitoring data you want to query. In this example, the parameter is set to
[{"instanceId":"nlb-q5515xt60rx5s2****"}]
.StartTime: the start time. This value must not be greater than or equal to the value of EndTime. In this example, the parameter is set to
2022-10-13 20:45:03
.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-10-13 20:47:03
is used.
Choose
and click Example.In the panel below, view the results.