【问题标题】:How to query for queues that have a specific word in it如何查询其中包含特定单词的队列
【发布时间】:2020-07-15 21:42:27
【问题描述】:

我在做的是:

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

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

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

如何查询队列中发布的消息数量?

【问题讨论】:

    标签: prometheus grafana promql


    【解决方案1】:

    使用regex label filter:

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

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

    【讨论】:

      猜你喜欢
      • 2015-04-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-01-08
      • 1970-01-01
      • 1970-01-01
      • 2021-01-14
      相关资源
      最近更新 更多