PromQL - How to search a value column using last 5m?

56 Views Asked by At

I'm trying find a count of my errors in last 5 minutes with this query:

count_over_time (MY_METRIC{id="X",app="XXX", state="Success"}==0 [5m])

But i have a error: "bad_data: 1:25: parse error: unexpected "(" in aggregation"

The problem is ==0, if I try: count_over_time (MY_METRIC{id="X",app="XXX", state="Success"} [5m]), return for me. But I need use ==0 because my metric state is fix and the value is dynamic.

For exemple, when i have a Error, my metric return like this: MY_METRIC{id="X",app="XXX", state="Success"} 0 MY_METRIC{id="X",app="XXX", state="Warning"} 0 MY_METRIC{id="X",app="XXX", state="Error"} 1

Anyone can help me ?

Thanks

0

There are 0 best solutions below