【问题标题】:How to filter label name after count_values in promql如何在promql中的count_values之后过滤标签名称
【发布时间】:2019-02-22 03:03:44
【问题描述】:

一个名为 bag_status 的仪表,带有标签(a)

使用

count_values ("bag_status" ,bag_status)

它会计算不同值的数字

我想过滤 bag_status 值为

(count_values ("bag_status" ,bag_status)){bag_status!=1}

没用

【问题讨论】:

    标签: prometheus promql


    【解决方案1】:

    你可以反过来做。只需在应用 count_values 之前过滤您想要的值:

    count_values("bag_status", bag_status < 1)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-05-09
      • 2020-10-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多