Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 373
Asier Gomez Avatar asked Mar 31 '17 06:03

Asier Gomez


People also ask

What are operators in Prometheus?

In Kubernetes, an operator is a controller that works with the Kubernetes API to handle application processes without human intervention. The Prometheus operator automates the configuration and management of the Prometheus monitoring stack that runs on a Kubernetes cluster.

Does Grafana support PromQL?

In Grafana, you can configure New Relic as a Prometheus data source. Not only that, within Grafana you can query metrics stored in New Relic using the PromQL query language.


1 Answers

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.

like image 89
brian-brazil Avatar answered Oct 18 '22 08:10

brian-brazil