Skip to content

Conversation

@mergify
Copy link

@mergify mergify bot commented Mar 27, 2025

To allow filtering on queue type or membership status, we need an info metric for queues; see
https://grafana.com/blog/2021/08/04/how-to-use-promql-joins-for-more-effective-queries-of-prometheus-metrics-at-scale/#info-metrics

With this change, per-object metrics and the detailed metrics (if queue-related families are requested) will contain rabbitmq_queue_info / rabbitmq_detailed_queue_info with a value of 1 and labels including the queue name, vhost, queue type and membership status.

For example, it's now possible to get the number of messages ready by queue type:

sum(rabbitmq_queue_messages_ready *on (instance,job,vhost,queue) group_left(queue_type) rabbitmq_queue_info) by (queue_type)

or get a total number of messages ready excluding streams:

sum(rabbitmq_queue_messages_ready *on (instance,job,vhost,queue) group_left(queue_type) rabbitmq_queue_info{queue_type!="rabbit_stream_queue"})

NOTE: for consistency with other metrics (eg rabbitmq_global_messages_*), I use full module names as queue types (eg. rabbit_quorum_queue). Personally I'd prefer to unify this towards the short names but this would be a breaking change.


This is an automatic backport of pull request #13583 done by Mergify.

To allow filtering on queue type or membership status,
we need an info metric for queues; see
https://grafana.com/blog/2021/08/04/how-to-use-promql-joins-for-more-effective-queries-of-prometheus-metrics-at-scale/#info-metrics

With this change, per-object metrics and the detailed metrics
(if queue-related families are requested) will contain
rabbitmq_queue_info / rabbitmq_detailed_queue_info with a value of 1
and labels including the queue name, vhost, queue type and membership
status.

(cherry picked from commit 2a93bbc)
@mkuratczyk mkuratczyk merged commit 007fb4d into v4.1.x Mar 27, 2025
271 checks passed
@mkuratczyk mkuratczyk deleted the mergify/bp/v4.1.x/pr-13583 branch March 27, 2025 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants