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 rules
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 | Metric name | Dimension | Statistics |
Instance | Peak TPS of an instance Note This metric indicates the peak transactions per second (TPS) of an instance per minute. The largest TPS value during each 1-minute cycle is collected. | Transactions per second | acs_amqp | InstanceMaxTpsInMiunte | userId, regionId, and instanceId | Value |
Number of inbound messages per second | Messages per second | acs_amqp | InstanceTPSIn | userId, regionId, and instanceId | Value | |
Number of outbound messages per second | Messages per second | acs_amqp | InstanceTPSOut | userId, regionId, and instanceId | Value | |
Number of consumers | N/A | acs_amqp | InstanceConsumers | userId, regionId, and instanceId | Value | |
Number of connections | N/A | acs_amqp | InstanceConnections | userId, regionId, and instanceId | Value | |
Number of channels | N/A | acs_amqp | InstanceChannelsNew | userId, regionId, and instanceId | Value | |
Vhost | Number of inbound messages per second | Messages per second | acs_amqp | VHostTPSIn | userId, regionId, instanceId, and vhostName | Value |
Number of outbound messages per second | Messages per second | acs_amqp | VHostTPSOut | userId, regionId, instanceId, and vhostName | Value | |
Number of consumers | N/A | acs_amqp | InstanceVhostConsumers | userId, regionId, instanceId, and vhostName | Value | |
Number of connections | N/A | acs_amqp | VhostConnections | userId, regionId, instanceId, and vhostName | Value | |
Number of channels | N/A | acs_amqp | VhostChannels | userId, regionId, instanceId, and vhostName | Value | |
Queue | Number of inbound messages per second | Messages per second | acs_amqp | QueueTPSIn | userId, regionId, instanceId, vhostName, and queueName | Value |
Number of outbound messages per second | Messages per second | acs_amqp | QueueTPSOut | userId, regionId, instanceId, vhostName, and queueName | Value | |
Number of consumers | N/A | acs_amqp | InstanceVhostQueueConsumers | userId, regionId, instanceId, vhostName, and queueName | Value | |
Number of accumulated messages Note The following items describe the methods that are used to calculate the number of accumulated messages in a queue:
| N/A | acs_amqp | InstanceVhostQueueMessageAccum | userId, regionId, instanceId, vhostName, and queueName | Maximum | |
Exchange | Number of inbound messages per second | Messages per second | acs_amqp | ExchangeTPSIn | userId, regionId, instanceId, vhostName, and exchangeName | Value |
Number of outbound messages per second | Messages per second | 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.