What label matchers does PromQL support?
BeginnerConceptPromQL & Recording Rules
Answer
http_requests_total{job="api"} # equal
http_requests_total{code!="200"} # not equal
http_requests_total{code=~"5.."} # regex match (fully anchored)
http_requests_total{path!~"/health|/metrics"} # regex not match
Regexes are RE2 and fully anchored, so "5.." matches 500 but not 1500. Every selector needs at least one matcher that does not match the empty string.
More on PromQL & Recording Rules
What are the PromQL data types?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?IntermediateHow do PromQL aggregation operators and `by`/`without` work?Beginner