Skip to content

Conversation

@mkuratczyk
Copy link
Contributor

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.

@mkuratczyk mkuratczyk force-pushed the emit-queue-info branch 12 times, most recently from 2428a68 to c606437 Compare March 27, 2025 10:52
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.
@mkuratczyk mkuratczyk marked this pull request as ready for review March 27, 2025 14:53
@mkuratczyk mkuratczyk merged commit 2a93bbc into main Mar 27, 2025
271 checks passed
@mkuratczyk mkuratczyk deleted the emit-queue-info branch March 27, 2025 14:54
mergify bot pushed a commit that referenced this pull request 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.

(cherry picked from commit 2a93bbc)
mkuratczyk added a commit that referenced this pull request 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.

(cherry picked from commit 2a93bbc)

Co-authored-by: Michal Kuratczyk <[email protected]>
ikavgo pushed a commit that referenced this pull request May 5, 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants