11

在我的 ActiveMQ 上,我有一些以 .error 结尾的队列。在 Grafana 仪表板上,我想列出所有没有这些 .error-queues 的队列。例子:

some.domain.one
some.domain.one.error
some.domain.two
some.domain.two.error

要列出所有队列,我使用此查询:

org_apache_activemq_localhost_QueueSize{Type="Queue",Destination=~"some.domain.*",}

如何排除所有 .error-queues?

4

2 回答 2

14

您可以使用负正则表达式匹配器:org_apache_activemq_localhost_QueueSize{Type="Queue",Destination=~"some.domain.*",Destination!~".*\.error"}

于 2016-10-27T06:44:23.823 回答
3

Thers 是一种更简单的排除多个结尾的方法:

org_apache_activemq_localhost_QueueSize{Type="Queue",Destination!~".*error|.*warn"}

!~:不包括引用的字符串
|:它是or

于 2021-03-16T15:04:24.150 回答