I'm trying to create an SLO dashboard using Prometheus and Grafana. One of the charts that I want to add is an
Error Budget Burndown in the last X days (starts with 100% and then burns down), something similar to:
I can do it using a custom script and two different Prometheus queries.
- Fetch total no. of requests in last X days (TOTAL) [Query 1]
- Allowed bad requests = TOTAL * (1-SLO)/100
- Fetch no. of bad requests in each window (say 1 hr) in last X days [Query 2]
- Calculate % budget remaining after each window and plot it
Is there a way to do it using a single Prometheus query and then plot it in Grafana?
Thanks