curtank
curtank

Reputation: 700

How to filter label name after count_values in promql

enter image description here

a gauge named bag_status with label(a)

using

count_values ("bag_status" ,bag_status)

it will count number for diferent values

I want to filter bag_status with value <1

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

does not work

Upvotes: 2

Views: 5863

Answers (1)

Alin S&#238;npălean
Alin S&#238;npălean

Reputation: 10064

You could go about it the other way around. Just filter for the values you want before applying count_values:

count_values("bag_status", bag_status < 1)

Upvotes: 3

Related Questions