如何查询其中包含特定单词的队列

How to query for queues that have a specific word in it

我当时做的是:

rabbitmq_queue_messages_published{queue="Specific.Queue.String.With.TheWord.Apple"} 

获取 Specific.Queue.String.With.TheWord.Apple 队列中发布的消息数。

但是我有...我想查看 50 个队列,它们的共同点是队列名称中有这个词。

如何查询队列中包含该特定词的消息数量?

使用regex label filter:

rabbitmq_queue_messages_published{queue=~".*TheWord.*"}

请注意,.* 必须添加在 TheWord 的两边,因为 Prometheus 会自动将 anchors 添加到正则表达式中。 IE。它将 regexp 转换为 ^(?:regexp)$