Two instances in query.

35 views
Skip to first unread message

Sebastian Glock

unread,
Feb 25, 2021, 2:57:12 PM2/25/21
to Prometheus Users
Hi, is there any option to insert 2 instances in 1 query? Something like that:

```
(100 - avg_over_time(probe_success{instance="instance1" , "instance2"}[5m]) * 100)

```

I want to set query just for 2 insances of 10 and I'm looking for possibilities :) 
And yes i need it in just ONE query, not 2 not 3 :)

Julien Pivotto

unread,
Feb 25, 2021, 3:07:17 PM2/25/21
to Sebastian Glock, Prometheus Users
(100 - avg_over_time(probe_success{instance=~"instance1|instance2"}[5m])
* 100)

>
> --
> You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/2fd6e70b-7471-4570-8d53-2a4a417f4eb8n%40googlegroups.com.


--
Julien Pivotto
@roidelapluie

Sebastian Glock

unread,
Feb 25, 2021, 3:08:38 PM2/25/21
to Prometheus Users

Thanks mate!

Julien Pivotto

unread,
Feb 25, 2021, 3:08:49 PM2/25/21
to Sebastian Glock, Prometheus Users
On 25 Feb 11:57, Sebastian Glock wrote:
Sorry the mail was gone too fast


You can use a regex to do this:

(100 - avg_over_time(probe_success{instance=~"instance1|instance2"}[5m])
* 100)

You will keep the instance name in the resulting vector.
Reply all
Reply to author
Forward
0 new messages