|
| 1 | + |
| 2 | +--- |
| 3 | +# Code generated by Sloth (dev): https://github.com/slok/sloth. |
| 4 | +# DO NOT EDIT. |
| 5 | + |
| 6 | +groups: |
| 7 | +- name: sloth-slo-sli-recordings-myservice-requests-availability-contrib-plugin-info-labels-v1 |
| 8 | + rules: |
| 9 | + - record: slo:sli_error:ratio_rate5m |
| 10 | + expr: | |
| 11 | + (sum(rate(http_request_duration_seconds_count{job="myservice",code=~"(5..|429)"}[5m]))) |
| 12 | + / |
| 13 | + (sum(rate(http_request_duration_seconds_count{job="myservice"}[5m]))) |
| 14 | + labels: |
| 15 | + cmd: examplesgen.sh |
| 16 | + owner: myteam |
| 17 | + repo: myorg/myservice |
| 18 | + sloth_id: myservice-requests-availability-contrib-plugin-info-labels-v1 |
| 19 | + sloth_service: myservice |
| 20 | + sloth_slo: requests-availability-contrib-plugin-info-labels-v1 |
| 21 | + sloth_window: 5m |
| 22 | + tier: "2" |
| 23 | + - record: slo:sli_error:ratio_rate30m |
| 24 | + expr: | |
| 25 | + (sum(rate(http_request_duration_seconds_count{job="myservice",code=~"(5..|429)"}[30m]))) |
| 26 | + / |
| 27 | + (sum(rate(http_request_duration_seconds_count{job="myservice"}[30m]))) |
| 28 | + labels: |
| 29 | + cmd: examplesgen.sh |
| 30 | + owner: myteam |
| 31 | + repo: myorg/myservice |
| 32 | + sloth_id: myservice-requests-availability-contrib-plugin-info-labels-v1 |
| 33 | + sloth_service: myservice |
| 34 | + sloth_slo: requests-availability-contrib-plugin-info-labels-v1 |
| 35 | + sloth_window: 30m |
| 36 | + tier: "2" |
| 37 | + - record: slo:sli_error:ratio_rate1h |
| 38 | + expr: | |
| 39 | + (sum(rate(http_request_duration_seconds_count{job="myservice",code=~"(5..|429)"}[1h]))) |
| 40 | + / |
| 41 | + (sum(rate(http_request_duration_seconds_count{job="myservice"}[1h]))) |
| 42 | + labels: |
| 43 | + cmd: examplesgen.sh |
| 44 | + owner: myteam |
| 45 | + repo: myorg/myservice |
| 46 | + sloth_id: myservice-requests-availability-contrib-plugin-info-labels-v1 |
| 47 | + sloth_service: myservice |
| 48 | + sloth_slo: requests-availability-contrib-plugin-info-labels-v1 |
| 49 | + sloth_window: 1h |
| 50 | + tier: "2" |
| 51 | + - record: slo:sli_error:ratio_rate2h |
| 52 | + expr: | |
| 53 | + (sum(rate(http_request_duration_seconds_count{job="myservice",code=~"(5..|429)"}[2h]))) |
| 54 | + / |
| 55 | + (sum(rate(http_request_duration_seconds_count{job="myservice"}[2h]))) |
| 56 | + labels: |
| 57 | + cmd: examplesgen.sh |
| 58 | + owner: myteam |
| 59 | + repo: myorg/myservice |
| 60 | + sloth_id: myservice-requests-availability-contrib-plugin-info-labels-v1 |
| 61 | + sloth_service: myservice |
| 62 | + sloth_slo: requests-availability-contrib-plugin-info-labels-v1 |
| 63 | + sloth_window: 2h |
| 64 | + tier: "2" |
| 65 | + - record: slo:sli_error:ratio_rate6h |
| 66 | + expr: | |
| 67 | + (sum(rate(http_request_duration_seconds_count{job="myservice",code=~"(5..|429)"}[6h]))) |
| 68 | + / |
| 69 | + (sum(rate(http_request_duration_seconds_count{job="myservice"}[6h]))) |
| 70 | + labels: |
| 71 | + cmd: examplesgen.sh |
| 72 | + owner: myteam |
| 73 | + repo: myorg/myservice |
| 74 | + sloth_id: myservice-requests-availability-contrib-plugin-info-labels-v1 |
| 75 | + sloth_service: myservice |
| 76 | + sloth_slo: requests-availability-contrib-plugin-info-labels-v1 |
| 77 | + sloth_window: 6h |
| 78 | + tier: "2" |
| 79 | + - record: slo:sli_error:ratio_rate1d |
| 80 | + expr: | |
| 81 | + (sum(rate(http_request_duration_seconds_count{job="myservice",code=~"(5..|429)"}[1d]))) |
| 82 | + / |
| 83 | + (sum(rate(http_request_duration_seconds_count{job="myservice"}[1d]))) |
| 84 | + labels: |
| 85 | + cmd: examplesgen.sh |
| 86 | + owner: myteam |
| 87 | + repo: myorg/myservice |
| 88 | + sloth_id: myservice-requests-availability-contrib-plugin-info-labels-v1 |
| 89 | + sloth_service: myservice |
| 90 | + sloth_slo: requests-availability-contrib-plugin-info-labels-v1 |
| 91 | + sloth_window: 1d |
| 92 | + tier: "2" |
| 93 | + - record: slo:sli_error:ratio_rate3d |
| 94 | + expr: | |
| 95 | + (sum(rate(http_request_duration_seconds_count{job="myservice",code=~"(5..|429)"}[3d]))) |
| 96 | + / |
| 97 | + (sum(rate(http_request_duration_seconds_count{job="myservice"}[3d]))) |
| 98 | + labels: |
| 99 | + cmd: examplesgen.sh |
| 100 | + owner: myteam |
| 101 | + repo: myorg/myservice |
| 102 | + sloth_id: myservice-requests-availability-contrib-plugin-info-labels-v1 |
| 103 | + sloth_service: myservice |
| 104 | + sloth_slo: requests-availability-contrib-plugin-info-labels-v1 |
| 105 | + sloth_window: 3d |
| 106 | + tier: "2" |
| 107 | + - record: slo:sli_error:ratio_rate30d |
| 108 | + expr: | |
| 109 | + sum_over_time(slo:sli_error:ratio_rate5m{sloth_id="myservice-requests-availability-contrib-plugin-info-labels-v1", sloth_service="myservice", sloth_slo="requests-availability-contrib-plugin-info-labels-v1"}[30d]) |
| 110 | + / ignoring (sloth_window) |
| 111 | + count_over_time(slo:sli_error:ratio_rate5m{sloth_id="myservice-requests-availability-contrib-plugin-info-labels-v1", sloth_service="myservice", sloth_slo="requests-availability-contrib-plugin-info-labels-v1"}[30d]) |
| 112 | + labels: |
| 113 | + cmd: examplesgen.sh |
| 114 | + owner: myteam |
| 115 | + repo: myorg/myservice |
| 116 | + sloth_id: myservice-requests-availability-contrib-plugin-info-labels-v1 |
| 117 | + sloth_service: myservice |
| 118 | + sloth_slo: requests-availability-contrib-plugin-info-labels-v1 |
| 119 | + sloth_window: 30d |
| 120 | + tier: "2" |
| 121 | +- name: sloth-slo-meta-recordings-myservice-requests-availability-contrib-plugin-info-labels-v1 |
| 122 | + rules: |
| 123 | + - record: slo:objective:ratio |
| 124 | + expr: vector(0.9990000000000001) |
| 125 | + labels: |
| 126 | + cmd: examplesgen.sh |
| 127 | + owner: myteam |
| 128 | + repo: myorg/myservice |
| 129 | + sloth_id: myservice-requests-availability-contrib-plugin-info-labels-v1 |
| 130 | + sloth_service: myservice |
| 131 | + sloth_slo: requests-availability-contrib-plugin-info-labels-v1 |
| 132 | + tier: "2" |
| 133 | + - record: slo:error_budget:ratio |
| 134 | + expr: vector(1-0.9990000000000001) |
| 135 | + labels: |
| 136 | + cmd: examplesgen.sh |
| 137 | + owner: myteam |
| 138 | + repo: myorg/myservice |
| 139 | + sloth_id: myservice-requests-availability-contrib-plugin-info-labels-v1 |
| 140 | + sloth_service: myservice |
| 141 | + sloth_slo: requests-availability-contrib-plugin-info-labels-v1 |
| 142 | + tier: "2" |
| 143 | + - record: slo:time_period:days |
| 144 | + expr: vector(30) |
| 145 | + labels: |
| 146 | + cmd: examplesgen.sh |
| 147 | + owner: myteam |
| 148 | + repo: myorg/myservice |
| 149 | + sloth_id: myservice-requests-availability-contrib-plugin-info-labels-v1 |
| 150 | + sloth_service: myservice |
| 151 | + sloth_slo: requests-availability-contrib-plugin-info-labels-v1 |
| 152 | + tier: "2" |
| 153 | + - record: slo:current_burn_rate:ratio |
| 154 | + expr: | |
| 155 | + slo:sli_error:ratio_rate5m{sloth_id="myservice-requests-availability-contrib-plugin-info-labels-v1", sloth_service="myservice", sloth_slo="requests-availability-contrib-plugin-info-labels-v1"} |
| 156 | + / on(sloth_id, sloth_slo, sloth_service) group_left |
| 157 | + slo:error_budget:ratio{sloth_id="myservice-requests-availability-contrib-plugin-info-labels-v1", sloth_service="myservice", sloth_slo="requests-availability-contrib-plugin-info-labels-v1"} |
| 158 | + labels: |
| 159 | + cmd: examplesgen.sh |
| 160 | + owner: myteam |
| 161 | + repo: myorg/myservice |
| 162 | + sloth_id: myservice-requests-availability-contrib-plugin-info-labels-v1 |
| 163 | + sloth_service: myservice |
| 164 | + sloth_slo: requests-availability-contrib-plugin-info-labels-v1 |
| 165 | + tier: "2" |
| 166 | + - record: slo:period_burn_rate:ratio |
| 167 | + expr: | |
| 168 | + slo:sli_error:ratio_rate30d{sloth_id="myservice-requests-availability-contrib-plugin-info-labels-v1", sloth_service="myservice", sloth_slo="requests-availability-contrib-plugin-info-labels-v1"} |
| 169 | + / on(sloth_id, sloth_slo, sloth_service) group_left |
| 170 | + slo:error_budget:ratio{sloth_id="myservice-requests-availability-contrib-plugin-info-labels-v1", sloth_service="myservice", sloth_slo="requests-availability-contrib-plugin-info-labels-v1"} |
| 171 | + labels: |
| 172 | + cmd: examplesgen.sh |
| 173 | + owner: myteam |
| 174 | + repo: myorg/myservice |
| 175 | + sloth_id: myservice-requests-availability-contrib-plugin-info-labels-v1 |
| 176 | + sloth_service: myservice |
| 177 | + sloth_slo: requests-availability-contrib-plugin-info-labels-v1 |
| 178 | + tier: "2" |
| 179 | + - record: slo:period_error_budget_remaining:ratio |
| 180 | + expr: 1 - slo:period_burn_rate:ratio{sloth_id="myservice-requests-availability-contrib-plugin-info-labels-v1", |
| 181 | + sloth_service="myservice", sloth_slo="requests-availability-contrib-plugin-info-labels-v1"} |
| 182 | + labels: |
| 183 | + cmd: examplesgen.sh |
| 184 | + owner: myteam |
| 185 | + repo: myorg/myservice |
| 186 | + sloth_id: myservice-requests-availability-contrib-plugin-info-labels-v1 |
| 187 | + sloth_service: myservice |
| 188 | + sloth_slo: requests-availability-contrib-plugin-info-labels-v1 |
| 189 | + tier: "2" |
| 190 | + - record: sloth_slo_info |
| 191 | + expr: vector(1) |
| 192 | + labels: |
| 193 | + cmd: examplesgen.sh |
| 194 | + owner: myteam |
| 195 | + plug-l1: in-k1 |
| 196 | + plug-l2: in-k2 |
| 197 | + plug-l3: in-k3 |
| 198 | + repo: myorg/myservice |
| 199 | + sloth_id: myservice-requests-availability-contrib-plugin-info-labels-v1 |
| 200 | + sloth_mode: cli-gen-prom |
| 201 | + sloth_objective: "99.9" |
| 202 | + sloth_service: myservice |
| 203 | + sloth_slo: requests-availability-contrib-plugin-info-labels-v1 |
| 204 | + sloth_spec: prometheus/v1 |
| 205 | + sloth_version: dev |
| 206 | + tier: "2" |
| 207 | +- name: sloth-slo-alerts-myservice-requests-availability-contrib-plugin-info-labels-v1 |
| 208 | + rules: |
| 209 | + - alert: MyServiceHighErrorRate |
| 210 | + expr: | |
| 211 | + ( |
| 212 | + max(slo:sli_error:ratio_rate5m{sloth_id="myservice-requests-availability-contrib-plugin-info-labels-v1", sloth_service="myservice", sloth_slo="requests-availability-contrib-plugin-info-labels-v1"} > (14.4 * 0.0009999999999999432)) without (sloth_window) |
| 213 | + and |
| 214 | + max(slo:sli_error:ratio_rate1h{sloth_id="myservice-requests-availability-contrib-plugin-info-labels-v1", sloth_service="myservice", sloth_slo="requests-availability-contrib-plugin-info-labels-v1"} > (14.4 * 0.0009999999999999432)) without (sloth_window) |
| 215 | + ) |
| 216 | + or |
| 217 | + ( |
| 218 | + max(slo:sli_error:ratio_rate30m{sloth_id="myservice-requests-availability-contrib-plugin-info-labels-v1", sloth_service="myservice", sloth_slo="requests-availability-contrib-plugin-info-labels-v1"} > (6 * 0.0009999999999999432)) without (sloth_window) |
| 219 | + and |
| 220 | + max(slo:sli_error:ratio_rate6h{sloth_id="myservice-requests-availability-contrib-plugin-info-labels-v1", sloth_service="myservice", sloth_slo="requests-availability-contrib-plugin-info-labels-v1"} > (6 * 0.0009999999999999432)) without (sloth_window) |
| 221 | + ) |
| 222 | + labels: |
| 223 | + category: availability |
| 224 | + routing_key: myteam |
| 225 | + severity: pageteam |
| 226 | + sloth_severity: page |
| 227 | + annotations: |
| 228 | + summary: High error rate on 'myservice' requests responses |
| 229 | + title: (page) {{$labels.sloth_service}} {{$labels.sloth_slo}} SLO error budget |
| 230 | + burn rate is too fast. |
| 231 | + - alert: MyServiceHighErrorRate |
| 232 | + expr: | |
| 233 | + ( |
| 234 | + max(slo:sli_error:ratio_rate2h{sloth_id="myservice-requests-availability-contrib-plugin-info-labels-v1", sloth_service="myservice", sloth_slo="requests-availability-contrib-plugin-info-labels-v1"} > (3 * 0.0009999999999999432)) without (sloth_window) |
| 235 | + and |
| 236 | + max(slo:sli_error:ratio_rate1d{sloth_id="myservice-requests-availability-contrib-plugin-info-labels-v1", sloth_service="myservice", sloth_slo="requests-availability-contrib-plugin-info-labels-v1"} > (3 * 0.0009999999999999432)) without (sloth_window) |
| 237 | + ) |
| 238 | + or |
| 239 | + ( |
| 240 | + max(slo:sli_error:ratio_rate6h{sloth_id="myservice-requests-availability-contrib-plugin-info-labels-v1", sloth_service="myservice", sloth_slo="requests-availability-contrib-plugin-info-labels-v1"} > (1 * 0.0009999999999999432)) without (sloth_window) |
| 241 | + and |
| 242 | + max(slo:sli_error:ratio_rate3d{sloth_id="myservice-requests-availability-contrib-plugin-info-labels-v1", sloth_service="myservice", sloth_slo="requests-availability-contrib-plugin-info-labels-v1"} > (1 * 0.0009999999999999432)) without (sloth_window) |
| 243 | + ) |
| 244 | + labels: |
| 245 | + category: availability |
| 246 | + severity: slack |
| 247 | + slack_channel: '#alerts-myteam' |
| 248 | + sloth_severity: ticket |
| 249 | + annotations: |
| 250 | + summary: High error rate on 'myservice' requests responses |
| 251 | + title: (ticket) {{$labels.sloth_service}} {{$labels.sloth_slo}} SLO error budget |
| 252 | + burn rate is too fast. |
0 commit comments