![Magenta rect. w/ parallel plot, font & mat. prop](https://cdn.zensoftware.nl/640_952bd4b8_1af7_4a89_a364_54255d7cf693_2a0a84a139/640_952bd4b8_1af7_4a89_a364_54255d7cf693_2a0a84a139.webp)
Introduction
Error Budgets enable a large amount of autonomy for your software teams. these feature teams can steer priority based on the level of service that is currently being offered to stakeholders. This article will explain the basics of the concepts that enable Error Budgets. Furthermore it will demonstrate how to implement it using ZEN Software’s Agile Analytics.
When implementing Error Budgets for your teams a number of things needs to be setup up in both the team culture as well as in the tools.
SLI & SLOs are the driving concepts behind Error Budgets
This article will tell you all about what SLI, SLOs and Error Budgets are and how to implement them, let’s get started
Service Level Indicator
This indicator works with percentages. 100% is good, 0% bad. It measures a service level using the ratio of good vs valid events events
!["Good Tech: SL - Celebrating Good Events & Valid Events"](https://cdn.zensoftware.nl/6fc81244_fe2e_4384_adcc_8c8a015f1dbc_7796f1d042/6fc81244_fe2e_4384_adcc_8c8a015f1dbc_7796f1d042.webp)
so the simplest way to have your first SLI is to count all ‘good’ events as percentage of all ‘valid’ events.
What makes a ‘good’ and what a ‘valid’ event? This depends on what you are measuring: let’s start by measuring the availability of our service, load balancer side.
from the list of all the response-codes logged by the load balancer the following ‘good’ and ‘valid’ events can be distinguished:
a ‘good’ HTTP event are all HTTP response codes except 500-599
a ‘valid’ HTTP event is are HTTP return codes
SLI Availability
so we are now ready for our first SLI configuration in Agile Analytics
![Electric-blue font on screenshot of rectangle with numbers, text: Lat](https://cdn.zensoftware.nl/488cc0be_91c7_4a83_ace4_9cbd2f330d68_c4a0be658b/488cc0be_91c7_4a83_ace4_9cbd2f330d68_c4a0be658b.webp)
We create a new ‘feature’ called “Availability” and describe what aspect we are monitoring.
Since we’re measuring Availability we have 1 indicators; 1 for Good, 1 for Valid events.
our measurement method is therefore “Good Bad Ratio”
- Good Event are { all HTTP return codes: 429, 200-208, 226, 304 }
1project="<yourprojectid>"
2metric.type="appengine.googleapis.com/http/server/response_count"
3resource.type="gae_app"
4resource.label.module_id="api"
5(metric.labels.response_code = 429 OR
6 metric.labels.response_code = 200 OR
7 metric.labels.response_code = 201 OR
8 metric.labels.response_code = 202 OR
9 metric.labels.response_code = 203 OR
10 metric.labels.response_code = 204 OR
11 metric.labels.response_code = 205 OR
12 metric.labels.response_code = 206 OR
13 metric.labels.response_code = 207 OR
14 metric.labels.response_code = 208 OR
15 metric.labels.response_code = 226 OR
16 metric.labels.response_code = 304)
- Valid Events are { all HTTP return codes }
1project="<yourprojectid>"
2metric.type="appengine.googleapis.com/http/server/response_count"
3resource.type="gae_app"
4resource.label.module_id="api"
to create the Feature for this service press:
!["Electric-blue Rectangle Logo w/ 'Create' encourages](https://cdn.zensoftware.nl/640_Screenshot_11_11zon_502001b00f/640_Screenshot_11_11zon_502001b00f.webp)
done!
let’s move on to the next method, measuring a Latency SLI using distribution cut
SLI Latency
When measuring latency (how long does a request to your service take) please take this diagram, a long tail distribution, in the back of your mind:
!["UBank logo: making banking simpler, smarter & faster."](https://cdn.zensoftware.nl/640_38222ef4_3807_4ec3_831e_689c0a02dbba_329cd2dce1/640_38222ef4_3807_4ec3_831e_689c0a02dbba_329cd2dce1.webp)
This diagram shows a LARGE number of requests that take a few milliseconds and (hence the long tail) a very small nr of requests that take forever.
What we need to measure is, given a latency: how many requests are below and how many are above that latency.
How many requests ‘make the cut’ and how many simply take too long?
if we know that we can simply fill in the SLI formula:
!["Good Technology logo w/ slogan: "SLI: Good events,](https://cdn.zensoftware.nl/2b71dae8_c8cf_4b7c_a9ca_6ba29bd8a44f_1ae5f48ad6/2b71dae8_c8cf_4b7c_a9ca_6ba29bd8a44f_1ae5f48ad6.webp)
- ‘good’ events are fast enough to make the cut
- ‘valid’ events are all requests
Let’s configure this in Agile Analytics:
![Tech screenshot features a rectangle font, electric-blue number & brand](https://cdn.zensoftware.nl/4bc3345a_de84_4b64_bd44_9bb745a244d5_11zon_2c02f148ec/4bc3345a_de84_4b64_bd44_9bb745a244d5_11zon_2c02f148ec.webp)
Next, what is the bucket that separates the weed from chaff?
!["Electric-blue Parallel Logo Brand "Threshold Bucket 23" on](https://cdn.zensoftware.nl/640_Screenshot_12_11zon_36e6a53841/640_Screenshot_12_11zon_36e6a53841.webp)
In this example all events faster than 2048 milliseconds are ‘good’
next fill in the google monitoring code under ‘filter valid’
1project="<yourprojectid>"
2resource.labels.module_id="api"
3metric.type="appengine.googleapis.com/http/server/response_latencies"
!["Electric-blue Rectangle Logo w/ 'Create' encourages](https://cdn.zensoftware.nl/640_Screenshot_11_11zon_502001b00f/640_Screenshot_11_11zon_502001b00f.webp)
press create and you’ve now created your second SLI!
let’s move on by setting some goals for your teams.
Service Level Objective
The service level objective is the reliability goal for the feature team to achieve. SLOs are the key to making data-driven decisions on feature team priority. The team needs a goal
![Tech screenshot w/ parallel numbers, elec-blue font & rect](https://cdn.zensoftware.nl/640_84b2cb2d_cbb6_4ac3_9d95_6f748408501a_11zon_246ceaf45f/640_84b2cb2d_cbb6_4ac3_9d95_6f748408501a_11zon_246ceaf45f.webp)
Setting a goal of 99% percent availability (here in screenshot) means that the service can have an allowed downtime/unavailability of
- 1m 26s (Daily)
- 10m 4s (Weekly)
- 43m 49s (Monthly)
these would be the numbers if we were using time as a basis for our measurement. We are using events and percentages instead but this gives you an idea how things would be if we were using a time-basis.
Simply said, the SLO game is a ‘game of nines’. How much reliability are you willing to have as a standard for your services granted that it can never be 100%.
We advise to start at 95% and work your way up to 99% then 99.9% or even higher to 99.99%.
Then, the final instrument for the feature teams reaching (near full) autonomy for their priority decisions using data-driven insights are error budgets.
Error Budgets
![Brightly colored rectangles & fonts show a pattern of parallel numbers in](https://cdn.zensoftware.nl/640_f494675b_6178_4918_ad54_354787bf2864_11zon_3ed6348ad4/640_f494675b_6178_4918_ad54_354787bf2864_11zon_3ed6348ad4.webp)
This policy is not intended to serve as a punishment for missing SLOs. Halting change is undesirable; this policy gives teams permission to focus exclusively on reliability when data indicates that reliability is more important than other product features.
An SLO specifies the degree to which a service must perform during a compliance period. What's left over in the compliance period becomes the error budget. The error budget quantifies the degree to which a service can fail to perform during the compliance period and still meet the SLO.
An error budget is defined as 100% − SLO%. If your SLO target is 99.99%, your error budget is 0.01% within the compliance period. A service required to meet a 100% SLO has no error budget. Setting such an SLO is a bad practice.
Error budgets let you track how many bad individual events (like requests) are allowed to occur during the remainder of your compliance period before you violate the SLO. You can use the error budget to help you manage maintenance tasks like deployment of new versions. If the error budget is close to depleted, then taking risky actions like pushing new updates might result in your violating a SLO.
For example, if your SLO is for 85% of requests to be good in a 7-day rolling period, then your error budget allows 15% of the requests to be bad. If you get an average of, say, 60,480 requests in a week, your error-budget is 15% of that total, or 9,072 requests that are permitted to be bad. Your starting error budget is 9,072 requests, and as bad requests occur, the error budget is consumed until it reaches 0.
Error Budgets allow feature teams to be alerted when reliability becomes a risk to the team. Since the team is responsible for the software in production “you build it, you run it” the team is also accountable for both the feature development as well as the feature stability and performance.
Using SLI, SLO and Error Budgets neatly combines powerfull concepts from Site Reliability Engineering (SRE) to give your teams the tools to be autonomous, responsible and accountable.
Sneller en vaker naar productie!
Implementeer DevOps met Agile Analytics
Implementeer Site Reliability met Agile Analytics
Implementeer Service Level Objectives met Agile Analytics
Implementeer DORA-metrics met Agile Analytics