Try the following query: (rules_job_count{cluster="loco-prod", status="failed"} + ignoring(status) rules_job_count{cluster="loco-prod", status="cancelled"}) / ignoring(status) rules_job_count{cluster="loco-prod", status="finished"}
It instructs Prometheus to ignore the `status` label when performing the addition and division operations. See more details about this at https://prometheus.io/docs/prometheus/latest/querying/operators/#vector-matching On Mon, Jul 6, 2020 at 10:48 AM Альберт Александров <yakhshisar...@yandex.ru> wrote: > > Hi all! > > > Have such metrics: > > > [image: photo_2020-07-06_10-30-12.jpg] > > I would like to query: > > (rules_job_count{cluster="loco-prod", status="failed"} + >> rules_job_count{cluster="loco-prod", status="cancelled"}) / >> rules_job_count{cluster="loco-prod", status="finished"} > > > But this didn't work. At the same time this query works: > > rules_job_count{cluster="loco-prod", status="failed"} + >> rules_job_count{cluster="loco-prod", status="failed"} > > > Could you say please how to make the first query work? > > -- > 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-users+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/prometheus-users/ac417564-df12-4627-8c09-2538c759a7c7o%40googlegroups.com > <https://groups.google.com/d/msgid/prometheus-users/ac417564-df12-4627-8c09-2538c759a7c7o%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- Best Regards, Aliaksandr Valialkin, CTO VictoriaMetrics -- 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-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/CAPbKnmBXZoVtuxBXJjJ3GDf7PvVEszx%3DF3kqo_rwxa7yNKNhtA%40mail.gmail.com.