-
Notifications
You must be signed in to change notification settings - Fork 3
/
config.js
253 lines (251 loc) · 6.09 KB
/
config.js
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
function fz(obj) {
if (Array.isArray(obj)) {
return Object.freeze(obj.map(fz))
}
return Object.freeze(obj)
}
// The config is immutable at runtime and any effort to change it will have no effect
export const config = fz({
title: fz({
default: '',
placeholder: 'My SLI',
}),
description: fz({
default: '',
placeholder: 'Description for my SLI',
}),
unit: fz({
default: 'events',
presets: fz([
{
unit: 'events',
useCase: 'When the unit of Good and Bad events are different (default)',
},
{
unit: 'requests',
useCase: 'REST/GraphQL servers, serverless functions, ...',
},
{
unit: 'queries',
useCase: 'Databases, LLM models, log servers, ...',
},
{
unit: 'entries',
useCase: 'Storage systems, data processors, ...',
},
{
unit: 'messages',
useCase: 'Queue systems, data pipelines, ...',
},
{
unit: 'page_views',
useCase: 'Web Servers, Document Servers, ...',
},
{
unit: 'logins',
useCase: 'Authentication providers, session servers, ...',
},
{
unit: 'incidents',
useCase: 'Operational teams, ...',
},
{
unit: 'sessions',
useCase: 'UIs supporting user flows, mobile apps, web apps, ...',
},
{
unit: 'transactions',
useCase: 'Transaction services, data pipelines',
},
]),
}),
timeSlot: fz({
min: 1,
max: 3600,
step: 1,
default: 60,
presets: fz([
{
title: '1 second',
seconds: 1,
},
{
title: '1 minute',
seconds: 60,
},
{
title: '3 minutes',
seconds: 180,
},
{
title: '5 minutes',
seconds: 300,
},
{
title: '10 minutes',
seconds: 600,
},
{
title: '15 minutes',
seconds: 900,
},
{
title: '30 minutes',
seconds: 1800,
},
{
title: '1 hour',
seconds: 3600,
},
]),
}),
good: fz({
default: 'successful',
}),
valid: fz({
default: 'all',
}),
slo: fz({
min: 50,
max: 99.999,
default: 99,
presets: fz([
{
title: 'One nine',
slo: 90,
},
{
title: 'One and a half nines',
slo: 95,
},
{
title: 'Two nines',
slo: 99,
},
{
title: 'Two and a half nines',
slo: 99.5,
},
{
title: 'Three nines',
slo: 99.9,
},
{
title: 'Three and a half nines',
slo: 99.95,
},
{
title: 'Four nines',
slo: 99.99,
},
{
title: 'Four and a half nines',
slo: 99.995,
},
{
title: 'Five nines',
slo: 99.999
},
]),
}),
windowDays: fz({
min: 1,
max: 90,
step: 1,
default: 30,
presets: fz([
{
title: '1 week',
days: 7,
useCase: 'Forgives any breach after a week',
},
{
title: '2 weeks',
days: 14,
useCase: 'Maps well to a typical "sprint"',
},
{
title: '4 weeks',
days: 28,
useCase: 'Always start on the same day of the week',
},
{
title: 'A month',
days: 30,
useCase: 'Maps to typical subscription services',
},
{
title: 'A quarter',
days: 90,
useCase: 'Rather unforgiving to breaches in the past',
},
]),
}),
estimatedValidEvents: fz({
min: 1,
max: 1_000_000_000,
step: 1,
default: 1_000_000,
}),
badEventCost: fz({
min: 0,
max: 1000_000_000,
step: 0.01,
default: 0,
}),
badEventCurrency: fz({
default: 'USD',
presets: fz([
{
currency: 'SEK',
description: 'Swedish Krona',
},
{
currency: 'EUR',
description: 'Euros',
},
{
currency: 'USD',
description: 'US Dollars',
},
{
currency: 'GBP',
description: 'British Pounds',
},
{
currency: 'JPY',
description: 'Japanese Yen',
},
{
currency: 'CNY',
description: 'Chinese Yuan',
},
{
currency: '😟',
description: 'Sad customers',
},
{
currency: '🤬',
description: 'Curses in frustration',
}
]),
}),
burnRate: fz({
min: 1,
max: 20,
step: 0.1,
default: 6,
}),
longWindowPerc: fz({
min: 0.1,
max: 99,
step: 0.1,
default: 5,
}),
shortWindowDivider: fz({
min: 2,
max: 20,
step: 1,
default: 12,
}),
})