diff --git a/charts/kubedb-grafana-dashboards/dashboards/mssqlserver/mssqlserver_database_dashboard.json b/charts/kubedb-grafana-dashboards/dashboards/mssqlserver/mssqlserver_database_dashboard.json index 65430a44c..512eb98a1 100644 --- a/charts/kubedb-grafana-dashboards/dashboards/mssqlserver/mssqlserver_database_dashboard.json +++ b/charts/kubedb-grafana-dashboards/dashboards/mssqlserver/mssqlserver_database_dashboard.json @@ -1,3 +1,5 @@ +{{- $shared := and (eq .Values.app.name "") (eq .Values.app.namespace "") -}} +{{- $alerts := (eq $.Values.dashboard.alerts true) -}} { "annotations": { "list": [ @@ -138,7 +140,7 @@ "instant": true, "interval": "", "intervalFactor": 1, - "legendFormat": "{{ pod }}", + "legendFormat": {{ `"{{pod}}"` }}, "refId": "A" } ], @@ -242,7 +244,7 @@ "format": "table", "instant": true, "interval": "", - "legendFormat": "{{ pod }}", + "legendFormat": {{ `"{{pod}}"` }}, "refId": "A" } ], @@ -400,7 +402,7 @@ "expr": "mssql_pod_role{namespace=~\"$namespace\",service=~\"$app+-stats\"}", "instant": true, "interval": "", - "legendFormat": "{{pod}}", + "legendFormat": {{ `"{{pod}}"` }}, "refId": "A" } ], @@ -492,7 +494,7 @@ "expr": "mssql_pod_role{namespace=~\"$namespace\", service=~\"$app+-stats\"}", "instant": true, "interval": "", - "legendFormat": "{{pod}}", + "legendFormat": {{ `"{{pod}}"` }}, "refId": "A" } ], @@ -659,7 +661,7 @@ "expr": "mssql_pod_role{namespace=~\"$namespace\",service=~\"$app+-stats\"}", "instant": true, "interval": "", - "legendFormat": "{{role}}", + "legendFormat": {{ `"{{role}}"` }}, "refId": "A" } ], @@ -728,7 +730,7 @@ "exemplar": true, "expr": "rate(sqlserver_compilations_per_sec{namespace=~\"$namespace\",service=~\"$app+-stats\"}[5m])", "interval": "", - "legendFormat": "{{pod}}", + "legendFormat": {{ `"{{pod}}"` }}, "refId": "A" } ], @@ -825,7 +827,7 @@ "exemplar": true, "expr": "rate(mssql_batch_requests{namespace=~\"$namespace\",service=~\"$app+-stats\"}[5m])", "interval": "", - "legendFormat": "{{pod}}", + "legendFormat": {{ `"{{pod}}"` }}, "refId": "A" } ], @@ -929,7 +931,7 @@ "format": "time_series", "interval": "", "intervalFactor": 1, - "legendFormat": "{{db}}", + "legendFormat": {{ `"{{db}}"` }}, "refId": "A" } ], @@ -1029,7 +1031,7 @@ "format": "time_series", "interval": "", "intervalFactor": 1, - "legendFormat": "{{db}}", + "legendFormat": {{ `"{{db}}"` }}, "refId": "B" } ], @@ -1079,7 +1081,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "Prometheus", + "datasource": "${datasource}", "fieldConfig": { "defaults": {}, "overrides": [] @@ -1125,7 +1127,7 @@ "exemplar": true, "expr": "mssql_io_stall_total_seconds{}", "interval": "", - "legendFormat": "{{db}}", + "legendFormat": {{ `"{{db}}"` }}, "refId": "A" } ], @@ -1186,7 +1188,7 @@ "text": "Prometheus", "value": "Prometheus" }, - "description": null, + "description": "MSSQLServer Overview", "error": null, "hide": 0, "includeAll": false, @@ -1210,7 +1212,7 @@ }, "datasource": "${datasource}", "definition": "label_values(kube_namespace_created,namespace)", - "description": null, + "description": "MSSQLServer Overview", "error": null, "hide": 0, "includeAll": false, @@ -1218,10 +1220,16 @@ "multi": false, "name": "namespace", "options": [], + {{- 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, @@ -1249,10 +1257,16 @@ "multi": false, "name": "app", "options": [], + {{- if $shared }} "query": { "query": "label_values(kubedb_com_mysql_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, @@ -1263,6 +1277,7 @@ "type": "query", "useTags": false } + {{- end }} ] }, "time": { @@ -1271,7 +1286,11 @@ }, "timepicker": {}, "timezone": "", + {{- if $shared }} "title": "KubeDB / MSSQLServer / Database", + {{- else }} + "title": {{ printf "KubeDB / MSSQLServer / Database / %s / %s" $.Values.app.namespace $.Values.app.name | quote }}, + {{- end }} "uid": "ohrahgv7T", "version": 37 } \ No newline at end of file diff --git a/charts/kubedb-grafana-dashboards/dashboards/mssqlserver/mssqlserver_pod_dashboard.json b/charts/kubedb-grafana-dashboards/dashboards/mssqlserver/mssqlserver_pod_dashboard.json index c0f3c8dfc..e3f035ea6 100644 --- a/charts/kubedb-grafana-dashboards/dashboards/mssqlserver/mssqlserver_pod_dashboard.json +++ b/charts/kubedb-grafana-dashboards/dashboards/mssqlserver/mssqlserver_pod_dashboard.json @@ -122,7 +122,7 @@ "format": "table", "instant": true, "interval": "", - "legendFormat": "{{phase}}", + "legendFormat": {{ `"{{phase}}"` }}, "refId": "A" } ], @@ -284,7 +284,7 @@ "format": "time_series", "instant": true, "interval": "", - "legendFormat": "{{clientTLS}}", + "legendFormat": {{ `"{{clientTLS}}"` }}, "refId": "A" } ], @@ -366,7 +366,7 @@ "format": "table", "instant": true, "interval": "", - "legendFormat": "{{deletionPolicy}}", + "legendFormat": {{ `"{{deletionPolicy}}"` }}, "refId": "A" } ], @@ -795,7 +795,7 @@ "exemplar": true, "expr": "sum(sum by(namespace,pod,container)(irate(container_cpu_usage_seconds_total{image!=\"\",job=\"kubelet\",metrics_path=\"/metrics/cadvisor\",namespace=\"$namespace\", pod=~\"$app-aggregator-\\\\d+$|$app-leaf-\\\\d+$|$app-\\\\d+$\"}[5m]))* on (namespace, pod) group_left (node) topk by (namespace, pod) (1, max by (namespace, pod, node) (kube_pod_info{node!=\"\",namespace=\"$namespace\", pod=~\"$app-aggregator-\\\\d+$|$app-leaf-\\\\d+$|$app-\\\\d+$\"}))) by (pod)", "interval": "", - "legendFormat": "{{pod}}", + "legendFormat": {{ `"{{pod}}"` }}, "refId": "A" } ], @@ -1198,7 +1198,7 @@ "exemplar": true, "expr": "sum(node_namespace_pod_container:container_memory_working_set_bytes{namespace=\"$namespace\", pod=~\"$app-leaf-\\\\d+$|$app-aggregator-\\\\d+$|$app-\\\\d+$\",container!=\"\"}) by (pod)", "interval": "", - "legendFormat": "{{pod}}", + "legendFormat": {{ `"{{pod}}"` }}, "refId": "A" } ], @@ -1705,7 +1705,7 @@ "exemplar": true, "expr": "avg(container_blkio_device_usage_total{namespace=\"$namespace\", pod=~\"$app-aggregator-\\\\d+$|$app-leaf-\\\\d+$|$app-\\\\d+\"}) by (pod)", "interval": "", - "legendFormat": "{{pod}}", + "legendFormat": {{ `"{{pod}}"` }}, "refId": "A" } ], @@ -1804,7 +1804,7 @@ "instant": false, "interval": "", "intervalFactor": 1, - "legendFormat": "{{pod}}-disk-write", + "legendFormat": {{ `"{{pod}}-disk-write"` }}, "refId": "A" }, { @@ -1813,7 +1813,7 @@ "hide": false, "instant": false, "interval": "", - "legendFormat": "{{pod}}-disk-read", + "legendFormat": {{ `"{{pod}}-disk-read"` }}, "refId": "B" } ], @@ -1912,7 +1912,7 @@ "format": "time_series", "interval": "", "intervalFactor": 2, - "legendFormat": "{{pod}}", + "legendFormat": {{ `"{{pod}}"` }}, "legendLink": null, "refId": "A", "step": 10 @@ -2013,7 +2013,7 @@ "format": "time_series", "interval": "", "intervalFactor": 2, - "legendFormat": "{{pod}}", + "legendFormat": {{ `"{{pod}}"` }}, "legendLink": null, "refId": "A", "step": 10 @@ -2522,7 +2522,7 @@ "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}}", + "legendFormat": {{ `"{{pod}}"` }}, "refId": "A" } ], @@ -2606,7 +2606,7 @@ "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}}", + "legendFormat": {{ `"{{pod}}"` }}, "refId": "A" } ], @@ -2679,7 +2679,7 @@ "format": "time_series", "interval": "", "intervalFactor": 2, - "legendFormat": "{{pod}}", + "legendFormat": {{ `"{{pod}}"` }}, "legendLink": null, "refId": "A", "step": 10 @@ -2780,7 +2780,7 @@ "format": "time_series", "interval": "", "intervalFactor": 2, - "legendFormat": "{{pod}}", + "legendFormat": {{ `"{{pod}}"` }}, "legendLink": null, "refId": "A", "step": 10