Unable to get Queue Names of Rabbit MQ in Prometheus

1,989 views
Skip to first unread message

Chavya Khanna

unread,
Apr 22, 2022, 2:23:41 PM4/22/22
to rabbitmq-users
Hey folks,

I am sure this must have been answered before but i couldn't find an answer to it, just curious how do i get Queue names and number of messages in individual queue in Prometheus?

I've tried to explore "rabbitmq_queue_messages" in prometheus but that didn't help either.

Was hoping if someone could assist on it.


Michal Kuratczyk

unread,
Apr 25, 2022, 3:11:57 AM4/25/22
to rabbitm...@googlegroups.com
Hi,

The default configuration of the default /metrics endpoint is to return aggregated metrics only. This is because potentially there could be thousands and thousands of queues (and other entities) which leads to high resource consumption to return metrics that are likely unnecessary.


You basically have two options:
1. Use /metrics/per-object, which returns per-queue metrics
2. Set "prometheus.return_per_object_metrics = true" (effectively, this makes /metrics behave just like /metrics/per-object behaves by default)

Best,

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/53d0c450-2b65-4ab6-82b8-2350f37a096bn%40googlegroups.com.


--
Michał
RabbitMQ team

Chavya Khanna

unread,
Apr 26, 2022, 2:30:40 PM4/26/22
to rabbitmq-users
Thanks Michal,

Would you happen to know which metric can be used to display queue names? as i still don't seem to get "queue_list" metric

Regards,

Chavya Khanna

Michal Kuratczyk

unread,
Apr 27, 2022, 2:32:28 AM4/27/22
to rabbitm...@googlegroups.com
Hi,

There is no queue-list metric but there are metrics about each queue (that's how Prometheus metrics are structured in general: metric_name{label1=val1,label2=val2}=X
(this is a Prometheus format, not RabbitMQ-specific metrics format). For example, I have 2 queues here, qq1 and qq2 and the following metrics:

$ curl -s localhost:15692/metrics/per-object | grep ^rabbitmq_queue_messages_ready
rabbitmq_queue_messages_ready{vhost="/",queue="qq-1"} 10
rabbitmq_queue_messages_ready{vhost="/",queue="qq-2"} 10
rabbitmq_queue_messages_ready_bytes{vhost="/",queue="qq-1"} 120
rabbitmq_queue_messages_ready_bytes{vhost="/",queue="qq-2"} 120

Best,



--
Michał
RabbitMQ team

Chavya Khanna

unread,
Apr 28, 2022, 11:26:25 AM4/28/22
to rabbitmq-users
Thanks alot Michal! You are the best! It worked like a Charm! :)
Reply all
Reply to author
Forward
0 new messages