-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.html
1489 lines (1452 loc) · 74.5 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-J0S6RM2D7G"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());gtag('config', 'G-J0S6RM2D7G');
</script>
<meta charset="UTF-8">
<meta name="theme-color" content="#FFBC52">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="index.css">
<meta name="description" content="A simple Service Level Calculator that complies with Google SRE books.">
<meta property="og:title" content="Service Level Calculator">
<meta property="og:description" content="A simple Service Level Calculator that complies with Google SRE books.">
<meta property="og:image" content="https://slc.alexewerlof.com/img/icon.png">
<meta property="og:url" content="https://slc.alexewerlof.com">
<meta property="og:type" content="website">
<link rel="icon" type="image/svg" href="img/icon.svg">
<link rel="manifest" href="manifest.json">
<title>Service Level Calculator</title>
</head>
<body>
<noscript>
<p>This web application requires JavaScript to work.</p>
</noscript>
<div id="app" v-cloak>
<header>
<transition>
<div class="announcement" v-if="showAnnouncement">
<ext-link href="https://blog.alexewerlof.com/p/slc">Read the announcement about this app</ext-link>.
<button @click="showAnnouncement = false" type="button">Dismiss</button>
</div>
</transition>
<a href="/">
<h1>
<img src="img/icon.svg" alt="Service Level Calculator Logo" class="logo" />
Service Level Calculator
</h1>
</a>
<ul class="top-nav only-mobile">
<li><a href="#sli-title">SLI</a></li>
<li><a href="#slo-title">SLO</a></li>
<li><a href="#error-budget-title">Error Budget</a></li>
<li><a href="#alert-title">Alerting</a></li>
<li><a href="#share-title">Share</a></li>
</ul>
</header>
<article>
<!------------------------ SLI ------------------------>
<section>
<h1 id="sli-title">
SLI
<help-component>
<p>
In simple words <ext-link href="https://blog.alexewerlof.com/p/sli">Service Level Indicators
</ext-link> are the metrics that represent how the reliability
is perceived by the consumers of the service. They are normalized to be a number between
0 and 100 using this formula:
</p>
<math>
<mrow>
<mi>SLI</mi>
<mo>=</mo>
<mfrac>
<mrow>
<mi>Good</mi>
</mrow>
<mrow>
<mi>Valid</mi>
</mrow>
</mfrac>
<mrow>
<mo>×</mo>
<mn>100</mn>
</mrow>
</mrow>
</math>
<p>
You can read more about the definition of
<ext-link href="https://blog.alexewerlof.com/p/sli-good">Good</ext-link>
and
<ext-link href="https://blog.alexewerlof.com/p/valid-vs-total">Valid</ext-link>
.
</p>
<p>
Common SLIs include latency, availability, yield, durability, correctness, etc.
</p>
</help-component>
</h1>
🎉Tip: <ext-link href="templates/index.html">Use Templates</ext-link>
<h3>
<label for="sli-title-input">Title</label>
</h3>
<input id="sli-title-input" type="text" v-model="title" :placeholder="config.title.placeholder">
<h3>
<label for="sli-description-input">Description</label>
</h3>
<textarea
id="sli-description-input"
rows="2"
type="text"
v-model="description"
:placeholder="config.description.placeholder"></textarea>
<h2>
Type
<help-component>
<p>
SLIs can either be either:
<ext-link href="https://blog.alexewerlof.com/p/time-based-vs-event-based">
event-based or time-based
</ext-link>.
</p>
<table>
<caption>Comparing SLI Types</caption>
<thead>
<tr>
<th></th>
<th>Event-Based</th>
<th>Time-Based</th>
</tr>
</thead>
<tbody>
<tr>
<td>Use</td>
<td>When consumers perceive reliability by events</td>
<td>When consumers perceive reliability by time</td>
</tr>
<tr>
<td>Counts</td>
<td>Good events</td>
<td>Good timeslices</td>
</tr>
<tr>
<td>Advantage</td>
<td>More accurately adjust to the amount of load</td>
<td>More forgiving towards the negative impact of failed events</td>
</tr>
<tr>
<td>Formula</td>
<td>
<math>
<mrow>
<mfrac>
<mrow><mi>Good events</mi></mrow>
<mrow><mi>Valid events</mi></mrow>
</mfrac>
<mrow><mo>×</mo><mn>100</mn></mrow>
</mrow>
</math>
</td>
<td>
<math>
<mrow>
<mfrac>
<mrow><mi>Good timeslices</mi></mrow>
<mrow><mi>All timeslices</mi></mrow>
</mfrac>
<mrow><mo>×</mo><mn>100</mn></mrow>
</mrow>
</math>
</tr>
</tbody>
</table>
</help-component>
</h2>
<div class="block">
<p>
<label>
<input
type="radio"
v-model="isTimeBased"
:value="false">
Event-Based
</label>
</p>
<p>
<label>
<input
type="radio"
v-model="isTimeBased"
:value="true">
Time-Based
</label>
</p>
</div>
<div v-if="isTimeBased">
<!-- SLI timeslice -->
<h2>
<label for="sli-event-unit">Timeslice: {{ timeslice }}</label>
<help-component>
<p>
Time-based SLIs aggregate metric data over a timeslice
to mark it as success or failure.
</p>
<p>
This can also reduce the resolution of the data.
For example, probing an endpoint every 60 seconds to see if it is available,
assumes that the endpoint is available for the entire 60 seconds.
</p>
<p>
Another common example is to compare the average of data points with a desired
valud. Averages hide the spikes and valleys in the data.
It is better to use
<ext-link href="https://github.com/alexewerlof/percentile">percentiles</ext-link>
instead.
</p>
<p>
Another example is percentiles. When calculating the 99th percentile of the
latency every 5 minutes, the aggregation window is 5 x 60 = 300 seconds.
</p>
<table>
<caption>Typical timeslice lengths</caption>
<thead>
<tr>
<th>Timeslice</th>
<th>Seconds</th>
<th aria-label="try button"></th>
</tr>
</thead>
<tbody>
<tr v-for="p in config.timeslice.presets">
<td>{{ p.title }}</td>
<td>{{ p.seconds }}</td>
<td><button type="button" @click="unit = p.seconds">Try!</button></td>
</tr>
</tbody>
</table>
</help-component>
</h2>
<input
id="sli-event-unit"
type="range"
:min="config.timeslice.min"
:max="config.timeslice.max"
:step="config.timeslice.step"
placeholder="60"
v-model.number="timeslice">
</div>
<div v-else class="block">
<h2>
<label for="sli-event-unit">
Valid events
</label>
<help-component>
<p>
How do consumers perceive reliability of your service?
What kind of events are important to the service consumers?
</p>
<p>
You probably don't want to count all the.
This is an opportunity to narrow down the scope of the optimization
and what triggers an alert.
</p>
<p>
For simplicity, sometimes <em>total</em> is used instead of <em>valid</em>.
But
<ext-link href="https://blog.alexewerlof.com/p/valid-vs-total">
there is a difference
</ext-link>.
</p>
<p>
While
<ext-link href="https://blog.alexewerlof.com/p/sli">
Service level indicator
</ext-link>
guides the optimization,
the definition of valid scopes that optimization for two reasons:
<ul>
<li>Focus the optimization effort</li>
<li>Clarify responsibility and control</li>
</ul>
</p>
<p>
Note: use a plural form of the event name so that the UI reads more fluently.
</p>
<table>
<caption>Common events</caption>
<thead>
<th>Event</th>
<th>Use case</th>
<th aria-label="try button"></th>
</thead>
<tbody>
<tr v-for="p of config.eventUnit.presets">
<td>{{ p.eventUnit }}</td>
<td>{{ p.useCase }}</td>
<td><button type="button" @click="eventUnit = p.eventUnit">Try!</button></td>
</tr>
</tbody>
</table>
</help-component>
</h2>
<input
id="sli-event-unit"
type="text"
v-model="eventUnit"
>
</div>
<!-- SLI: Good -->
<h2>Good {{ sloWindow.eventUnitNorm }}</h2>
<h3>
<label for="sli-metric-name">Metric name</label>
<help-component>
<p>
<ext-link href="https://blog.alexewerlof.com/p/sli-good">
What are good {{ sloWindow.eventUnitNorm }}
</ext-link>
from consumer's perspective?
How do good {{ sloWindow.eventUnitNorm }} look like?
</p>
<p>
What is the metric that you can measure to identify the
good {{ sloWindow.eventUnitNorm }} from all the valid {{ sloWindow.eventUnitNorm }}?
</p>
</help-component>
</h3>
<input
id="sli-metric-name"
type="text"
v-model="metricName">
<h3>
<label for="sli-metric-unit">Metric Unit</label>
<help-component>
<p>
This is the unit of the metric (
<label for="sli-metric-name">
<code>{{ metricName }}</code>
</label>) not to be confused
with the unit of the events (
<label for="sli-event-unit">
<code>{{ sloWindow.eventUnitNorm }}</code>
</label>).
</p>
</help-component>
</h3>
<input
id="sli-metric-unit"
type="text"
v-model="metricUnit"
:placeholder="config.metricUnit.placeholder">
<div class="block">
<label>
<input type="checkbox" id="sli-good-boundaries" v-model="showBounds" :disabled="isBounded">
Show boundaries
</label>
<help-component>
<p>What metric values define a good {{ sloWindow.eventUnitNorm }}?</p>
<p>
The actual thresholds are part of the SLO definition.
This allows
<ext-link href="https://blog.alexewerlof.com/p/multi-tiered-slos">
Multi-Tierd SLOs
</ext-link>
where different expectations have different commitments.
</p>
</help-component>
</div>
<div v-if="showBounds">
<h4>
<label for="lower-bound-type">Lower Bound</label>
<help-component>
<p>
<ext-link href="https://blog.alexewerlof.com/p/sli-good">
Good
</ext-link>
values can be bound.
</p>
<p>
The actual
<label for="lower-threshold-input">Lower Threshold (<code>$LT</code>)</label>
is part of the SLO definition.
</p>
</help-component>
</h4>
<div class="warning block" v-if="lowerBound && hasComparators(metricName)">
<p>
There seems to be a comparator in the definition of metric already:
<label for="sli-metric-name">
<code>{{ metricName }}</code>
</label>.
</p>
<p>
Having another bound makes the formula harder to read.
Please use only one way to set the boundaries.
</p>
</div>
<select
id="lower-bound-type"
v-model="lowerBound">
<option v-for="v of config.lowerBound.possibleValues"
:value="v">
{{ boundCaption(metricName, v, '$LT') }}
</option>
</select>
<h4>
<label for="upper-bound-type">Upper Bound</label>
<help-component>
<p>
<ext-link href="https://blog.alexewerlof.com/p/sli-good">
Good
</ext-link>
values can be bound.
</p>
<p>
The actual
<label for="upper-threshold-input">Upper Threshold (<code>$UT</code>)</label>
is part of the SLO definition.
</p>
</help-component>
</h4>
<div class="warning block" v-if="upperBound && hasComparators(metricName)">
<p>
There seems to be a comparator in the definition of metric already:
<label for="sli-metric-name">
<code>{{ metricName }}</code>
</label>.
</p>
<p>
Having another bound makes the formula harder to read.
Please use only one way to set the boundaries.
</p>
</div>
<select
id="upper-bound-type"
v-model="upperBound">
<option v-for="v of config.upperBound.possibleValues"
:value="v">
{{ boundCaption(metricName, v, '$UT') }}
</option>
</select>
</div>
<!-- Service Level Formula -->
<h2>
Service Level Formula
<help-component>
<p>
The formula for calculating SLI for the given SLO window is
the percentage of good per valid.
</p>
<p>
Depending on whether the SLI is
<ext-link href="https://blog.alexewerlof.com/p/time-based-vs-event-based">time-based or event-based</ext-link>,
the formula calculates the percentage of bad time or bad events.
</p>
<math>
<mrow>
<mi>SLI</mi>
<mo>=</mo>
<mfrac>
<mrow>
<mi>Good {{ sloWindow.eventUnitNorm }}</mi>
</mrow>
<mrow>
<mi>Valid {{ sloWindow.eventUnitNorm }}</mi>
</mrow>
</mfrac>
<mrow>
<mo>×</mo>
<mn>100</mn>
</mrow>
</mrow>
</math>
</help-component>
</h2>
<div class="code block">
<div id="sli-formula-code">
<s-l-fraction-component
:event-unit="sloWindow.eventUnitNorm"
:lower-bound="lowerBound"
lower-threshold="$LT"
:metric-name="metricName"
:upper-bound="upperBound"
upper-threshold="$UT"
:eventUnit="eventUnit"
time-period="SLO Window"
time-label-id="slo-window-unit-multiplier"></s-l-fraction-component>
</div>
<button @click="copy('sli-formula-code', 'sli-formula')" type="button" title="Copy to clipboard">⎘</button>
</div>
</section>
<!------------------------ SLO ------------------------>
<section>
<h1 id="slo-title">
<label for="slo-int-input">
SLO: {{ percL10n(slo) }}
</label>
<help-component>
<p>
Service Level Objective (SLO) is the target percentage of
good {{ sloWindow.eventUnitNorm }}
out of total {{ sloWindow.eventUnitNorm }}
in {{ sloWindow }}.
</p>
<p>
Using the two sliders below you can fine tune the SLO to your needs.
The first slider is for the integer part of the percentage ({{ percL10n(sloInt) }}).
The second slider is for the fractional part of the percentage ({{ percL10n(sloFrac) }}).
</p>
<table>
<caption>Typical SLO values</caption>
<thead>
<tr>
<th>Informal Name</th>
<th>SLO Value</th>
<th aria-label="try button"></th>
</tr>
</thead>
<tbody>
<tr v-for="p in config.slo.presets">
<td>{{ p.title }}</td>
<td>{{percL10n(p.slo)}}</td>
<td><button type="button" @click="slo = p.slo">Try!</button></td>
</tr>
</tbody>
</table>
</help-component>
</h1>
<div v-if="slo > 99.9" class="info block">
<p>
Note: Just be mindful of the price tag for this high service level <em>objective</em>!
</p>
<p>
Everyone wants the highest possible number but
<ext-link href="https://blog.alexewerlof.com/p/10x9">
not everyone is willing to pay the price.
</ext-link>
</p>
</div>
<div v-if="slo < 70" class="info block">
<p>
Note: this is an unusually low service level objective.
Typically service level <em>objective</em> is above {{ percL10n(90) }} with some rare exceptions.
Please check the <a href="#error-budget-title">Error budget</a> for implications of your chosen SLO.
</p>
</div>
<input
id="slo-int-input"
type="range"
:min="config.slo.min"
max="99"
v-model.number="sloInt"
>
<h3>
<label for="slo-frac-input">Fraction: {{ percL10n(sloFrac) }}</label>
<help-component>
<p>
This slider allows fine tuning the SLO.
It is mostly for convenience when deciding a reasonable error budget
while keeping an eye on it.
</p>
<table>
<thead>
<tr>
<th>{{ sloInt }}.XYZ</th>
<th>Subtract</th>
<th>Add</th>
</tr>
</thead>
<tbody>
<tr>
<th>X</th>
<td><button type="button" @click="changeSLO(-0.1)">{{ percL10n(-0.1) }}</button></td>
<td><button type="button" @click="changeSLO(0.1)">{{ percL10n(+0.1) }}</button></td>
</tr>
<tr>
<th>Y</th>
<td><button type="button" @click="changeSLO(-0.01)">{{ percL10n(-0.01) }}</button></td>
<td><button type="button" @click="changeSLO(0.01)">{{ percL10n(+0.01) }}</button></td>
</tr>
<tr>
<th>Z</th>
<td><button type="button" @click="changeSLO(-0.001)">{{ percL10n(-0.001) }}</button></td>
<td><button type="button" @click="changeSLO(0.001)">{{ percL10n(+0.001) }}</button></td>
</tr>
<tr>
<th>XYZ</th>
<td colspan="2"><button type="button" @click="sloFrac = 0">reset</button></td>
</tr>
</tbody>
</table>
</help-component>
</h3>
<input
id="slo-frac-input"
type="range"
min="0"
max="0.999"
step="0.001"
v-model.number="sloFrac"
>
<!-- SLO Window -->
<h2>
<label for="slo-window-unit-multiplier">
Window:
{{ windowDays }} days
</label>
<help-component>
<p>
The SLO window (also known as the
<ext-link href="https://blog.alexewerlof.com/p/compliance-period">compliance period</ext-link>)
is the time period
for which the SLO is calculated.
</p>
<p>
Essentially this adjusts the <em>forgiveness</em> of the SLO.
For example if the window is 30 days, we are not concerned with any incidents
and breaches of SLO that happened before that.
</p>
<p>
Smaller windows also help prevent the error budget from accumulating too much.
For example, if the SLO is 99% for a time-based Availability SLI (uptime),
the error budget allows 432 minutes of downtime per month.
This amount can be consumed in multiple down times during the month or one chunk of long downtime.
But the same SLO allows only 100 minutes of downtime per week.
</p>
<p>
It is usually 30 days or 4 weeks.
</p>
<p>
You can play with different ranges to see how a given SLO translates to different
good {{ sloWindow.eventUnitNorm }} and how it impacts the error budget.
</p>
<table>
<caption>Typical compliance periods</caption>
<thead>
<tr>
<th>Window</th>
<th>Days</th>
<th>Advantage</th>
<th aria-label="try button"></th>
</tr>
</thead>
<tbody>
<tr v-for="p of config.windowDays.presets">
<td>{{ p.title }}</td>
<td>{{ p.days }}</td>
<td>{{ p.useCase }}</td>
<td><button type="button" @click="windowDays=p.days">Try!</button></td>
</tr>
</tbody>
</table>
</help-component>
</h2>
<p>
{{ sloWindow }}
</p>
<input
type="range"
:min="config.windowDays.min"
:max="config.windowDays.max"
:step="config.windowDays.step"
v-model.number="windowDays"
id="slo-window-unit-multiplier"
>
<div v-if="isBounded && showBounds">
<h2>
Thresholds
<label for="sli-metric-name">{{ eventUnit }}</label>
<help-component>
<p>
The thresholds are the values that put boundaries on the
values of {{ metricName }}
to define good {{ sloWindow.eventUnitNorm }}.
</p>
<p>
They are part of the SLO definition and allow for
<ext-link href="https://blog.alexewerlof.com/p/multi-tiered-slos">
Multi-Tierd SLOs
</ext-link>.
</p>
</help-component>
</h2>
<div class="block" v-if="lowerBound">
<h3>
<label for="lower-threshold-input">$LT
<span v-if="metricUnit">
(<code>{{ metricUnit }}</code>)
</span>
</label>
<help-component>
<p>
The lower threshold (LT) defines the minimum possible values
for the {{ metricName }}
<span v-if="metricUnit">
(in <label for="sli-metric-unit"><code>{{ metricUnit }}</code></label>)
</span>
to indicate good {{ sloWindow.eventUnitNorm }}.
</p>
<p>
LT is part of the SLO definition and for example allows for
<ext-link href="https://blog.alexewerlof.com/p/multi-tiered-slos">
Multi-Tierd SLOs
</ext-link>.
</p>
</help-component>
</h3>
<input type="number"
id="lower-threshold-input"
v-model.number="lowerThreshold"
:min="config.lowerThreshold.min"
:max="lowerThresholdMax"
:step="config.lowerThreshold.step">
</div>
<div class="block" v-if="upperBound">
<h3>
<label for="upper-threshold-input">$UT
<span v-if="metricUnit">
(<code>{{ metricUnit }}</code>)
</span>
</label>
<help-component>
<p>
The upper threshold (UT) defines the maximum possible values
for the {{ metricName }}
<span v-if="metricUnit">
(in <label for="sli-metric-unit"><code>{{ metricUnit }}</code></label>)
</span>
to indicate good {{ sloWindow.eventUnitNorm }}.
</p>
<p>
UT is part of the SLO definition and for example allows for
<ext-link href="https://blog.alexewerlof.com/p/multi-tiered-slos">
Multi-Tierd SLOs
</ext-link>.
</p>
</help-component>
</h3>
<input type="number"
id="upper-threshold-input"
v-model.number="upperThreshold"
:min="upperThresholdMin"
:max="config.upperThreshold.max"
:step="config.upperThreshold.step">
</div>
<div class="warning block" v-if="upperThreshold <= lowerThreshold">
<p>
The upper threshold must be greater than the lower threshold.
</p>
</div>
</div>
<h2>
Service Level Status
<help-component>
<p>
<ext-link href="https://blog.alexewerlof.com/p/sls">
Service Level Status (SLS)
</ext-link>
is the percentage of good
{{ sloWindow.eventUnitNorm }} in a given time.
</p>
<p>
SLS is the status of the Service Level and directly relates to SLO.
Whenever SLS is below SLO, we have breached the SLO.
In case of <ext-link href="https://blog.alexewerlof.com/p/sla">SLA</ext-link>,
this may have severe consequences.
</p>
</help-component>
</h2>
<div class="code block">
<div id="sli-formula-code">
<s-l-fraction-component
:event-unit="sloWindow.eventUnitNorm"
:lower-bound="lowerBound"
:lower-threshold="lowerThreshold"
:metric-name="metricName"
:metric-unit="metricUnit"
:upper-bound="upperBound"
:upper-threshold="upperThreshold"
:eventUnit="eventUnit"
:time-period="sloWindow.humanSec"
time-label-id="slo-window-unit-multiplier"></s-l-fraction-component>
</div>
<button @click="copy('sli-formula-code', 'sli-formula')" type="button" title="Copy to clipboard">⎘</button>
</div>
<!------------------------ Error budget ------------------------>
<h1 id="error-budget-title">
Error budget:
<label for="slo-int-input">
{{ percL10n(errorBudgetPerc) }}
</label>
<help-component>
<p>
Error budget is one of the core ideas behind using SLI/SLOs to improve reliability.
Instead of denying or forbidding errors, error budget allows the system to fail
within a pre-defined limit.
</p>
<p>
The number one enemy of reliability is change.
But we need change to be able to improve the system.
Error budgets do exactly that.
They provide a budget of error for the team to improve the system while keeping
the consumers happy enough.
</p>
<p>
Error budget is the complement of SLO.
It is the percentage of bad {{ sloWindow.eventUnitNorm }} that you can have
before you violate the SLO.
</p>
<math>
<mtable>
<mtr>
<mtd>
<mi>error_budget</mi>
</mtd>
<mtd>
<mo>=</mo>
<mn>100</mn>
<mo>-</mo>
<mi>SLO</mi>
</mtd>
</mtr>
<mtr>
<mtd></mtd>
<mtd>
<mo>=</mo>
<mn>{{ percL10n(100) }}</mn>
<mo>-</mo>
<mi>{{ percL10n(slo) }}</mi>
<mo>=</mo>
<mn>{{ percL10n(errorBudgetPerc) }}</mn>
</mtd>
</mtr>
</mtable>
</math>
<table>
<thead>
<tr>
<th></th>
<th>Subtract</th>
<th>Add</th>
</tr>
</thead>
<tbody>
<tr>
<th>{{ numL10n(1) }}</th>
<td><button type="button" @click="changeErrorBudget(-1)">{{ numL10n(-1) }}</button></td>
<td><button type="button" @click="changeErrorBudget(1)">{{ numL10n(1) }}</button></td>
</tr>
<tr>
<th>{{ numL10n(10) }}</th>
<td><button type="button" @click="changeErrorBudget(-10)">{{ numL10n(-10) }}</button></td>
<td><button type="button" @click="changeErrorBudget(10)">{{ numL10n(10) }}</button></td>
</tr>
<tr>
<th>{{ numL10n(100) }}</th>
<td><button type="button" @click="changeErrorBudget(-100)">{{ numL10n(-100) }}</button></td>
<td><button type="button" @click="changeErrorBudget(100)">{{ numL10n(100) }}</button></td>
</tr>
<tr>
<th>{{ numL10n(1000) }}</th>
<td><button type="button" @click="changeErrorBudget(-1000)">{{ numL10n(-1000) }}</button></td>
<td><button type="button" @click="changeErrorBudget(1000)">{{ numL10n(1000) }}</button></td>
</tr>
<tr>
<th>{{ numL10n(10000) }}</th>
<td><button type="button" @click="changeErrorBudget(-10000)">{{ numL10n(-10000) }}</button></td>
<td><button type="button" @click="changeErrorBudget(10000)">{{ numL10n(10000) }}</button></td>
</tr>
</tbody>
</table>
</help-component>
</h1>
<div class="warning block" v-if="errorBudget.eventCount === 0" aria-colcount="warning block">
<p>
Warning: The error budget is 0 based on your estimated number of valids {{ sloWindow.eventUnitNorm }}.
</p>
</div>
<error-budget-component
:error-budget="errorBudget"
:error-budget-perc="errorBudgetPerc"
:good-event-count="goodEventCount"
:valid-event-count="validEventCount">
</error-budget-component>
<div v-if="!isTimeBased">
<h3>
<label for="estimated-valid-events-input">
Expected number of
</label>
<label for="sli-event-unit">
<code>{{ eventUnit }}</code>
</label>
in
<label for="slo-window-unit-multiplier">
{{ sloWindow.humanTime }}
</label>
<help-component>
Here you can enter the numbers for your expected load and see
how many {{ eventUnit }} are allowed to fail during the SLO window
while still being within the error budget.
</help-component>
</h3>
<input
type="number"
v-model.number="estimatedValidEvents"
id="estimated-valid-events-input"
:min="config.estimatedValidEvents.min"
:max="config.estimatedValidEvents.max"
:step="config.estimatedValidEvents.step">
</div>
<h3>
<label for="bad-event-cost-input">Average cost of failed</label>
<label for="sli-event-unit">
<code>{{ sloWindow.eventUnitNorm }}</code>
</label>
<help-component>
<p>
How much does a bad
<label for="sli-event-unit">
<code>{{ sloWindow.eventUnitNorm }}</code>
</label>
cost the business or your team?
</p>
<p>
This cost will be used to put a tangible number on various windows and events.
It might be hard to put a number on failures especially if some resilience patterns are part of the architecture.
</p>
<p>
There are many ways to make the failures cheaper.
In a future article, we will discuss all patterns of reliability and how to make errors cheap.
In the mean time check out the following techniques:
</p>
<ul>
<li>
<ext-link href="https://blog.alexewerlof.com/p/fallback">Fallback</ext-link>
</li>
<li>
<ext-link href="https://blog.alexewerlof.com/p/failover">Failover</ext-link>
</li>
</ul>
</help-component>
</h3>
<input type="number"
id="bad-event-cost-input"
v-model.number="badEventCost"
:min="config.badEventCost.min"
:max="config.badEventCost.max"
:step="config.badEventCost.step">
<h4>
<label for="bad-event-currency-input">Currency</label>
<help-component>
<p>
You can set the currency to see how much it costs to violate the SLO.
If you can't put a currency on the errors, feel free to get creative.
</p>
<table>
<caption>Typical Currencies</caption>
<tr>
<th>Abbreviation</th>
<th>Description</th>
<th></th>
</tr>
<tr v-for="p of config.badEventCurrency.presets">
<td>{{ p.currency }}</td>
<td>{{ p.description }}</td>
<td><button type="button" @click="badEventCurrency = p.currency">Try!</button></td>
</table>
</help-component>
</h4>
<input
id="bad-event-currency-input"
type="text"
v-model="badEventCurrency">
</section>
<!------------------------ Alert ------------------------>
<section>
<h1 id="alert-title">
Alerting
<help-component>
<p>