summaryrefslogtreecommitdiffstats
path: root/tools/grafana/alerting/alerts.yml
blob: a6679e2989ca54f2ead32365af9c3738a9d522c3 (plain)
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
---
apiVersion: 1
groups:
  - folder: awx
    interval: 60s
    name: awx_rules
    orgId: 1
    rules:
      - condition: if_failures_too_high
        dashboardUid: awx
        data:
          - refId: total_errors
            queryType: ''
            relativeTimeRange:
              from: 600
              to: 0
            datasourceUid: awx_prometheus
            model:
              editorMode: code
              expr: >-
                max(delta(awx_instance_status_total{instance="awx1:8013",
                status="failed|error"}[30m]))
              hide: false
              intervalMs: 1000
              legendFormat: __auto
              maxDataPoints: 43200
              range: true
              refId: total_errors
          - refId: max_errors
            queryType: ''
            relativeTimeRange:
              from: 0
              to: 0
            datasourceUid: '-100'
            model:
              conditions:
                - evaluator:
                    params:
                      - 80
                      - 0
                    type: gt
                  operator:
                    type: and
                  query:
                    params:
                      - total_errors
                  reducer:
                    params: []
                    type: max
                  type: query
              datasource:
                name: Expression
                type: __expr__
                uid: __expr__
              expression: total_errors
              hide: false
              intervalMs: 1000
              maxDataPoints: 43200
              reducer: max
              refId: max_errors
              type: reduce
          - refId: total_success
            queryType: ''
            relativeTimeRange:
              from: 600
              to: 0
            datasourceUid: awx_prometheus
            model:
              datasource:
                type: prometheus
                uid: awx_prometheus
              editorMode: code
              expr: >-
                max(delta(awx_instance_status_total{instance="awx1:8013",
                status="successful"}[30m]))
              hide: false
              intervalMs: 1000
              legendFormat: __auto
              maxDataPoints: 43200
              range: true
              refId: total_success
          - refId: max_success
            queryType: ''
            relativeTimeRange:
              from: 0
              to: 0
            datasourceUid: '-100'
            model:
              conditions:
                - evaluator:
                    params:
                      - 0
                      - 0
                    type: gt
                  operator:
                    type: and
                  query:
                    params:
                      - total_success
                  reducer:
                    params: []
                    type: max
                  type: query
              datasource:
                name: Expression
                type: __expr__
                uid: __expr__
              expression: total_success
              hide: false
              intervalMs: 1000
              maxDataPoints: 43200
              reducer: max
              refId: max_success
              type: reduce
          - refId: compare
            queryType: ''
            relativeTimeRange:
              from: 0
              to: 0
            datasourceUid: '-100'
            model:
              conditions:
                - evaluator:
                    params:
                      - 0
                      - 0
                    type: gt
                  operator:
                    type: and
                  query:
                    params:
                      - max_success
                  reducer:
                    params: []
                    type: avg
                  type: query
                - evaluator:
                    params:
                      - 0
                      - 0
                    type: gt
                  operator:
                    type: and
                  query:
                    params:
                      - max_success
                  reducer:
                    params: []
                    type: avg
                  type: query
              datasource:
                name: Expression
                type: __expr__
                uid: __expr__
              expression: $max_errors / ($max_errors+$max_success) >= .2
              hide: false
              intervalMs: 1000
              maxDataPoints: 43200
              refId: compare
              type: math
        for: 30m
        noDataState: OK
        panelId: 2
        title: failure_rate_exceeded_20_percent
        uid: failure_rate_exceeded_20_percent
      - condition: if_redis_queue_too_large
        dashboardUid: awx
        data:
          - datasourceUid: awx_prometheus
            model:
              editorMode: code
              expr: irate(callback_receiver_events_insert_db{node='awx_1'}[1m])
              hide: false
              intervalMs: 1000
              legendFormat: __auto
              maxDataPoints: 43200
              range: true
              refId: events_insertion_rate_per_second
            queryType: ""
            refId: events_insertion_rate_per_second
            relativeTimeRange:
              from: 300
              to: 0
          - datasourceUid: -100
            model:
              conditions:
                - evaluator:
                    params:
                      - 3
                    type: gt
                  operator:
                    type: and
                  query:
                    params:
                      - event_insertion_rate
                  reducer:
                    params: []
                    type: last
                  type: query
              datasource:
                type: __expr__
                uid: -100
              expression: events_insertion_rate_per_second
              hide: false
              intervalMs: 1000
              maxDataPoints: 43200
              reducer: mean
              refId: mean_event_insertion_rate
              type: reduce
            queryType: ""
            refId: mean_event_insertion_rate
            relativeTimeRange:
              from: 0
              to: 0
          - datasourceUid: awx_prometheus
            model:
              datasource:
                type: prometheus
                uid: awx_prometheus
              editorMode: code
              expr: callback_receiver_events_queue_size_redis{node='awx_1'}
              hide: false
              intervalMs: 1000
              legendFormat: __auto
              maxDataPoints: 43200
              range: true
              refId: redis_queue_size
            queryType: ""
            refId: redis_queue_size
            relativeTimeRange:
              from: 300
              to: 0
          - datasourceUid: -100
            model:
              conditions:
                - evaluator:
                    params:
                      - 3
                    type: gt
                  operator:
                    type: and
                  query:
                    params:
                      - event_insertion_rate
                  reducer:
                    params: []
                    type: last
                  type: query
              datasource:
                type: __expr__
                uid: -100
              expression: redis_queue_size
              hide: false
              intervalMs: 1000
              maxDataPoints: 43200
              reducer: last
              refId: last_redis_queue_size
              type: reduce
            queryType: ""
            refId: last_redis_queue_size
            relativeTimeRange:
              from: 0
              to: 0
          - datasourceUid: -100
            model:
              conditions:
                - evaluator:
                    params:
                      - 0
                      - 0
                    type: gt
                  operator:
                    type: and
                  query:
                    params:
                      - last_redis_queue_size
                  reducer:
                    params: []
                    type: avg
                  type: query
              datasource:
                name: Expression
                type: __expr__
                uid: __expr__
              expression: '($last_redis_queue_size > ($mean_event_insertion_rate * 120))'
              hide: false
              intervalMs: 1000
              maxDataPoints: 43200
              refId: redis_queue_growing_faster_than_insertion_rate
              type: math
            queryType: ""
            refId: redis_queue_growing_faster_than_insertion_rate
            relativeTimeRange:
              from: 0
              to: 0
        for: 60s
        noDataState: OK
        panelId: 1
        title: redis_queue_too_large_to_clear_in_2_min
        uid: redis_queue_too_large_to_clear_in_2_min
      - condition: if_capacity_is_too_low
        dashboardUid: awx
        no_data_state: OK
        exec_err_state: Error
        data:
          - refId: remaining_capacity
            queryType: ''
            relativeTimeRange:
              from: 1800
              to: 0
            datasourceUid: awx_prometheus
            model:
              editorMode: builder
              expr: awx_instance_remaining_capacity{instance="awx1:8013"}
              hide: false
              intervalMs: 1000
              legendFormat: __auto
              maxDataPoints: 43200
              range: true
              refId: remaining_capacity
          - refId: if_capacity_is_too_low
            queryType: ''
            relativeTimeRange:
              from: 0
              to: 0
            datasourceUid: "-100"
            model:
              conditions:
                - evaluator:
                    params:
                      - 20
                      - 0
                    type: lt
                  operator:
                    type: when
                  query:
                    params:
                      - remaining_capacity
                  reducer:
                    params: []
                    type: avg
                  type: query
              datasource:
                name: Expression
                type: __expr__
                uid: __expr__
              expression: remaining_capacity
              hide: false
              intervalMs: 1000
              maxDataPoints: 43200
              refId: if_capacity_is_too_low
              type: classic_conditions
        for: 30m
        title: if_capacity_is_too_low
        uid: if_capacity_is_too_low