The built-in monitoring and alerting service of Message Queue for Apache RocketMQ allows you to monitor consumption statuses of messages under a topic subscribed by a group ID over the TCP protocol and receive alert messages, helping you understand message accumulation in real time. SMS alerts sent by the built-in monitoring service are free of charge.

Prerequisites

  • Make sure that the region where the instance is located supports the built-in monitoring and alerting feature. The following regions support this feature:
    • Internet
    • China (Hangzhou)
    • China (Shanghai)
    • China (Qingdao)
    • China (Beijing)
    • China (Zhangjiakou-Beijing Winter Olympic)
    • China (Hohhot)
    • China (Shenzhen)
    • China (Hong Kong)
    • China North 2 Ali Gov
    • Singapore (Singapore)
    • Japan (Tokyo)
  • Make sure that the group ID you want to monitor has subscribed to the corresponding topic. For more information about how to subscribe to messages, see the following topics:

Procedure

  1. Log on to the Message Queue for Apache RocketMQ console.
  2. In the top navigation bar, select a region, such as China (Hangzhou).
  3. On the Instances page, find the target instance and click Details in the Actions column.
  4. In the left-side navigation pane, click Monitoring and Alerts.
  5. On the Monitoring and Alerts page, click Create Metrics.
    create_monitor_item
  6. In the Create Metrics dialog box, set parameters as needed and click OK.
    new_monitor_item

    The description of the parameters is provided:

    • Group ID:: specifies the group ID to be monitored.
    • Topic:: specifies the topic that the group ID has subscribed to.
    • Threshold on Accumulated Messages:: specifies the alert threshold for consumption accumulation. The valid threshold ranges from 1 to 100,000,000. If messages are accumulated when the group ID that you want to monitor consumes messages under the specified topic, and the number of accumulated messages exceeds the threshold, Message Queue for Apache RocketMQ sends an SMS notification to the alert contact.
    • Consumption Delay Threshold:: specifies the consumption latency. Consumption latency is the interval between the latest time when the group ID consumes the messages of the specified topic and the time when the last message of the topic is sent to the group ID. The minimum threshold is 1 minute.
    • Alert Time:: specifies the alert time, which is accurate to the minute. The maximum range is 00:00-23:59. You will receive SMS alerts only within the specified time range.
    • Alert Frequency:: specifies the alert frequency, which can be 5 Minutes, 15 Minutes, or 30 Minutes.
    • Alert Recipient: specifies the alert contact, which can be either the nickname or phone number of the contact. The nickname must be 1 to 100 characters in length.
    Note If you have canceled a topic subscription under a group ID, delete the corresponding metrics.
    The new metric appears on the Monitoring and Alerts page.
  7. Optional:On the Monitoring and Alerts page, you can edit, disable, or delete the metrics that you have created. You can also click Enable in the Actions column to enable a disabled metric.
    enable_monitor_item