71b88db9bfd000f276c371b77eac08888c7aac60
[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     heritage: Tiller
24   name: osm-monitoring-prometheus-kafka-exporter-grafana
25   annotations:
26     k8s-sidecar-target-directory: "/tmp/dashboards/OSM Third Party Modules"
27 data:
28   kafka-exporter-dashboard.json: |-
29     {
30       "annotations": {
31         "list": [
32           {
33             "builtIn": 1,
34             "datasource": "-- Grafana --",
35             "enable": true,
36             "hide": true,
37             "iconColor": "rgba(0, 211, 255, 1)",
38             "name": "Annotations & Alerts",
39             "type": "dashboard"
40           }
41         ]
42       },
43       "description": "Kafka resource usage and throughput",
44       "editable": true,
45       "gnetId": 7589,
46       "graphTooltip": 0,
47       "id": 36,
48       "iteration": 1569330292834,
49       "links": [],
50       "panels": [
51         {
52           "aliasColors": {},
53           "bars": false,
54           "dashLength": 10,
55           "dashes": false,
56           "datasource": "Prometheus",
57           "fill": 0,
58           "fillGradient": 0,
59           "gridPos": {
60             "h": 10,
61             "w": 10,
62             "x": 0,
63             "y": 0
64           },
65           "id": 14,
66           "legend": {
67             "alignAsTable": true,
68             "avg": false,
69             "current": true,
70             "max": true,
71             "min": false,
72             "rightSide": false,
73             "show": true,
74             "sideWidth": 480,
75             "sort": "max",
76             "sortDesc": true,
77             "total": false,
78             "values": true
79           },
80           "lines": true,
81           "linewidth": 1,
82           "links": [],
83           "nullPointMode": "connected",
84           "options": {
85             "dataLinks": []
86           },
87           "percentage": false,
88           "pointradius": 5,
89           "points": false,
90           "renderer": "flot",
91           "seriesOverrides": [],
92           "spaceLength": 10,
93           "stack": false,
94           "steppedLine": false,
95           "targets": [
96             {
97               "expr": "sum(rate(kafka_topic_partition_current_offset{instance=\"$instance\", topic=~\"$topic\"}[1m])) by (topic)",
98               "format": "time_series",
99               "intervalFactor": 1,
100               "legendFormat": "{{topic}}",
101               "refId": "B"
102             }
103           ],
104           "thresholds": [],
105           "timeFrom": null,
106           "timeRegions": [],
107           "timeShift": null,
108           "title": "Message in per second",
109           "tooltip": {
110             "shared": true,
111             "sort": 0,
112             "value_type": "individual"
113           },
114           "type": "graph",
115           "xaxis": {
116             "buckets": null,
117             "mode": "time",
118             "name": null,
119             "show": true,
120             "values": []
121           },
122           "yaxes": [
123             {
124               "format": "short",
125               "label": null,
126               "logBase": 1,
127               "max": null,
128               "min": "0",
129               "show": true
130             },
131             {
132               "format": "short",
133               "label": null,
134               "logBase": 1,
135               "max": null,
136               "min": null,
137               "show": true
138             }
139           ],
140           "yaxis": {
141             "align": false,
142             "alignLevel": null
143           }
144         },
145         {
146           "aliasColors": {},
147           "bars": false,
148           "dashLength": 10,
149           "dashes": false,
150           "datasource": "Prometheus",
151           "fill": 0,
152           "fillGradient": 0,
153           "gridPos": {
154             "h": 10,
155             "w": 10,
156             "x": 10,
157             "y": 0
158           },
159           "id": 12,
160           "legend": {
161             "alignAsTable": true,
162             "avg": false,
163             "current": true,
164             "max": true,
165             "min": false,
166             "rightSide": false,
167             "show": true,
168             "sideWidth": 480,
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": "{{consumergroup}} (topic: {{topic}})",
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": "Message in 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": "{{consumergroup}} (topic: {{topic}})",
382               "refId": "A"
383             }
384           ],
385           "thresholds": [],
386           "timeFrom": null,
387           "timeRegions": [],
388           "timeShift": null,
389           "title": "Message consume 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         "Kafka"
526       ],
527       "templating": {
528         "list": [
529           {
530             "allValue": null,
531             "current": {
532               "selected": true,
533               "text": "osm-kafka-exporter-service",
534               "value": "osm-kafka-exporter-service"
535             },
536             "datasource": "Prometheus",
537             "definition": "",
538             "hide": 0,
539             "includeAll": false,
540             "label": "Job",
541             "multi": false,
542             "name": "job",
543             "options": [],
544             "query": "label_values(kafka_consumergroup_current_offset, job)",
545             "refresh": 1,
546             "regex": "",
547             "skipUrlSync": false,
548             "sort": 0,
549             "tagValuesQuery": "",
550             "tags": [],
551             "tagsQuery": "",
552             "type": "query",
553             "useTags": false
554           },
555           {
556             "allValue": null,
557             "current": {
558               "selected": false,
559               "text": "10.244.0.87:9092",
560               "value": "10.244.0.87:9092"
561             },
562             "datasource": "Prometheus",
563             "definition": "",
564             "hide": 0,
565             "includeAll": false,
566             "label": "Instance",
567             "multi": false,
568             "name": "instance",
569             "options": [],
570             "query": "label_values(kafka_consumergroup_current_offset{job=~\"$job\"}, instance)",
571             "refresh": 1,
572             "regex": "",
573             "skipUrlSync": false,
574             "sort": 0,
575             "tagValuesQuery": "",
576             "tags": [],
577             "tagsQuery": "",
578             "type": "query",
579             "useTags": false
580           },
581           {
582             "allValue": null,
583             "current": {
584               "text": "All",
585               "value": [
586                 "$__all"
587               ]
588             },
589             "datasource": "Prometheus",
590             "definition": "",
591             "hide": 0,
592             "includeAll": true,
593             "label": "Topic",
594             "multi": true,
595             "name": "topic",
596             "options": [],
597             "query": "label_values(kafka_topic_partition_current_offset{instance='$instance',topic!='__consumer_offsets',topic!='--kafka'}, topic)",
598             "refresh": 1,
599             "regex": "",
600             "skipUrlSync": false,
601             "sort": 1,
602             "tagValuesQuery": "",
603             "tags": [],
604             "tagsQuery": "topic",
605             "type": "query",
606             "useTags": false
607           }
608         ]
609       },
610       "time": {
611         "from": "now-1h",
612         "to": "now"
613       },
614       "timepicker": {
615         "refresh_intervals": [
616           "5s",
617           "10s",
618           "30s",
619           "1m",
620           "5m",
621           "15m",
622           "30m",
623           "1h",
624           "2h",
625           "1d"
626         ],
627         "time_options": [
628           "5m",
629           "15m",
630           "1h",
631           "6h",
632           "12h",
633           "24h",
634           "2d",
635           "7d",
636           "30d"
637         ]
638       },
639       "timezone": "browser",
640       "title": "Kafka Exporter Overview",
641       "uid": "jwPKIsniz",
642       "version": 1
643     }