RabbitMQ
Server Management
User Interface
Data Analytics
Technology Guides

How to enable stats in RabbitMQ management UI

System Design practice on Codemia

Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.

Practice system design

RabbitMQ is a popular open-source message broker widely used for its robust messaging capabilities. The RabbitMQ Management UI provides a user-friendly graphical interface to monitor and manage the broker. One valuable feature of this UI is its ability to display statistics about queues, message rates, and other critical metrics. Below, we delve into enabling and understanding the statistics in the RabbitMQ Management UI.

Prerequisites

To proceed, ensure you have:

  • Installed RabbitMQ server.
  • Enabled the RabbitMQ management plugin. This can be done using the command: rabbitmq-plugins enable rabbitmq_management

Enabling Statistics

The RabbitMQ Management UI is built into the rabbitmq_management plugin, which provides HTTP-based API for management and a browser-based UI to interact with the broker. Here’s how you can enable detailed statistics reporting in the UI:

  1. Enable the Management Plugin: First, ensure the management plugin is enabled as mentioned earlier. If it’s not, enable it using the command line.
  2. Configure Statistics Intervals: RabbitMQ allows you to adjust the interval at which statistics are collected. You can configure these intervals in the RabbitMQ configuration file (rabbitmq.conf):
ini
    management.stats.interval = 5000

The value is in milliseconds. The example above sets RabbitMQ to collect statistics every 5 seconds.

  1. Restart RabbitMQ Server: After updating the configuration, restart your RabbitMQ server to apply changes:
bash
    systemctl restart rabbitmq-server

Accessing the Management UI

Once the plugin is enabled, and the server is running with the appropriate settings:

  • Access the management UI by navigating to http://[your-rabbitmq-server]:15672/. The default username and password are guest / guest, assuming it's accessed locally.

Understanding the UI and Statistics

The RabbitMQ Management UI provides visibility into several metrics which can be crucial for diagnosing issues and ensuring efficient message handling:

  • Overview Tab: Shows global figures such as number of connections, channels, exchanges, queues, and messages in the system.
  • Queues Tab: Lists all queues and key statistics like message rates (publish, deliver), queue length, consumer count, etc.
  • Exchanges, Connections, Channels Tabs: Each provides detailed metrics specific to these components.

Configuration for Large Deployments

In larger RabbitMQ deployments, frequent statistical collection can add noticeable load to the management database. To mitigate this:

  • Increase the collection interval to reduce load.
  • Consider a dedicated hardware or VM for the RabbitMQ management database.

Summary Table

FeatureConfiguration KeyDefault ValueDescription
Management Pluginrabbitmq_managementEnabledProvides HTTP-based API and a browser-based UI.
Statistics Intervalmanagement.stats.interval5000 (ms)Time interval for stats collection in milliseconds.
Access URLhttp://[your-server]:15672/N/AURL to access the RabbitMQ Management UI.
Default CredentialsUsername/Passwordguest/guestDefault login credentials (local access only).

Conclusion

Monitoring and managing RabbitMQ effectively in a production environment requires a solid understanding of its management interface and the metrics it provides. Properly enabling and configuring the statistics in the RabbitMQ Management UI allows for real-time insights into the behavior and performance of your message broker, ensuring reliable messaging infrastructure for your applications.


Related reading
Course
Beginner
27 lessons
10 hours
System Design Fundamentals

Build a strong foundation in designing scalable, reliable distributed systems.

View the course
Track what you have practised

A free account saves your progress, solutions and study plan across every problem on Codemia.

System Design practice on Codemia

Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.

Practice system design

All Rights Reserved.