After you create ApsaraMQ for RabbitMQ instances, CloudMonitor automatically monitors the instances. You can view the metrics of instances, vhosts, queues, and exchanges to analyze instance usage and performance. You can also create alert rules for these metrics. This way, you can receive alerts and troubleshoot exceptions at your earliest opportunity.
Prerequisites
The AliyunCloudMonitorReadOnlyAccess policy is attached to the Resource Access Management (RAM) user that you use. To attach the policy, log on to the RAM console. For more information, see Step 2: Grant permissions to the RAM user.
The following code describes the policy that is used to query metrics in CloudMonitor:
{
"Version": "1",
"Statement": [
{
"Action": "cms:QueryMetric*",
"Resource": "*",
"Effect": "Allow"
}
]
}
Billing
You are not charged for using CloudMonitor in ApsaraMQ for RabbitMQ.
Metrics
The following table describes metrics that are supported by the new version of ApsaraMQ for RabbitMQ.
Resource type | Metric | Unit | Namespace | MetricName | Dimensions | Statistics |
Average Inbound Message Rate of an Instance per Minute Note Average number of inbound messages of an instance = Total number of inbound messages of the instance/60 | Count/s | acs_amqp | InstanceTPSIn | userId, regionId, and instanceId | Value | |
Average Outbound Message Rate of an Instance per Minute Note Average number of outbound messages of an instance = Total number of outbound messages of the instance/60 | Count/s | acs_amqp | InstanceTPSOut | userId, regionId, and instanceId | Value | |
Peak API Request Rate of an Instance (Maximum Value per Minute) Note Rule for determining the value: The system collects one sample every second based on a 1-minute cycle. The maximum value among the 60 samples is used. | Count/s | acs_amqp | InstanceMaxTpsInMiunte | userId, regionId, and instanceId | Value | |
InstanceConsumers | Count | acs_amqp | InstanceConsumers | userId, regionId, and instanceId | Value | |
InstanceConnections | Count | acs_amqp | InstanceConnections | userId, regionId, and instanceId | Value | |
InstanceChannels | Count | acs_amqp | InstanceChannelsNew | userId, regionId, and instanceId | Value | |
vhost | VHostTPSIn | Count/s | acs_amqp | VHostTPSIn | userId, regionId, instanceId, and vhostName | Value |
VHostTPSOut | Count/s | acs_amqp | VHostTPSOut | userId, regionId, instanceId, and vhostName | Value | |
InstanceVhostConsumers | Count | acs_amqp | InstanceVhostConsumers | userId, regionId, instanceId, and vhostName | Value | |
VHostConnections | Count | acs_amqp | VhostConnections | userId, regionId, instanceId, and vhostName | Value | |
VHostChannels | Count | acs_amqp | VhostChannels | userId, regionId, instanceId, and vhostName | Value | |
Queue | QueueTPSIn | Count/s | acs_amqp | QueueTPSIn | userId, regionId, instanceId, vhostName, and queueName | Value |
QueueTPSOut | Count/s | acs_amqp | QueueTPSOut | userId, regionId, instanceId, vhostName, and queueName | Value | |
InstanceVhostQueueConsumers | Count | acs_amqp | InstanceVhostQueueConsumers | userId, regionId, instanceId, vhostName, and queueName | Value | |
InstanceQueueMessageAccumulation Note The following items describe the methods that are used to calculate the number of accumulated messages in a queue:
| Count | acs_amqp | InstanceVhostQueueMessageAccum | userId, regionId, instanceId, vhostName, and queueName | Maximum | |
Exchange | ExchangeTPSIn | Count/s | acs_amqp | ExchangeTPSIn | userId, regionId, instanceId, vhostName, and exchangeName | Value |
ExchangeTPSOut | Count/s | acs_amqp | ExchangeTPSOut | userId, regionId, instanceId, vhostName, and exchangeName | Value |
You can call the DescribeMetricMetaList operation to obtain information about the preceding metrics of ApsaraMQ for RabbitMQ.
View monitoring data
Log on to the ApsaraMQ for RabbitMQ console. In the left-side navigation pane, click Instances.
In the top navigation bar of the Instances page, select the region where the instance that you want to manage resides. Then, in the instance list, click the name of the instance that you want to manage.
In the left-side navigation pane, click Monitoring and Alerting.
On the Monitoring and Alerting page, set the Group Name parameter to the type of the resource whose monitoring data you want to view, set the Resource type parameter to a specific resource, and then specify a time range.
The following figure provides an example of the Monitoring and Alerting page.
Create an alert rule
Log on to the ApsaraMQ for RabbitMQ console. In the left-side navigation pane, click Instances.
In the top navigation bar of the Instances page, select the region where the instance that you want to manage resides. Then, in the instance list, click the name of the instance that you want to manage.
In the left-side navigation pane, click Monitoring and Alerting.
In the upper-right corner of the Monitoring and Alerting page, move the pointer over the icon and click Configure Alert Rules.
The page is redirected to the Alert Rules page in the CloudMonitor console.
On the Alert Rules page, click Create Alert Rule. In the Create Alert Rule panel, configure the parameters based on your business requirements. For more information, see Alert service.
References
For information about how to query metric details by calling API operations, see DescribeMetricMetaList.