What do `and`, `or` and `unless` do in PromQL?
IntermediateConceptPromQL & Recording Rules
Answer
They are set operators on label sets:
a and b: series fromathat have a matching series inb.a or b: all ofa, plus series frombwith no match ina.a unless b: series fromawith no match inb.
up{job="api"} == 0 unless on(instance) maintenance_mode == 1
Values come from the left side; b acts as a filter.
More on PromQL & Recording Rules
What are the PromQL data types?BeginnerWhat label matchers does PromQL support?BeginnerExplain `rate()`.Beginner`rate()` vs `irate()`: what is the difference?IntermediateWhat does `increase()` return and why is it sometimes a non-integer?IntermediateWhy must you `rate()` before `sum()`, never the reverse?Intermediate