grafanaprometheus

How do I write an "or" logical operator on Prometheus or Grafana


I need to write a query that use any of the different jobs I define.

{job="traefik" OR job="cadvisor" OR job="prometheus"}

Is it possible to write logical binary operators?


Solution

  • Prometheus has an or logical binary operator, but what you're asking about here is vector selectors.

    You can use a regex for this {job=~"traefik|cadvisor|prometheus"}, however that you want to do this is a smell.