Update Prometheus recording rules for NG-SA
[osm/devops.git] / installers / k8s / kafka-exporter-dashboard.yaml
1 #   Copyright 2019 Minsait - Indra S.A.
2 #
3 #   Licensed under the Apache License, Version 2.0 (the "License");
4 #   you may not use this file except in compliance with the License.
5 #   You may obtain a copy of the License at
6 #
7 #       http://www.apache.org/licenses/LICENSE-2.0
8 #
9 #   Unless required by applicable law or agreed to in writing, software
10 #   distributed under the License is distributed on an "AS IS" BASIS,
11 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 #   See the License for the specific language governing permissions and
13 #   limitations under the License.
14 #   Author: Jose Manuel Palacios (jmpalacios@minsait.com)
15 #   Author: Jose Antonio Martinez (jamartinezv@minsait.com)
16
17 apiVersion: v1
18 kind: ConfigMap
19 metadata:
20   labels:
21     app: prometheus-kafka-exporter-grafana
22     grafana_dashboard: "1"
23   name: osm-monitoring-prometheus-kafka-exporter-grafana
24   annotations:
25     k8s-sidecar-target-directory: "/tmp/dashboards/Open Source MANO"
26 data:
27   kafka-exporter-dashboard.json: |-
28     {
29       "annotations": {
30         "list": [
31           {
32             "builtIn": 1,
33             "datasource": "-- Grafana --",
34             "enable": true,
35             "hide": true,
36             "iconColor": "rgba(0, 211, 255, 1)",
37             "name": "Annotations & Alerts",
38             "type": "dashboard"
39           }
40         ]
41       },
42       "description": "Kafka resource usage and throughput",
43       "editable": true,
44       "gnetId": 7589,
45       "graphTooltip": 0,
46       "id": 10,
47       "iteration": 1578848023483,
48       "links": [],
49       "panels": [
50         {
51           "aliasColors": {},
52           "bars": false,
53           "dashLength": 10,
54           "dashes": false,
55           "datasource": "Prometheus",
56           "fill": 0,
57           "fillGradient": 0,
58           "gridPos": {
59             "h": 10,
60             "w": 10,
61             "x": 0,
62             "y": 0
63           },
64           "id": 14,
65           "legend": {
66             "alignAsTable": true,
67             "avg": false,
68             "current": true,
69             "max": true,
70             "min": false,
71             "rightSide": false,
72             "show": true,
73             "sideWidth": 480,
74             "sort": "max",
75             "sortDesc": true,
76             "total": false,
77             "values": true
78           },
79           "lines": true,
80           "linewidth": 1,
81           "links": [],
82           "nullPointMode": "connected",
83           "options": {
84             "dataLinks": []
85           },
86           "percentage": false,
87           "pointradius": 5,
88           "points": false,
89           "renderer": "flot",
90           "seriesOverrides": [],
91           "spaceLength": 10,
92           "stack": false,
93           "steppedLine": false,
94           "targets": [
95             {
96               "expr": "sum(kafka_topic_partition_current_offset - kafka_topic_partition_oldest_offset{instance=\"$instance\", topic=~\"$topic\"}) by (topic)",
97               "format": "time_series",
98               "intervalFactor": 1,
99               "legendFormat": "{{topic}}",
100               "refId": "B"
101             }
102           ],
103           "thresholds": [],
104           "timeFrom": null,
105           "timeRegions": [],
106           "timeShift": null,
107           "title": "Messages stored per topic",
108           "tooltip": {
109             "shared": true,
110             "sort": 0,
111             "value_type": "individual"
112           },
113           "type": "graph",
114           "xaxis": {
115             "buckets": null,
116             "mode": "time",
117             "name": null,
118             "show": true,
119             "values": []
120           },
121           "yaxes": [
122             {
123               "format": "short",
124               "label": null,
125               "logBase": 1,
126               "max": null,
127               "min": "0",
128               "show": true
129             },
130             {
131               "format": "short",
132               "label": null,
133               "logBase": 1,
134               "max": null,
135               "min": null,
136               "show": true
137             }
138           ],
139           "yaxis": {
140             "align": false,
141             "alignLevel": null
142           }
143         },
144         {
145           "aliasColors": {},
146           "bars": false,
147           "dashLength": 10,
148           "dashes": false,
149           "datasource": "Prometheus",
150           "fill": 0,
151           "fillGradient": 0,
152           "gridPos": {
153             "h": 10,
154             "w": 10,
155             "x": 10,
156             "y": 0
157           },
158           "id": 12,
159           "legend": {
160             "alignAsTable": true,
161             "avg": false,
162             "current": true,
163             "max": true,
164             "min": false,
165             "rightSide": false,
166             "show": true,
167             "sideWidth": 480,
168             "sort": "max",
169             "sortDesc": true,
170             "total": false,
171             "values": true
172           },
173           "lines": true,
174           "linewidth": 1,
175           "links": [],
176           "nullPointMode": "connected",
177           "options": {
178             "dataLinks": []
179           },
180           "percentage": false,
181           "pointradius": 5,
182           "points": false,
183           "renderer": "flot",
184           "seriesOverrides": [],
185           "spaceLength": 10,
186           "stack": false,
187           "steppedLine": false,
188           "targets": [
189             {
190               "expr": "sum(kafka_consumergroup_lag{instance=\"$instance\",topic=~\"$topic\"}) by (consumergroup, topic) ",
191               "format": "time_series",
192               "instant": false,
193               "interval": "",
194               "intervalFactor": 1,
195               "legendFormat": " {{topic}} ({{consumergroup}})",
196               "refId": "A"
197             }
198           ],
199           "thresholds": [],
200           "timeFrom": null,
201           "timeRegions": [],
202           "timeShift": null,
203           "title": "Lag by  Consumer Group",
204           "tooltip": {
205             "shared": true,
206             "sort": 2,
207             "value_type": "individual"
208           },
209           "type": "graph",
210           "xaxis": {
211             "buckets": null,
212             "mode": "time",
213             "name": null,
214             "show": true,
215             "values": []
216           },
217           "yaxes": [
218             {
219               "format": "short",
220               "label": "",
221               "logBase": 1,
222               "max": null,
223               "min": "0",
224               "show": true
225             },
226             {
227               "format": "short",
228               "label": null,
229               "logBase": 1,
230               "max": null,
231               "min": null,
232               "show": true
233             }
234           ],
235           "yaxis": {
236             "align": false,
237             "alignLevel": null
238           }
239         },
240         {
241           "aliasColors": {},
242           "bars": false,
243           "dashLength": 10,
244           "dashes": false,
245           "datasource": "Prometheus",
246           "fill": 0,
247           "fillGradient": 0,
248           "gridPos": {
249             "h": 10,
250             "w": 10,
251             "x": 0,
252             "y": 10
253           },
254           "id": 16,
255           "legend": {
256             "alignAsTable": true,
257             "avg": false,
258             "current": true,
259             "max": true,
260             "min": false,
261             "rightSide": false,
262             "show": true,
263             "sideWidth": 480,
264             "total": false,
265             "values": true
266           },
267           "lines": true,
268           "linewidth": 1,
269           "links": [],
270           "nullPointMode": "connected",
271           "options": {
272             "dataLinks": []
273           },
274           "percentage": false,
275           "pointradius": 5,
276           "points": false,
277           "renderer": "flot",
278           "seriesOverrides": [],
279           "spaceLength": 10,
280           "stack": false,
281           "steppedLine": false,
282           "targets": [
283             {
284               "expr": "sum(delta(kafka_topic_partition_current_offset{instance=~'$instance', topic=~\"$topic\"}[5m])/5) by (topic)",
285               "format": "time_series",
286               "intervalFactor": 1,
287               "legendFormat": "{{topic}}",
288               "refId": "A"
289             }
290           ],
291           "thresholds": [],
292           "timeFrom": null,
293           "timeRegions": [],
294           "timeShift": null,
295           "title": "Messages produced per minute",
296           "tooltip": {
297             "shared": true,
298             "sort": 0,
299             "value_type": "individual"
300           },
301           "type": "graph",
302           "xaxis": {
303             "buckets": null,
304             "mode": "time",
305             "name": null,
306             "show": true,
307             "values": []
308           },
309           "yaxes": [
310             {
311               "format": "short",
312               "label": null,
313               "logBase": 1,
314               "max": null,
315               "min": null,
316               "show": true
317             },
318             {
319               "format": "short",
320               "label": null,
321               "logBase": 1,
322               "max": null,
323               "min": null,
324               "show": true
325             }
326           ],
327           "yaxis": {
328             "align": false,
329             "alignLevel": null
330           }
331         },
332         {
333           "aliasColors": {},
334           "bars": false,
335           "dashLength": 10,
336           "dashes": false,
337           "datasource": "Prometheus",
338           "fill": 0,
339           "fillGradient": 0,
340           "gridPos": {
341             "h": 10,
342             "w": 10,
343             "x": 10,
344             "y": 10
345           },
346           "id": 18,
347           "legend": {
348             "alignAsTable": true,
349             "avg": false,
350             "current": true,
351             "max": true,
352             "min": false,
353             "rightSide": false,
354             "show": true,
355             "sideWidth": 480,
356             "sort": "current",
357             "sortDesc": true,
358             "total": false,
359             "values": true
360           },
361           "lines": true,
362           "linewidth": 1,
363           "links": [],
364           "nullPointMode": "connected",
365           "options": {
366             "dataLinks": []
367           },
368           "percentage": false,
369           "pointradius": 5,
370           "points": false,
371           "renderer": "flot",
372           "seriesOverrides": [],
373           "spaceLength": 10,
374           "stack": false,
375           "steppedLine": false,
376           "targets": [
377             {
378               "expr": "sum(delta(kafka_consumergroup_current_offset{instance=~'$instance',topic=~\"$topic\"}[5m])/5) by (consumergroup, topic)",
379               "format": "time_series",
380               "intervalFactor": 1,
381               "legendFormat": " {{topic}} ({{consumergroup}})",
382               "refId": "A"
383             }
384           ],
385           "thresholds": [],
386           "timeFrom": null,
387           "timeRegions": [],
388           "timeShift": null,
389           "title": "Messages consumed per minute",
390           "tooltip": {
391             "shared": true,
392             "sort": 0,
393             "value_type": "individual"
394           },
395           "type": "graph",
396           "xaxis": {
397             "buckets": null,
398             "mode": "time",
399             "name": null,
400             "show": true,
401             "values": []
402           },
403           "yaxes": [
404             {
405               "format": "short",
406               "label": null,
407               "logBase": 1,
408               "max": null,
409               "min": null,
410               "show": true
411             },
412             {
413               "format": "short",
414               "label": null,
415               "logBase": 1,
416               "max": null,
417               "min": null,
418               "show": true
419             }
420           ],
421           "yaxis": {
422             "align": false,
423             "alignLevel": null
424           }
425         },
426         {
427           "aliasColors": {},
428           "bars": true,
429           "dashLength": 10,
430           "dashes": false,
431           "datasource": "Prometheus",
432           "fill": 1,
433           "fillGradient": 0,
434           "gridPos": {
435             "h": 7,
436             "w": 20,
437             "x": 0,
438             "y": 20
439           },
440           "id": 8,
441           "legend": {
442             "alignAsTable": true,
443             "avg": false,
444             "current": true,
445             "max": false,
446             "min": false,
447             "rightSide": true,
448             "show": true,
449             "sideWidth": 420,
450             "total": false,
451             "values": true
452           },
453           "lines": false,
454           "linewidth": 1,
455           "links": [],
456           "nullPointMode": "null",
457           "options": {
458             "dataLinks": []
459           },
460           "percentage": false,
461           "pointradius": 5,
462           "points": false,
463           "renderer": "flot",
464           "seriesOverrides": [],
465           "spaceLength": 10,
466           "stack": false,
467           "steppedLine": false,
468           "targets": [
469             {
470               "expr": "sum by(topic) (kafka_topic_partitions{instance=\"$instance\",topic=~\"$topic\"})",
471               "format": "time_series",
472               "intervalFactor": 1,
473               "legendFormat": "{{topic}}",
474               "refId": "A"
475             }
476           ],
477           "thresholds": [],
478           "timeFrom": null,
479           "timeRegions": [],
480           "timeShift": null,
481           "title": "Partitions per Topic",
482           "tooltip": {
483             "shared": false,
484             "sort": 0,
485             "value_type": "individual"
486           },
487           "type": "graph",
488           "xaxis": {
489             "buckets": null,
490             "mode": "series",
491             "name": null,
492             "show": false,
493             "values": [
494               "current"
495             ]
496           },
497           "yaxes": [
498             {
499               "format": "short",
500               "label": null,
501               "logBase": 1,
502               "max": null,
503               "min": null,
504               "show": true
505             },
506             {
507               "format": "short",
508               "label": null,
509               "logBase": 1,
510               "max": null,
511               "min": null,
512               "show": true
513             }
514           ],
515           "yaxis": {
516             "align": false,
517             "alignLevel": null
518           }
519         }
520       ],
521       "refresh": "5s",
522       "schemaVersion": 19,
523       "style": "dark",
524       "tags": [],
525       "templating": {
526         "list": [
527           {
528             "allValue": null,
529             "current": {
530               "text": "osm-kafka-exporter-service",
531               "value": "osm-kafka-exporter-service"
532             },
533             "datasource": "Prometheus",
534             "definition": "",
535             "hide": 0,
536             "includeAll": false,
537             "label": "Job",
538             "multi": false,
539             "name": "job",
540             "options": [],
541             "query": "label_values(kafka_consumergroup_current_offset, job)",
542             "refresh": 1,
543             "regex": "",
544             "skipUrlSync": false,
545             "sort": 0,
546             "tagValuesQuery": "",
547             "tags": [],
548             "tagsQuery": "",
549             "type": "query",
550             "useTags": false
551           },
552           {
553             "allValue": null,
554             "datasource": "Prometheus",
555             "definition": "",
556             "hide": 0,
557             "includeAll": false,
558             "label": "Instance",
559             "multi": false,
560             "name": "instance",
561             "options": [],
562             "query": "label_values(kafka_consumergroup_current_offset{job=~\"$job\"}, instance)",
563             "refresh": 1,
564             "regex": "",
565             "skipUrlSync": false,
566             "sort": 0,
567             "tagValuesQuery": "",
568             "tags": [],
569             "tagsQuery": "",
570             "type": "query",
571             "useTags": false
572           },
573           {
574             "allValue": null,
575             "current": {
576               "tags": [],
577               "text": "All",
578               "value": [
579                 "$__all"
580               ]
581             },
582             "datasource": "Prometheus",
583             "definition": "",
584             "hide": 0,
585             "includeAll": true,
586             "label": "Topic",
587             "multi": true,
588             "name": "topic",
589             "options": [],
590             "query": "label_values(kafka_topic_partition_current_offset{instance='$instance',topic!='__consumer_offsets',topic!='--kafka'}, topic)",
591             "refresh": 1,
592             "regex": "",
593             "skipUrlSync": false,
594             "sort": 1,
595             "tagValuesQuery": "",
596             "tags": [],
597             "tagsQuery": "topic",
598             "type": "query",
599             "useTags": false
600           }
601         ]
602       },
603       "time": {
604         "from": "now-1h",
605         "to": "now"
606       },
607       "timepicker": {
608         "refresh_intervals": [
609           "5s",
610           "10s",
611           "30s",
612           "1m",
613           "5m",
614           "15m",
615           "30m",
616           "1h",
617           "2h",
618           "1d"
619         ],
620         "time_options": [
621           "5m",
622           "15m",
623           "1h",
624           "6h",
625           "12h",
626           "24h",
627           "2d",
628           "7d",
629           "30d"
630         ]
631       },
632       "timezone": "browser",
633       "title": "Kafka",
634       "uid": "jwPKIsniz",
635       "version": 2
636     }