From 2d063eb98a9401450801009e5ab84f282544df94 Mon Sep 17 00:00:00 2001 From: Arnob kumar saha Date: Wed, 14 Feb 2024 19:06:59 +0600 Subject: [PATCH] all good Signed-off-by: Arnob kumar saha --- .../rabbitmq/rabbitmq-database.json | 95 ++++++----- .../dashboards/rabbitmq/rabbitmq-pod.json | 109 ++++++------ .../dashboards/rabbitmq/rabbitmq-summary.json | 157 +++++++++--------- 3 files changed, 182 insertions(+), 179 deletions(-) diff --git a/charts/kubedb-grafana-dashboards/dashboards/rabbitmq/rabbitmq-database.json b/charts/kubedb-grafana-dashboards/dashboards/rabbitmq/rabbitmq-database.json index 389b469e8..cc8470dba 100644 --- a/charts/kubedb-grafana-dashboards/dashboards/rabbitmq/rabbitmq-database.json +++ b/charts/kubedb-grafana-dashboards/dashboards/rabbitmq/rabbitmq-database.json @@ -1,4 +1,5 @@ {{- $shared := and (eq .Values.app.name "") (eq .Values.app.namespace "") -}} +{{- $alerts := (eq $.Values.dashboard.alerts true) -}} { "annotations": { "list": [ @@ -15275,7 +15276,7 @@ { "expr": "sum(\n (rabbitmq_raft_log_last_written_index * on(instance, job) group_left(rabbitmq_cluster, rabbitmq_node) rabbitmq_identity_info{rabbitmq_cluster=\"$app\", namespace=\"$namespace\"}) - \n (rabbitmq_raft_log_snapshot_index * on(instance) group_left(rabbitmq_cluster, rabbitmq_node) rabbitmq_identity_info{rabbitmq_cluster=\"$app\", namespace=\"$namespace\"})\n) by(queue, rabbitmq_node)", "hide": false, - "legendFormat": "{{rabbitmq_node}} {{queue}}", + "legendFormat": {{ `"{{rabbitmq_node}} {{queue}}"` }}, "refId": "A" } ], @@ -16419,7 +16420,7 @@ { "expr": "sum(\n (rabbitmq_raft_log_last_written_index * on(instance, job) group_left(rabbitmq_cluster, rabbitmq_node) rabbitmq_identity_info{rabbitmq_cluster=\"$app\", namespace=\"$namespace\"}) - \n (rabbitmq_raft_log_snapshot_index * on(instance) group_left(rabbitmq_cluster, rabbitmq_node) rabbitmq_identity_info{rabbitmq_cluster=\"$app\", namespace=\"$namespace\"})\n) by(queue, rabbitmq_node)", "hide": false, - "legendFormat": "{{rabbitmq_node}} {{queue}}", + "legendFormat": {{ `"{{rabbitmq_node}} {{queue}}"` }}, "refId": "A" } ], @@ -17930,8 +17931,8 @@ { "current": { "selected": false, - "text": "default", - "value": "default" + "text": "Prometheus", + "value": "Prometheus" }, "description": null, "error": null, @@ -17947,16 +17948,17 @@ "regex": "", "skipUrlSync": false, "type": "datasource" - }, + } + {{- if not $alerts }} + , { - "allValue": null, + "allValue": "\".+\"", "current": { "selected": false, - "text": "rabbit", - "value": "rabbit" + "text": "demo", + "value": "demo" }, "datasource": "${datasource}", - "definition": "label_values(kube_namespace_created,namespace)", "description": null, "error": null, "hide": 0, @@ -17965,60 +17967,61 @@ "multi": false, "name": "namespace", "options": [], - {{- if $shared }} - "query": { + {{- if $shared }} + "query": { "query": "label_values(kube_namespace_created,namespace)", "refId": "Prometheus-namespace-Variable-Query" - }, - "type": "query", - {{- else }} - "query": {{ $.Values.app.namespace | quote }}, - "type": "constant", - {{- end }} - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "tagValuesQuery": "", - "tags": [], - "tagsQuery": "", - "type": "query", - "useTags": false + }, + "type": "query", + {{- else }} + "query": {{ $.Values.app.namespace | quote }}, + "type": "constant", + {{- end }} + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "useTags": false }, { "allValue": null, "current": { "selected": false, - "text": "rabbit-dev", - "value": "rabbit-dev" + "text": "mg4", + "value": "mg4" }, "datasource": "${datasource}", - "definition": "label_values(rabbitmq_identity_info{namespace=\"$namespace\"}, rabbitmq_cluster)", "description": null, "error": null, "hide": 0, "includeAll": false, - "label": null, + "label": "RabbitMQ", "multi": false, "name": "app", "options": [], - {{- if $shared }} - "query": "label_values(rabbitmq_identity_info{namespace=\"$namespace\"}, rabbitmq_cluster)", - "type": "query", - {{- else }} - "query": {{ $.Values.app.name | quote }}, - "type": "constant", - {{- end }} - "refresh": 2, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "tagValuesQuery": "", - "tags": [], - "tagsQuery": "", - "type": "query", - "useTags": false + {{- if $shared }} + "query": { + "query": "label_values(kubedb_com_rabbitmq_status_phase{namespace=~\"$namespace\"},app)", + "refId": "Prometheus-app-Variable-Query" + }, + "type": "query", + {{- else }} + "query": {{ $.Values.app.name | quote }}, + "type": "constant", + {{- end }} + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "useTags": false } + {{- end }} ] }, "time": { diff --git a/charts/kubedb-grafana-dashboards/dashboards/rabbitmq/rabbitmq-pod.json b/charts/kubedb-grafana-dashboards/dashboards/rabbitmq/rabbitmq-pod.json index 730839b3c..4ec72f397 100644 --- a/charts/kubedb-grafana-dashboards/dashboards/rabbitmq/rabbitmq-pod.json +++ b/charts/kubedb-grafana-dashboards/dashboards/rabbitmq/rabbitmq-pod.json @@ -478,7 +478,7 @@ "exemplar": true, "expr": "rabbitmq_queue_messages_ram_bytes{pod=~\"$pod\"}", "interval": "", - "legendFormat": {{ `"{{pod}}"` }},, + "legendFormat": {{ `"{{pod}}"` }}, "refId": "A" } ], @@ -577,7 +577,7 @@ "expr": "rabbitmq_queue_messages_persistent{pod=~\"$pod\"}", "instant": false, "interval": "", - "legendFormat": {{ `"{{pod}}"` }},, + "legendFormat": {{ `"{{pod}}"` }}, "refId": "A" } ], @@ -773,7 +773,7 @@ "exemplar": true, "expr": "rate(rabbitmq_erlang_gc_reclaimed_bytes_total{pod=~\"$pod\"}[5m])", "interval": "", - "legendFormat": {{ `"{{pod}}"` }},, + "legendFormat": {{ `"{{pod}}"` }}, "refId": "A" } ], @@ -1054,7 +1054,7 @@ "format": "time_series", "instant": false, "intervalFactor": 1, - "legendFormat": {{ `"{{rabbitmq_node}}"` }},, + "legendFormat": {{ `"{{rabbitmq_node}}"` }}, "refId": "A" } ], @@ -1412,14 +1412,13 @@ "type": "datasource" }, { - "allValue": "\".+\"", + "allValue": null, "current": { - "selected": false, - "text": "rabbit", - "value": "rabbit" + "selected": true, + "text": "demo", + "value": "demo" }, "datasource": "${datasource}", - "definition": "label_values(kube_namespace_created,namespace)", "description": null, "error": null, "hide": 0, @@ -1428,35 +1427,33 @@ "multi": false, "name": "namespace", "options": [], - {{- if $shared }} - "query": { + {{- if $shared }} + "query": { "query": "label_values(kube_namespace_created,namespace)", "refId": "Prometheus-namespace-Variable-Query" - }, - "type": "query", - {{- else }} - "query": {{ $.Values.app.namespace | quote }}, - "type": "constant", - {{- end }} - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "tagValuesQuery": "", - "tags": [], - "tagsQuery": "", - "type": "query", - "useTags": false + }, + "type": "query", + {{- else }} + "query": {{ $.Values.app.namespace | quote }}, + "type": "constant", + {{- end }} + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "useTags": false }, { "allValue": null, "current": { "selected": false, - "text": "rabbit-dev", - "value": "rabbit-dev" + "text": "mg-rs", + "value": "mg-rs" }, "datasource": "${datasource}", - "definition": "label_values(kubedb_com_rabbitmq_status_phase{namespace=~\"$namespace\"},app)", "description": null, "error": null, "hide": 0, @@ -1465,50 +1462,52 @@ "multi": false, "name": "app", "options": [], - {{- if $shared }} - "query": "label_values(rabbitmq_identity_info{namespace=\"$namespace\"}, rabbitmq_cluster)", - "type": "query", - {{- else }} - "query": {{ $.Values.app.name | quote }}, - "type": "constant", - {{- end }} - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "tagValuesQuery": "", - "tags": [], - "tagsQuery": "", - "type": "query", - "useTags": false + {{- if $shared }} + "query": { + "query": "label_values(rabbitmq_build_info{namespace=~\"$namespace\",pod=~\"${app}-.*\"},pod)", + "refId": "Prometheus-app-Variable-Query" + }, + "type": "query", + {{- else }} + "query": {{ $.Values.app.name | quote }}, + "type": "constant", + {{- end }} + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tagsQuery": "", + "useTags": false }, { + "allFormat": "glob", "allValue": null, "current": { - "selected": false, - "text": "rabbit-dev-0", - "value": "rabbit-dev-0" + "selected": true, + "text": "mg-rs-0", + "value": "mg-rs-0" }, "datasource": "${datasource}", - "definition": "label_values(rabbitmq_build_info{namespace=~\"$namespace\",pod=~\"${app}-.*\"},pod)", + "definition": "", "description": null, "error": null, "hide": 0, "includeAll": false, - "label": "Pod Name", + "label": "Pod", "multi": false, + "multiFormat": "glob", "name": "pod", "options": [], "query": { - "query": "label_values(rabbitmq_build_info{namespace=~\"$namespace\",pod=~\"${app}-.*\"},pod)", + "query": "label_values(rabbitmq_identity_info{namespace=~\"$namespace\",service=\"${app}-stats\"}, pod)", "refId": "Prometheus-pod-Variable-Query" }, "refresh": 2, "regex": "", "skipUrlSync": false, "sort": 1, - "tagValuesQuery": "", - "tags": [], + "tagValuesQuery": null, "tagsQuery": "", "type": "query", "useTags": false @@ -1516,8 +1515,8 @@ ] }, "time": { - "from": "2024-02-12T04:59:22.543Z", - "to": "2024-02-12T05:59:22.543Z" + "from": "now-6h", + "to": "now" }, "timepicker": { "refresh_intervals": [ diff --git a/charts/kubedb-grafana-dashboards/dashboards/rabbitmq/rabbitmq-summary.json b/charts/kubedb-grafana-dashboards/dashboards/rabbitmq/rabbitmq-summary.json index dd7c19379..619714128 100644 --- a/charts/kubedb-grafana-dashboards/dashboards/rabbitmq/rabbitmq-summary.json +++ b/charts/kubedb-grafana-dashboards/dashboards/rabbitmq/rabbitmq-summary.json @@ -1,4 +1,5 @@ {{- $shared := and (eq .Values.app.name "") (eq .Values.app.namespace "") -}} +{{- $alerts := (eq $.Values.dashboard.alerts true) -}} { "annotations": { "list": [ @@ -27,6 +28,7 @@ "iteration": 1682776538666, "links": [], "panels": [ + { "collapsed": false, "datasource": "${datasource}", @@ -123,7 +125,7 @@ "instant": true, "interval": "", "legendFormat": {{ `"{{phase}}"` }}, - "refId": "A" + "refId": "A" } ], "title": "Database Status", @@ -205,8 +207,8 @@ "instant": true, "interval": "", "intervalFactor": 1, - "legendFormat": {{ `"{{version}}"` }},, - "refId": "A" + "legendFormat": {{ `"{{version}}"` }}, + "refId": "A" } ], "title": "Version", @@ -284,8 +286,8 @@ "format": "time_series", "instant": true, "interval": "", - "legendFormat": "{{requireSSL}}", - "refId": "A" + "legendFormat": {{ `"{{requireSSL}}"` }}, + "refId": "A" } ], "timeFrom": null, @@ -366,8 +368,8 @@ "format": "table", "instant": true, "interval": "", - "legendFormat": {{ `"{{terminationPolicy}}"` }},, - "refId": "A" + "legendFormat": {{ `"{{terminationPolicy}}"` }}, + "refId": "A" } ], "title": "Termination Policy", @@ -796,7 +798,7 @@ "expr": "sum(node_namespace_pod_container:container_cpu_usage_seconds_total:sum_irate{namespace=\"$namespace\", pod=~\"$app-\\\\d+$\"}) by (pod)", "interval": "", "legendFormat": {{ `"{{pod}}"` }}, - "refId": "A" + "refId": "A" } ], "thresholds": [], @@ -1198,8 +1200,8 @@ "exemplar": true, "expr": "sum(node_namespace_pod_container:container_memory_working_set_bytes{namespace=\"$namespace\", pod=~\"$app-\\\\d+$\",container!=\"\"}) by (pod)", "interval": "", - "legendFormat": {{ `"{{pod}}"` }},, - "refId": "A" + "legendFormat": {{ `"{{pod}}"` }}, + "refId": "A" } ], "thresholds": [], @@ -1705,8 +1707,8 @@ "exemplar": true, "expr": "avg(container_blkio_device_usage_total{namespace=\"$namespace\", pod=~\"$app-\\\\d+$\"}) by (pod)", "interval": "", - "legendFormat": {{ `"{{pod}}"` }},, - "refId": "A" + "legendFormat": {{ `"{{pod}}"` }}, + "refId": "A" } ], "thresholds": [], @@ -1805,7 +1807,7 @@ "interval": "", "intervalFactor": 1, "legendFormat": {{ `"{{pod}}-disk-write"` }}, - "refId": "A" + "refId": "A" }, { "exemplar": true, @@ -1814,7 +1816,7 @@ "instant": false, "interval": "", "legendFormat": {{ `"{{pod}}-disk-write"` }}, - "refId": "B" + "refId": "B" } ], "thresholds": [], @@ -1912,10 +1914,10 @@ "format": "time_series", "interval": "", "intervalFactor": 2, - "legendFormat": {{ `"{{pod}}"` }},, - "legendLink": null, - "refId": "A", - "step": 10 + "legendFormat": {{ `"{{pod}}"` }}, + "legendLink": null, + "refId": "A", + "step": 10 } ], "thresholds": [], @@ -2013,10 +2015,10 @@ "format": "time_series", "interval": "", "intervalFactor": 2, - "legendFormat": {{ `"{{pod}}"` }},, - "legendLink": null, - "refId": "A", - "step": 10 + "legendFormat": {{ `"{{pod}}"` }}, + "legendLink": null, + "refId": "A", + "step": 10 } ], "thresholds": [], @@ -2522,8 +2524,8 @@ "expr": "(kubelet_volume_stats_used_bytes / on(persistentvolumeclaim) group_left(pod) (kubelet_volume_stats_capacity_bytes + on(persistentvolumeclaim) group_left(pod) kube_pod_spec_volumes_persistentvolumeclaims_info{pod=~\"^$app.*\",namespace=~\"$namespace\"}) )* 100", "instant": true, "interval": "", - "legendFormat": {{ `"{{pod}}"` }},, - "refId": "A" + "legendFormat": {{ `"{{pod}}"` }}, + "refId": "A" } ], "title": "Persistent Volume Usage", @@ -2606,8 +2608,8 @@ "expr": "(kubelet_volume_stats_used_bytes + on(persistentvolumeclaim) group_left(pod) kube_pod_spec_volumes_persistentvolumeclaims_info{pod=~\"^$app.*\",namespace=~\"$namespace\"}) ", "interval": "", "intervalFactor": 1, - "legendFormat": {{ `"{{pod}}"` }},, - "refId": "A" + "legendFormat": {{ `"{{pod}}"` }}, + "refId": "A" } ], "title": "Persistent Volume Usage History", @@ -2679,10 +2681,10 @@ "format": "time_series", "interval": "", "intervalFactor": 2, - "legendFormat": {{ `"{{pod}}"` }},, - "legendLink": null, - "refId": "A", - "step": 10 + "legendFormat": {{ `"{{pod}}"` }}, + "legendLink": null, + "refId": "A", + "step": 10 } ], "thresholds": [], @@ -2780,10 +2782,10 @@ "format": "time_series", "interval": "", "intervalFactor": 2, - "legendFormat": {{ `"{{pod}}"` }},, - "legendLink": null, - "refId": "A", - "step": 10 + "legendFormat": {{ `"{{pod}}"` }}, + "legendLink": null, + "refId": "A", + "step": 10 } ], "thresholds": [], @@ -2841,9 +2843,9 @@ "list": [ { "current": { - "selected": true, - "text": "default", - "value": "default" + "selected": false, + "text": "Prometheus", + "value": "Prometheus" }, "description": null, "error": null, @@ -2859,7 +2861,9 @@ "regex": "", "skipUrlSync": false, "type": "datasource" - }, + } + {{- if not $alerts }} + , { "allValue": "\".+\"", "current": { @@ -2868,7 +2872,6 @@ "value": "demo" }, "datasource": "${datasource}", - "definition": "label_values(kube_namespace_created,namespace)", "description": null, "error": null, "hide": 0, @@ -2877,35 +2880,33 @@ "multi": false, "name": "namespace", "options": [], - {{- if $shared }} - "query": { + {{- if $shared }} + "query": { "query": "label_values(kube_namespace_created,namespace)", "refId": "Prometheus-namespace-Variable-Query" - }, - "type": "query", - {{- else }} - "query": {{ $.Values.app.namespace | quote }}, - "type": "constant", - {{- end }} - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "tagValuesQuery": "", - "tags": [], - "tagsQuery": "", - "type": "query", - "useTags": false + }, + "type": "query", + {{- else }} + "query": {{ $.Values.app.namespace | quote }}, + "type": "constant", + {{- end }} + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "useTags": false }, { "allValue": null, "current": { "selected": false, - "text": "rabbitmq", - "value": "rabbitmq" + "text": "mg4", + "value": "mg4" }, "datasource": "${datasource}", - "definition": "label_values(kubedb_com_rabbitmq_status_phase{namespace=~\"$namespace\"},app)", "description": null, "error": null, "hide": 0, @@ -2914,31 +2915,31 @@ "multi": false, "name": "app", "options": [], - {{- if $shared }} - "query": { + {{- if $shared }} + "query": { "query": "label_values(kubedb_com_rabbitmq_status_phase{namespace=~\"$namespace\"},app)", "refId": "Prometheus-app-Variable-Query" - }, - "type": "query", - {{- else }} - "query": {{ $.Values.app.name | quote }}, - "type": "constant", - {{- end }} - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "tagValuesQuery": "", - "tags": [], - "tagsQuery": "", - "type": "query", - "useTags": false + }, + "type": "query", + {{- else }} + "query": {{ $.Values.app.name | quote }}, + "type": "constant", + {{- end }} + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "useTags": false } + {{- end }} ] }, "time": { - "from": "now-15m", - "to": "now" + "from": "now-6h", + "to": "now" }, "timepicker": { "refresh_intervals": [