How to enable stats in RabbitMQ management UI

Viewed 5699

I am running RabbitMQ inside a container on localhost; my /etc/rabbitmq/rabbitmq.conf is pretty straightforward:

loopback_users.guest = false
listeners.tcp.default = 5672
management.tcp.port = 15672
management.disable_stats = false

I can access management ui with no problem (as a default guest user), but I see no graphs and stats on an Overview tab. And when I enter Channels tab there is only a message:

Stats in management UI are disabled on this node

What can be the reason of this behaviour?

3 Answers

I encountered exactly the same problem today. If you are using rabbitmq inside a container, make sure you are using the correct image, as stated in their website:

docker run -it --rm --name rabbitmq -p 5672:5672 -p 15672:15672 rabbitmq:3-management.

The rabbitmq_management plugin is enabled by default.

I was using docker run -it --rm --name rabbitmq -p 5672:5672 -p 15672:15672 rabbitmq. I had to manually turn on the management plugin and I encountered your problem.

The reason is that the default image disables metrics collector in the management_agent plugin:

# cat /etc/rabbitmq/conf.d/management_agent.disable_metrics_collector.conf 
management_agent.disable_metrics_collector = true

For deployment, you could turn it on or off through the configuration file. The instruction could be found HERE.

cd  /etc/rabbitmq/conf.d/
echo management_agent.disable_metrics_collector = false > management_agent.disable_metrics_collector.conf 

then restart docker container enter image description here

There is a config-file in the docker-container which disables metrics

root@rabbitmqcontainer:/etc/rabbitmq/conf.d# ls -1
management_agent.disable_metrics_collector.conf <<<<<<<<<<<<

root@rabbitmqcontainer:/etc/rabbitmq/conf.d# cat  manage*.conf
management_agent.disable_metrics_collector = true

I overwrote this config by copying a file the a name at the end of the alphabet in my Dockerfile:

COPY data/etc/rabbitmq/conf.d/zzz_enable_stats.conf ​/etc/rabbitmq/conf.d/

The content of the file is

management_agent.disable_metrics_collector = false

This overrides the config to the value I wish. I think all the config-files in the directory are worked off by alphabet.

Related