@@ -103,6 +103,8 @@ type SLI struct {
103
103
Events * SLIEvents `yaml:"events,omitempty"`
104
104
// Plugin is the pluggable SLI type.
105
105
Plugin * SLIPlugin `yaml:"plugin,omitempty"`
106
+ // DenominatorCorrected is the denominator corrected events SLI type.
107
+ DenominatorCorrected * SLIDenominatorCorrected `yaml:"denominator_corrected,omitempty"`
106
108
}
107
109
108
110
// SLIRaw is a error ratio SLI already calculated. Normally this will be used when the SLI
@@ -133,6 +135,29 @@ type SLIPlugin struct {
133
135
Options map [string ]string `yaml:"options"`
134
136
}
135
137
138
+ // SLIDenominatorCorrected is an SLI that is calculated as the division of bad events and total events, or
139
+ // 1 - (good / total) events giving a ratio SLI. This SLI is corrected based on the total number of events
140
+ // for the last 30d, meaning that low-event hours will have less impact on burn-rate than high-event hours.
141
+ // In other words, ratios with low denominators will have less impact.
142
+ type SLIDenominatorCorrected struct {
143
+ // ErrorQuery is a Prometheus query that will get the number/count of events
144
+ // that we consider that are bad for the SLO (e.g "http 5xx", "latency > 250ms"...).
145
+ // Requires the usage of `{{.window}}` template variable. ErrorQuery and
146
+ // SuccessQuery are mutually exclusive.
147
+ ErrorQuery * string `yaml:"errorQuery,omitempty"`
148
+
149
+ // SuccessQuery is a Prometheus query that will get the number/count of events
150
+ // that we consider that are good for the SLO (e.g "http not 5xx", "latency < 250ms"...).
151
+ // Requires the usage of `{{.window}}` template variable. ErrorQuery and
152
+ // SuccessQuery are mutually exclusive.
153
+ SuccessQuery * string `yaml:"successQuery,omitempty"`
154
+
155
+ // TotalQuery is a Prometheus query that will get the total number/count of events
156
+ // for the SLO (e.g "all http requests"...).
157
+ // Requires the usage of `{{.window}}` template variable.
158
+ TotalQuery string `yaml:"totalQuery"`
159
+ }
160
+
136
161
// Alerting wraps all the configuration required by the SLO alerts.
137
162
type Alerting struct {
138
163
// Name is the name used by the alerts generated for this SLO.
0 commit comments