Bootstrap FreeKB - RabbitMQ - Prometheus Plugin
RabbitMQ - Prometheus Plugin

Updated:   |  RabbitMQ articles

Prometheus and ELK (Elastic Search, Logstash, Kibana) are similar tools used to gather, display, and analyze data. For example, both Prometheus and ELK can be used to display data from Docker or Red Hat OpenShift containers or RabbitMQ, as just a few possible example.

The rabbitmq_prometheus plugin is used for communication between RabbitMQ and Prometheus.The rabbitmq-plugins command can be used to determine if the rabbitmq_prometheus plugin is enabled. If the rabbitmq_prometheus plugin is not enabled, the rabbitmq-plugins command with the enable option can be used to enable the rabbitmq_prometheus plugin.

]# rabbitmq-plugins list
. . .
[e*] prometheus                        3.4.3
[E*] prometheus_httpd                  2.1.8
[E*] prometheus_process_collector      1.3.0
[E*] prometheus_rabbitmq_exporter      v3.6.14.1


By default, HTTP port 15672 will be used for communication between RabbitMQ and Prometheus. You should be able to navigate to http://<hostname>:15672/metrics. Or, you could use the curl command (on Linux). Something like this should be returned.

~]# curl http://server001:15672/metrics | head
# HELP go_gc_duration_seconds A summary of the GC invocation durations.
# TYPE go_gc_duration_seconds summary
go_gc_duration_seconds{quantile="0"} 7.013e-06
go_gc_duration_seconds{quantile="0.25"} 1.373e-05
go_gc_duration_seconds{quantile="0.5"} 2.3932e-05
go_gc_duration_seconds{quantile="0.75"} 5.7791e-05
go_gc_duration_seconds{quantile="1"} 0.003142568
go_gc_duration_seconds_sum 9.620177574
go_gc_duration_seconds_count 131362
# HELP go_goroutines Number of goroutines that currently exist.


Likewise, the rabbitmqctl status command can be used to display the ports RabbitMQ is configured to listen on.

~]# rabbitmqctl status | grep listeners


Or the rabbitmqctl environment command can be used as well.

~]# rabbitmqctl environment | grep listen


The prometheus.tcp.port directive can be used to define some other port.

prometheus.tcp.port = 12345


By default, RabbitMQ metrics are updated once every 5000 milliseconds (5 seconds), as can be seen with the rabbitmqctl environment command.

~]# rabbitmqctl environment | grep collect_statistics_interval


Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee


Add a Comment

Please enter c75aa5 in the box below so that we can be sure you are a human.