3

I am trying to build a pie chart using Grafana & Prometheus using Group by

In Grafana's panel

  • Query A: success
  • Query B: failure

If there is only single prometheus job, then it's perfect, it will have 2 parts:

  • success job 1
  • failure job 1

But this wouldn't work since there are multiple jobs.

E.g. there are 3 jobs, so the 1 pie chart created has 6 parts:

  • success job 1
  • success job 2
  • success job 3
  • failure job 1
  • failure job 2
  • failure job 3

What I want is 3 pie charts, group by job, each with success and failure. So I change the queries:

  • Query A: sum by (job) (success)
  • Query B: sum by (job) (failure)

Still it's a single pie chart with 6 parts.

Thanks.

shawnngtq
  • 687
  • 1
  • 7
  • 24

0 Answers0