promql表达式以两个间隔找到常见标签
可以说,我收集了以下指标,从现在-60m到30m -
fruits{name="apple"} 1
fruits{name="orange"} 1
fruits{name="pear"} 1
以及以下从现在到30m到现在收集的指标,
fruits{name="banana"} 1
fruits{name="pear"} 1
fruits{name="watermelon"} 1
我将如何编写一条警报规则,以检查两个集合中是否存在任何水果,并且它的名称是否存在?在这种情况下,将是
pear
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试以下查询:
它应返回
name
标签,这两个时间范围都存在 -(现在-60m ..现在-30m]
和(现在-30m) 现在]
。
Try the following query:
It should return
name
labels, which existed on both time ranges -(now-60m .. now-30m]
and(now-30m .. now]
.It uses the following functions: