diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 07068d931..c08224c5b 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -44,6 +44,65 @@ jobs:
./hack/scripts/update-chart-dependencies.sh
make ci
+ - name: Test Grafana Dashboards
+ run: |
+ echo "all db dashboards"
+ helm template charts/kubedb-grafana-dashboards
+ echo "-----------------------------------------"
+ echo "elasticsearch dashboard with alerts"
+ helm template charts/kubedb-grafana-dashboards \
+ --set resources[0]=elasticsearch \
+ --set app.name=mydb \
+ --set app.namespace=demo
+ echo "-----------------------------------------"
+ echo "kafka dashboard with alerts"
+ helm template charts/kubedb-grafana-dashboards \
+ --set resources[0]=kafka \
+ --set app.name=mydb \
+ --set app.namespace=demo
+ echo "-----------------------------------------"
+ echo "mariadb dashboard with alerts"
+ helm template charts/kubedb-grafana-dashboards \
+ --set resources[0]=mariadb \
+ --set app.name=mydb \
+ --set app.namespace=demo
+ echo "-----------------------------------------"
+ echo "mongodb dashboard with alerts"
+ helm template charts/kubedb-grafana-dashboards \
+ --set resources[0]=mongodb \
+ --set app.name=mydb \
+ --set app.namespace=demo
+ echo "-----------------------------------------"
+ echo "mysql dashboard with alerts"
+ helm template charts/kubedb-grafana-dashboards \
+ --set resources[0]=mysql \
+ --set app.name=mydb \
+ --set app.namespace=demo
+ echo "-----------------------------------------"
+ echo "perconaxtradb dashboard with alerts"
+ helm template charts/kubedb-grafana-dashboards \
+ --set resources[0]=perconaxtradb \
+ --set app.name=mydb \
+ --set app.namespace=demo
+ echo "-----------------------------------------"
+ echo "postgres dashboard with alerts"
+ helm template charts/kubedb-grafana-dashboards \
+ --set resources[0]=postgres \
+ --set app.name=mydb \
+ --set app.namespace=demo
+ echo "-----------------------------------------"
+ echo "proxysql dashboard with alerts"
+ helm template charts/kubedb-grafana-dashboards \
+ --set resources[0]=proxysql \
+ --set app.name=mydb \
+ --set app.namespace=demo
+ echo "-----------------------------------------"
+ echo "redis dashboard with alerts"
+ helm template charts/kubedb-grafana-dashboards \
+ --set resources[0]=redis \
+ --set app.name=mydb \
+ --set app.namespace=demo
+
kubernetes:
name: Kubernetes
runs-on: ubuntu-20.04
diff --git a/charts/kubedb-grafana-dashboards/README.md b/charts/kubedb-grafana-dashboards/README.md
index f0c519a06..7e4d7f1fe 100644
--- a/charts/kubedb-grafana-dashboards/README.md
+++ b/charts/kubedb-grafana-dashboards/README.md
@@ -45,23 +45,31 @@ The command removes all the Kubernetes components associated with the chart and
The following table lists the configurable parameters of the `kubedb-grafana-dashboards` chart and their default values.
-| Parameter | Description | Default |
-|---------------------------------|--------------------------------------------------------------------|------------------------------------------------------------------------------------------|
-| nameOverride | Overrides name template | ""
|
-| fullnameOverride | Overrides fullname template | ""
|
-| resources | List of resources for which dashboards will be applied | ["elasticsearch","mariadb","mongodb","mysql","postgres","redis","proxysql"]
|
-| dashboard.folderID | ID of Grafana folder where these dashboards will be applied | 0
|
-| dashboard.overwrite | If true, dashboard with matching uid will be overwritten | true
|
-| dashboard.templatize.title | If true, datasource will be prefixed to dashboard name | false
|
-| dashboard.templatize.datasource | If true, datasource will be hardcoded in the dashboard | false
|
-| grafana.name | Name of Grafana Appbinding where these dashboards are applied | ""
|
-| grafana.namespace | Namespace of Grafana Appbinding where these dashboards are applied | ""
|
+| Parameter | Description | Default |
+|---------------------------------|--------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------|
+| nameOverride | Overrides name template | ""
|
+| fullnameOverride | Overrides fullname template | ""
|
+| resources | List of resources for which dashboards will be applied | ["elasticsearch","kafka","mariadb","mongodb","mysql","perconaxtradb","postgres","proxysql","redis"]
|
+| dashboard.folderID | ID of Grafana folder where these dashboards will be applied | 0
|
+| dashboard.overwrite | If true, dashboard with matching uid will be overwritten | true
|
+| dashboard.templatize.title | If true, datasource will be prefixed to dashboard name | false
|
+| dashboard.templatize.datasource | If true, datasource will be hardcoded in the dashboard | false
|
+| dashboard.alerts | | false
|
+| dashboard.replacements | | {}
|
+| grafana.name | Name of Grafana Appbinding where these dashboards are applied | ""
|
+| grafana.namespace | Namespace of Grafana Appbinding where these dashboards are applied | ""
|
+| grafana.version | | 8.2.3
|
+| grafana.jobName | | kubedb-databases
|
+| grafana.url | | ""
|
+| grafana.apikey | | ""
|
+| app.name | | ""
|
+| app.namespace | | ""
|
Specify each parameter using the `--set key=value[,key=value]` argument to `helm upgrade -i`. For example:
```bash
-$ helm upgrade -i kubedb-grafana-dashboards appscode/kubedb-grafana-dashboards -n kubeops --create-namespace --version=v2023.12.11 --set resources=["elasticsearch","mariadb","mongodb","mysql","postgres","redis","proxysql"]
+$ helm upgrade -i kubedb-grafana-dashboards appscode/kubedb-grafana-dashboards -n kubeops --create-namespace --version=v2023.12.11 --set resources=["elasticsearch","kafka","mariadb","mongodb","mysql","perconaxtradb","postgres","proxysql","redis"]
```
Alternatively, a YAML file that specifies the values for the parameters can be provided while
diff --git a/charts/kubedb-grafana-dashboards/ci/ci-values.yaml b/charts/kubedb-grafana-dashboards/ci/ci-values.yaml
index 54ca53d09..4fd52bc3d 100644
--- a/charts/kubedb-grafana-dashboards/ci/ci-values.yaml
+++ b/charts/kubedb-grafana-dashboards/ci/ci-values.yaml
@@ -1,2 +1,7 @@
grafana:
name: "grafana-appbinding"
+dashboard:
+ replacements:
+ job=\"kube-state-metrics\": job=\"kubernetes-service-endpoints\"
+ job=\"kubelet\": job=\"kubernetes-nodes-cadvisor\"
+ job=\"repl-stats\": job=\"kubedb-databases\"
diff --git a/charts/kubedb-grafana-dashboards/dashboards/elasticsearch/elasticsearch_database_dashboard.json b/charts/kubedb-grafana-dashboards/dashboards/elasticsearch/elasticsearch_database_dashboard.json
index c4fc87967..ca76f35f7 100644
--- a/charts/kubedb-grafana-dashboards/dashboards/elasticsearch/elasticsearch_database_dashboard.json
+++ b/charts/kubedb-grafana-dashboards/dashboards/elasticsearch/elasticsearch_database_dashboard.json
@@ -1,3 +1,4 @@
+{{- $shared := and (eq .Values.app.name "") (eq .Values.app.namespace "") -}}
{
"annotations": {
"list": [
@@ -940,7 +941,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{name}}",
+ "legendFormat": {{ `"{{name}}"` }},
"refId": "A",
"step": 240
}
@@ -1044,7 +1045,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{name}}",
+ "legendFormat": {{ `"{{name}}"` }},
"refId": "A",
"step": 240
}
@@ -1145,7 +1146,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 1,
- "legendFormat": "{{name}}",
+ "legendFormat": {{ `"{{name}}"` }},
"refId": "A"
}
],
@@ -1246,7 +1247,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 1,
- "legendFormat": "{{name}}",
+ "legendFormat": {{ `"{{name}}"` }},
"refId": "A"
}
],
@@ -1366,7 +1367,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{name}}",
+ "legendFormat": {{ `"{{name}}"` }},
"metric": "",
"refId": "A",
"step": 1800
@@ -1474,7 +1475,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{name}}",
+ "legendFormat": {{ `"{{name}}"` }},
"metric": "",
"refId": "A",
"step": 1800
@@ -1587,7 +1588,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{ name }}",
+ "legendFormat": {{ `"{{name}}"` }},
"metric": "elasticsearch_breakers_tripped",
"metrics": [
{
@@ -1700,7 +1701,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{ name }}",
+ "legendFormat": {{ `"{{name}}"` }},
"refId": "A",
"step": 240
}
@@ -1806,7 +1807,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{name}}-RX",
+ "legendFormat": {{ `"{{name}}-RX"` }},
"refId": "A",
"step": 240
},
@@ -1816,7 +1817,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{name}}-TX",
+ "legendFormat": {{ `"{{name}}-TX"` }},
"refId": "B",
"step": 240
}
@@ -1919,7 +1920,7 @@
"expr": "irate(elasticsearch_jvm_gc_collection_seconds_sum{namespace=~\"$namespace\",cluster=~\"$app\"}[1m])",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{ name }} {{ gc }}",
+ "legendFormat": {{ `"{{ name }} {{ gc }}"` }},
"refId": "A",
"step": 240
}
@@ -2008,7 +2009,6 @@
"value": "default"
},
"datasource": "${datasource}",
- "definition": "label_values(kube_namespace_labels,namespace)",
"description": null,
"error": null,
"hide": 0,
@@ -2017,7 +2017,13 @@
"multi": false,
"name": "namespace",
"options": [],
+ {{- if $shared }}
"query": "label_values(kube_namespace_labels,namespace)",
+ "type": "query",
+ {{- else }}
+ "query": {{ $.Values.app.namespace | quote }},
+ "type": "constant",
+ {{- end }}
"refresh": 1,
"regex": "",
"skipUrlSync": false,
@@ -2025,7 +2031,6 @@
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
- "type": "query",
"useTags": false
},
{
@@ -2040,7 +2045,6 @@
]
},
"datasource": "${datasource}",
- "definition": "label_values(elasticsearch_cluster_health_status{namespace=~\"$namespace\"},cluster)",
"description": null,
"error": null,
"hide": 0,
@@ -2049,7 +2053,13 @@
"multi": true,
"name": "app",
"options": [],
+ {{- if $shared }}
"query": "label_values(elasticsearch_cluster_health_status{namespace=~\"$namespace\"},cluster)",
+ "type": "query",
+ {{- else }}
+ "query": {{ $.Values.app.name | quote }},
+ "type": "constant",
+ {{- end }}
"refresh": 1,
"regex": "",
"skipUrlSync": false,
@@ -2057,7 +2067,6 @@
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
- "type": "query",
"useTags": false
}
]
@@ -2092,7 +2101,11 @@
]
},
"timezone": "utc",
+ {{- if $shared }}
"title": "KubeDB / Elasticsearch / Database",
+ {{- else }}
+ "title": {{ printf "KubeDB / Elasticsearch / Database / %s / %s" $.Values.app.namespace $.Values.app.name | quote }},
+ {{- end }}
"uid": "0dBMIuN7k",
"version": 4
}
\ No newline at end of file
diff --git a/charts/kubedb-grafana-dashboards/dashboards/elasticsearch/elasticsearch_pod_dashboard.json b/charts/kubedb-grafana-dashboards/dashboards/elasticsearch/elasticsearch_pod_dashboard.json
index 580bfd95f..4a2b6c2e5 100644
--- a/charts/kubedb-grafana-dashboards/dashboards/elasticsearch/elasticsearch_pod_dashboard.json
+++ b/charts/kubedb-grafana-dashboards/dashboards/elasticsearch/elasticsearch_pod_dashboard.json
@@ -1,3 +1,4 @@
+{{- $shared := and (eq .Values.app.name "") (eq .Values.app.namespace "") -}}
{
"annotations": {
"list": [
@@ -194,7 +195,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 1,
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -300,7 +301,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 1,
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -404,7 +405,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{ pod }}",
+ "legendFormat": {{ `"{{pod}}"` }},
"metric": "elasticsearch_cluster_health_number_of_nodes",
"refId": "A",
"step": 1800
@@ -512,7 +513,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 1,
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -1120,7 +1121,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{name}}",
+ "legendFormat": {{ `"{{name}}"` }},
"metric": "",
"refId": "A",
"step": 1800
@@ -1228,7 +1229,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{name}}",
+ "legendFormat": {{ `"{{name}}"` }},
"metric": "",
"refId": "A",
"step": 1800
@@ -1341,7 +1342,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{ name }}",
+ "legendFormat": {{ `"{{name}}"` }},
"metric": "elasticsearch_breakers_tripped",
"metrics": [
{
@@ -1454,7 +1455,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{ name }}",
+ "legendFormat": {{ `"{{name}}"` }},
"refId": "A",
"step": 240
}
@@ -1560,7 +1561,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{name}}-RX",
+ "legendFormat": {{ `"{{name}}-RX"` }},
"refId": "A",
"step": 240
},
@@ -1570,7 +1571,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{name}}-TX",
+ "legendFormat": {{ `"{{name}}-TX"` }},
"refId": "B",
"step": 240
}
@@ -1673,7 +1674,7 @@
"expr": "irate(elasticsearch_jvm_gc_collection_seconds_sum{namespace=~\"$namespace\",cluster=~\"$app\",pod=~\"$pod\"}[1m])",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{ name }} {{ gc }}",
+ "legendFormat": {{ `"{{ name }} {{ gc }}"` }},
"refId": "A",
"step": 240
}
@@ -1792,7 +1793,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{name}}",
+ "legendFormat": {{ `"{{name}}"` }},
"refId": "A",
"step": 240
}
@@ -1896,7 +1897,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{name}}",
+ "legendFormat": {{ `"{{name}}"` }},
"refId": "A",
"step": 240
}
@@ -1997,7 +1998,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 1,
- "legendFormat": "{{name}}",
+ "legendFormat": {{ `"{{name}}"` }},
"refId": "A"
}
],
@@ -2098,7 +2099,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 1,
- "legendFormat": "{{name}}",
+ "legendFormat": {{ `"{{name}}"` }},
"refId": "A"
}
],
@@ -2187,7 +2188,6 @@
"value": "demo"
},
"datasource": "${datasource}",
- "definition": "label_values(kube_namespace_labels,namespace)",
"description": null,
"error": null,
"hide": 0,
@@ -2196,7 +2196,13 @@
"multi": false,
"name": "namespace",
"options": [],
+ {{- if $shared }}
"query": "label_values(kube_namespace_labels,namespace)",
+ "type": "query",
+ {{- else }}
+ "query": {{ $.Values.app.namespace | quote }},
+ "type": "constant",
+ {{- end }}
"refresh": 1,
"regex": "",
"skipUrlSync": false,
@@ -2204,7 +2210,6 @@
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
- "type": "query",
"useTags": false
},
{
@@ -2215,7 +2220,6 @@
"value": "sample-es-cpu"
},
"datasource": "${datasource}",
- "definition": "label_values(elasticsearch_cluster_health_status{namespace=~\"$namespace\"},cluster)",
"description": null,
"error": null,
"hide": 0,
@@ -2224,7 +2228,13 @@
"multi": false,
"name": "app",
"options": [],
+ {{- if $shared }}
"query": "label_values(elasticsearch_cluster_health_status{namespace=~\"$namespace\"},cluster)",
+ "type": "query",
+ {{- else }}
+ "query": {{ $.Values.app.name | quote }},
+ "type": "constant",
+ {{- end }}
"refresh": 1,
"regex": "",
"skipUrlSync": false,
@@ -2232,7 +2242,6 @@
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
- "type": "query",
"useTags": false
},
{
@@ -2299,7 +2308,11 @@
]
},
"timezone": "utc",
+ {{- if $shared }}
"title": "KubeDB / Elasticsearch / Pod",
+ {{- else }}
+ "title": {{ printf "KubeDB / Elasticsearch / Pod / %s / %s" $.Values.app.namespace $.Values.app.name | quote }},
+ {{- end }}
"uid": "sjfsldk",
"version": 3
}
\ No newline at end of file
diff --git a/charts/kubedb-grafana-dashboards/dashboards/elasticsearch/elasticsearch_summary_dashboard.json b/charts/kubedb-grafana-dashboards/dashboards/elasticsearch/elasticsearch_summary_dashboard.json
index fc3fa55c6..b3f898b2a 100644
--- a/charts/kubedb-grafana-dashboards/dashboards/elasticsearch/elasticsearch_summary_dashboard.json
+++ b/charts/kubedb-grafana-dashboards/dashboards/elasticsearch/elasticsearch_summary_dashboard.json
@@ -1,3 +1,4 @@
+{{- $shared := and (eq .Values.app.name "") (eq .Values.app.namespace "") -}}
{
"annotations": {
"list": [
@@ -121,7 +122,7 @@
"format": "table",
"instant": true,
"interval": "",
- "legendFormat": "{{phase}}",
+ "legendFormat": {{ `"{{phase}}"` }},
"refId": "A"
}
],
@@ -279,7 +280,7 @@
"instant": true,
"interval": "",
"intervalFactor": 1,
- "legendFormat": "{{version}}",
+ "legendFormat": {{ `"{{version}}"` }},
"refId": "A"
}
],
@@ -441,7 +442,7 @@
"format": "table",
"instant": true,
"interval": "",
- "legendFormat": "{{terminationPolicy}}",
+ "legendFormat": {{ `"{{terminationPolicy}}"` }},
"refId": "A"
}
],
@@ -874,7 +875,7 @@
"exemplar": true,
"expr": "sum(node_namespace_pod_container:container_cpu_usage_seconds_total:sum_irate{namespace=\"$namespace\", pod=~\"$app-.+$\"}) by (pod)",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -1286,7 +1287,7 @@
"exemplar": true,
"expr": "sum(node_namespace_pod_container:container_memory_working_set_bytes{namespace=\"$namespace\", pod=~\"$app-.+$\",container!=\"\"}) by (pod)",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -1804,7 +1805,7 @@
"exemplar": true,
"expr": "avg(container_blkio_device_usage_total{namespace=\"$namespace\", pod=~\"$app-.+$\"}) by (pod)",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -1914,7 +1915,7 @@
"instant": false,
"interval": "",
"intervalFactor": 1,
- "legendFormat": "{{pod}}-disk-write",
+ "legendFormat": {{ `"{{pod}}-disk-write"` }},
"refId": "A"
},
{
@@ -1923,7 +1924,7 @@
"hide": false,
"instant": false,
"interval": "",
- "legendFormat": "{{pod}}-disk-read",
+ "legendFormat": {{ `"{{pod}}-disk-read"` }},
"refId": "B"
}
],
@@ -2033,7 +2034,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"legendLink": null,
"refId": "A",
"step": 10
@@ -2145,7 +2146,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"legendLink": null,
"refId": "A",
"step": 10
@@ -2654,7 +2655,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"
}
],
@@ -2738,7 +2739,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"
}
],
@@ -2824,7 +2825,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"legendLink": null,
"refId": "A",
"step": 10
@@ -2936,7 +2937,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"legendLink": null,
"refId": "A",
"step": 10
@@ -2998,7 +2999,6 @@
"value": "default"
},
"datasource": null,
- "definition": "label_values(kube_namespace_labels,namespace)",
"description": null,
"error": null,
"hide": 0,
@@ -3007,10 +3007,16 @@
"multi": false,
"name": "namespace",
"options": [],
+ {{- if $shared }}
"query": {
"query": "label_values(kube_namespace_labels,namespace)",
"refId": "Prometheus-namespace-Variable-Query"
},
+ "type": "query",
+ {{- else }}
+ "query": {{ $.Values.app.namespace | quote }},
+ "type": "constant",
+ {{- end }}
"refresh": 1,
"regex": "",
"skipUrlSync": false,
@@ -3018,7 +3024,6 @@
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
- "type": "query",
"useTags": false
},
{
@@ -3029,7 +3034,6 @@
"value": "es-prod"
},
"datasource": null,
- "definition": "label_values(kubedb_com_elasticsearch_status_phase{namespace=~\"$namespace\"},app)",
"description": null,
"error": null,
"hide": 0,
@@ -3038,10 +3042,16 @@
"multi": false,
"name": "app",
"options": [],
+ {{- if $shared }}
"query": {
"query": "label_values(kubedb_com_elasticsearch_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,
@@ -3049,7 +3059,6 @@
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
- "type": "query",
"useTags": false
}
]
@@ -3084,7 +3093,11 @@
]
},
"timezone": "",
+ {{- if $shared }}
"title": "KubeDB / Elasticsearch / Summary",
+ {{- else }}
+ "title": {{ printf "KubeDB / Elasticsearch / Summary / %s / %s" $.Values.app.namespace $.Values.app.name | quote }},
+ {{- end }}
"uid": "72W2px6Vk",
"version": 5
}
\ No newline at end of file
diff --git a/charts/kubedb-grafana-dashboards/dashboards/kafka/kafka_database_dashboard.json b/charts/kubedb-grafana-dashboards/dashboards/kafka/kafka_database_dashboard.json
index 7820eb47e..0c4392c31 100644
--- a/charts/kubedb-grafana-dashboards/dashboards/kafka/kafka_database_dashboard.json
+++ b/charts/kubedb-grafana-dashboards/dashboards/kafka/kafka_database_dashboard.json
@@ -1,3 +1,4 @@
+{{- $shared := and (eq .Values.app.name "") (eq .Values.app.namespace "") -}}
{
"annotations": {
"list": [
@@ -641,7 +642,7 @@
"format": "time_series",
"interval": "60s",
"intervalFactor": 1,
- "legendFormat": "{{gc}}",
+ "legendFormat": {{ `"{{gc}}"` }},
"metric": "jvm_gc_collection_seconds_sum",
"refId": "A",
"step": 10
@@ -731,7 +732,7 @@
"format": "time_series",
"interval": "60s",
"intervalFactor": 1,
- "legendFormat": "{{gc}}",
+ "legendFormat": {{ `"{{gc}}"` }},
"metric": "",
"refId": "A",
"step": 10
@@ -2113,7 +2114,7 @@
"exemplar": false,
"expr": "kafka_server_kafkarequesthandlerpool_requesthandleravgidle_percent{namespace=\"$namespace\", service=\"$service\"}",
"instant": false,
- "legendFormat": "{{ pod }}",
+ "legendFormat": {{ `"{{pod}}"` }},
"range": true,
"refId": "A"
}
@@ -2598,7 +2599,7 @@
"expr": "kafka_server_raft_metrics_commit_latency_avg{container=\"$container\", namespace=\"$namespace\", pod=\"$pod\"}",
"instant": false,
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -2668,7 +2669,7 @@
"format": "table",
"instant": true,
"interval": "",
- "legendFormat": "{{ pod }}",
+ "legendFormat": {{ `"{{pod}}"` }},
"range": false,
"refId": "A"
}
@@ -2840,7 +2841,7 @@
"format": "table",
"instant": true,
"interval": "",
- "legendFormat": "{{ pod }}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -2907,7 +2908,7 @@
"format": "time_series",
"instant": true,
"interval": "",
- "legendFormat": "{{ pod }}",
+ "legendFormat": {{ `"{{pod}}"` }},
"range": false,
"refId": "A"
}
@@ -3377,7 +3378,7 @@
"format": "table",
"instant": true,
"interval": "",
- "legendFormat": "{{ $pod }}",
+ "legendFormat": {{ `"{{$pod}}"` }},
"refId": "A"
}
],
@@ -3651,24 +3652,28 @@
"type": "prometheus",
"uid": "$datasource"
},
- "definition": "label_values(jvm_info, namespace)",
"hide": 0,
"includeAll": false,
"label": "",
"multi": false,
"name": "namespace",
"options": [],
+ {{- if $shared }}
"query": {
"query": "label_values(jvm_info, namespace)",
"refId": "StandardVariableQuery"
},
+ "type": "query",
+ {{- else }}
+ "query": {{ $.Values.app.namespace | quote }},
+ "type": "constant",
+ {{- end }}
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 1,
"tagValuesQuery": "",
"tagsQuery": "",
- "type": "query",
"useTags": false
},
{
@@ -3860,7 +3865,11 @@
]
},
"timezone": "utc",
+ {{- if $shared }}
"title": "KubeDB / Kafka / Database",
+ {{- else }}
+ "title": {{ printf "KubeDB / Kafka / Database / %s / %s" $.Values.app.namespace $.Values.app.name | quote }},
+ {{- end }}
"uid": "LwWjURa4k",
"version": 1,
"weekStart": ""
diff --git a/charts/kubedb-grafana-dashboards/dashboards/mariadb/mariadb-database.json b/charts/kubedb-grafana-dashboards/dashboards/mariadb/mariadb-database.json
index 78cdc7224..76486c0a2 100644
--- a/charts/kubedb-grafana-dashboards/dashboards/mariadb/mariadb-database.json
+++ b/charts/kubedb-grafana-dashboards/dashboards/mariadb/mariadb-database.json
@@ -1,3 +1,4 @@
+{{- $shared := and (eq .Values.app.name "") (eq .Values.app.namespace "") -}}
{
"annotations": {
"list": [
@@ -138,7 +139,7 @@
"instant": true,
"interval": "",
"intervalFactor": 1,
- "legendFormat": "{{ pod }}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -242,7 +243,7 @@
"format": "table",
"instant": true,
"interval": "",
- "legendFormat": "{{ pod }}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -486,7 +487,7 @@
"exemplar": true,
"expr": "rate(mysql_global_status_queries{namespace=~\"$namespace\",service=~\"$app+-stats\"}[5m])",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -588,7 +589,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 1,
- "legendFormat": "Current - {{ pod }}",
+ "legendFormat": {{ `"Current - {{ pod }}"` }},
"refId": "A"
},
{
@@ -597,7 +598,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 1,
- "legendFormat": "Max - {{ pod }}",
+ "legendFormat": {{ `"Max - {{ pod }}"` }},
"refId": "B"
}
],
@@ -703,7 +704,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 1,
- "legendFormat": "reads - {{ pod }}",
+ "legendFormat": {{ `"reads - {{ pod }}"` }},
"refId": "A"
},
{
@@ -712,7 +713,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 1,
- "legendFormat": "write - {{ pod }}",
+ "legendFormat": {{ `"write - {{ pod }}"` }},
"refId": "B"
}
],
@@ -818,7 +819,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 1,
- "legendFormat": "received - {{ pod }}",
+ "legendFormat": {{ `"received - {{ pod }}"` }},
"refId": "A"
},
{
@@ -827,7 +828,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 1,
- "legendFormat": "sent - {{ pod }}",
+ "legendFormat": {{ `"sent - {{ pod }}"` }},
"refId": "B"
}
],
@@ -928,7 +929,7 @@
"expr": "topk(3, rate(mysql_global_status_commands_total{namespace=~\"$namespace\",service=~\"$app+-stats\"}[5m]))",
"instant": false,
"interval": "",
- "legendFormat": "{{ pod }} = '{{ command }}'",
+ "legendFormat": {{ `"{{ pod }} = '{{ command }}'"` }},
"refId": "A"
}
],
@@ -1026,7 +1027,7 @@
"exemplar": true,
"expr": "rate(mysql_global_status_opened_files{namespace=~\"$namespace\",service=~\"$app+-stats\"}[1m])",
"interval": "",
- "legendFormat": "{{ pod }}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -1124,21 +1125,21 @@
"exemplar": true,
"expr": "mysql_global_status_open_files{namespace=~\"$namespace\",service=~\"$app+-stats\"}",
"interval": "",
- "legendFormat": "Open Files - {{ pod }}",
+ "legendFormat": {{ `"Open Files - {{ pod }}"` }},
"refId": "A"
},
{
"exemplar": true,
"expr": "mysql_global_variables_open_files_limit{namespace=~\"$namespace\",service=~\"$app+-stats\"}",
"interval": "",
- "legendFormat": "Open Files Limit - {{ pod }}",
+ "legendFormat": {{ `"Open Files Limit - {{ pod }}"` }},
"refId": "B"
},
{
"exemplar": true,
"expr": "mysql_global_status_innodb_num_open_files{namespace=~\"$namespace\",service=~\"$app+-stats\"}",
"interval": "",
- "legendFormat": "InnoDB Open Files - {{ pod }}",
+ "legendFormat": {{ `"InnoDB Open Files - {{ pod }}"` }},
"refId": "C"
}
],
@@ -1237,7 +1238,7 @@
"exemplar": true,
"expr": "rate(mysql_global_status_slow_queries{namespace=~\"$namespace\",service=~\"$app+-stats\"}[1m])",
"interval": "",
- "legendFormat": "Slow Queries on {{ pod }}",
+ "legendFormat": {{ `"Slow Queries on {{ pod }}"` }},
"refId": "A"
}
],
@@ -1334,14 +1335,14 @@
"exemplar": true,
"expr": "rate(mysql_global_status_aborted_connects{namespace=~\"$namespace\",service=~\"$app+-stats\"}[5m])",
"interval": "",
- "legendFormat": "Aborted Connects (attempts) on - {{ pod }}",
+ "legendFormat": {{ `"Aborted Connects (attempts) on - {{ pod }}"` }},
"refId": "A"
},
{
"exemplar": true,
"expr": "rate(mysql_global_status_aborted_clients{namespace=~\"$namespace\",service=~\"$app+-stats\"}[5m])",
"interval": "",
- "legendFormat": "Aborted Clients (timeout) on - {{ pod }}",
+ "legendFormat": {{ `"Aborted Clients (timeout) on - {{ pod }}"` }},
"refId": "B"
}
],
@@ -1427,7 +1428,6 @@
"value": "demo"
},
"datasource": "${datasource}",
- "definition": "label_values(kube_namespace_labels,namespace)",
"description": null,
"error": null,
"hide": 0,
@@ -1436,7 +1436,13 @@
"multi": false,
"name": "namespace",
"options": [],
+ {{- if $shared }}
"query": "label_values(kube_namespace_labels,namespace)",
+ "type": "query",
+ {{- else }}
+ "query": {{ $.Values.app.namespace | quote }},
+ "type": "constant",
+ {{- end }}
"refresh": 1,
"regex": "",
"skipUrlSync": false,
@@ -1444,7 +1450,6 @@
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
- "type": "query",
"useTags": false
},
{
@@ -1455,7 +1460,6 @@
"value": "sample-mariadb-stats"
},
"datasource": "${datasource}",
- "definition": "label_values(kubedb_com_mariadb_status_phase{namespace=~\"$namespace\"},app)",
"description": "MariaDB stats service name",
"error": null,
"hide": 0,
@@ -1464,7 +1468,13 @@
"multi": false,
"name": "app",
"options": [],
+ {{- if $shared }}
"query": "label_values(kubedb_com_mariadb_status_phase{namespace=~\"$namespace\"},app)",
+ "type": "query",
+ {{- else }}
+ "query": {{ $.Values.app.name | quote }},
+ "type": "constant",
+ {{- end }}
"refresh": 1,
"regex": "",
"skipUrlSync": false,
@@ -1472,7 +1482,6 @@
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
- "type": "query",
"useTags": false
}
]
@@ -1483,7 +1492,11 @@
},
"timepicker": {},
"timezone": "",
+ {{- if $shared }}
"title": "KubeDB / MariaDB / Database",
+ {{- else }}
+ "title": {{ printf "KubeDB / MariaDB / Database / %s / %s" $.Values.app.namespace $.Values.app.name | quote }},
+ {{- end }}
"uid": "ohrahgv7z",
"version": 8
}
\ No newline at end of file
diff --git a/charts/kubedb-grafana-dashboards/dashboards/mariadb/mariadb-galera.json b/charts/kubedb-grafana-dashboards/dashboards/mariadb/mariadb-galera.json
index ee68bdc8f..f71e548d8 100644
--- a/charts/kubedb-grafana-dashboards/dashboards/mariadb/mariadb-galera.json
+++ b/charts/kubedb-grafana-dashboards/dashboards/mariadb/mariadb-galera.json
@@ -1,3 +1,4 @@
+{{- $shared := and (eq .Values.app.name "") (eq .Values.app.namespace "") -}}
{
"annotations": {
"list": [
@@ -80,7 +81,7 @@
"exemplar": true,
"expr": "avg by(wsrep_cluster_name)(mysql_galera_variables_info{namespace=~\"$namespace\",service=~\"$app+-stats\"})",
"interval": "",
- "legendFormat": "{{wsrep_cluster_name}}",
+ "legendFormat": {{ `"{{wsrep_cluster_name}}"` }},
"refId": "A"
}
],
@@ -182,7 +183,7 @@
"exemplar": true,
"expr": "avg by(pod)(mysql_galera_variables_info{namespace=~\"$namespace\",service=~\"$app+-stats\"})",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -256,7 +257,7 @@
"exemplar": true,
"expr": "avg_over_time(mysql_galera_evs_repl_latency_avg_seconds{namespace=~\"$namespace\",service=~\"$app+-stats\"}[5m])",
"interval": "",
- "legendFormat": "{{pod}} - Latency Average",
+ "legendFormat": {{ `"{{pod}} - Latency Average"` }},
"refId": "A"
}
],
@@ -356,7 +357,7 @@
"exemplar": true,
"expr": "rate(mysql_galera_evs_repl_latency_stdev{namespace=~\"$namespace\",service=~\"$app+-stats\"}[1m])",
"interval": "",
- "legendFormat": "{{pod}} - Latency Average",
+ "legendFormat": {{ `"{{pod}} - Latency Average"` }},
"refId": "A"
}
],
@@ -456,7 +457,7 @@
"exemplar": true,
"expr": "rate(mysql_galera_evs_repl_latency_sample_size{namespace=~\"$namespace\",service=~\"$app+-stats\"}[1m])",
"interval": "",
- "legendFormat": "{{pod}} - Latency Average",
+ "legendFormat": {{ `"{{pod}} - Latency Average"` }},
"refId": "A"
}
],
@@ -539,7 +540,6 @@
"value": "demo"
},
"datasource": "${datasource}",
- "definition": "label_values(kube_namespace_labels,namespace)",
"description": null,
"error": null,
"hide": 0,
@@ -548,7 +548,13 @@
"multi": false,
"name": "namespace",
"options": [],
+ {{- if $shared }}
"query": "label_values(kube_namespace_labels,namespace)",
+ "type": "query",
+ {{- else }}
+ "query": {{ $.Values.app.namespace | quote }},
+ "type": "constant",
+ {{- end }}
"refresh": 1,
"regex": "",
"skipUrlSync": false,
@@ -556,7 +562,6 @@
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
- "type": "query",
"useTags": false
},
{
@@ -567,7 +572,6 @@
"value": "sample-mariadb-stats"
},
"datasource": "${datasource}",
- "definition": "label_values(kubedb_com_mariadb_status_phase{namespace=~\"$namespace\"},app)",
"description": "",
"error": null,
"hide": 0,
@@ -576,7 +580,13 @@
"multi": false,
"name": "app",
"options": [],
+ {{- if $shared }}
"query": "label_values(kubedb_com_mariadb_status_phase{namespace=~\"$namespace\"},app)",
+ "type": "query",
+ {{- else }}
+ "query": {{ $.Values.app.name | quote }},
+ "type": "constant",
+ {{- end }}
"refresh": 1,
"regex": "",
"skipUrlSync": false,
@@ -584,7 +594,6 @@
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
- "type": "query",
"useTags": false
}
]
@@ -595,7 +604,11 @@
},
"timepicker": {},
"timezone": "",
+ {{- if $shared }}
"title": "KubeDB / MariaDB / Galera-Cluster",
+ {{- else }}
+ "title": {{ printf "KubeDB / MariaDB / Galera-Cluster / %s / %s" $.Values.app.namespace $.Values.app.name | quote }},
+ {{- end }}
"uid": "Zmva7c57k",
"version": 5
}
\ No newline at end of file
diff --git a/charts/kubedb-grafana-dashboards/dashboards/mariadb/mariadb-pod.json b/charts/kubedb-grafana-dashboards/dashboards/mariadb/mariadb-pod.json
index 63e3690fb..0e38aa259 100644
--- a/charts/kubedb-grafana-dashboards/dashboards/mariadb/mariadb-pod.json
+++ b/charts/kubedb-grafana-dashboards/dashboards/mariadb/mariadb-pod.json
@@ -1,3 +1,4 @@
+{{- $shared := and (eq .Values.app.name "") (eq .Values.app.namespace "") -}}
{
"annotations": {
"list": [
@@ -82,7 +83,7 @@
"exemplar": true,
"expr": "mysql_up{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}",
"interval": "",
- "legendFormat": "{{pod}} ",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -157,7 +158,7 @@
"format": "time_series",
"instant": false,
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -217,7 +218,7 @@
"exemplar": true,
"expr": "mysql_version_info{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}",
"interval": "",
- "legendFormat": "{{version}}",
+ "legendFormat": {{ `"{{version}}"` }},
"refId": "A"
}
],
@@ -273,7 +274,7 @@
"exemplar": true,
"expr": "rate(mysql_global_status_queries{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}[5m])",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -350,7 +351,7 @@
"format": "time_series",
"instant": false,
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -423,7 +424,7 @@
"exemplar": true,
"expr": "sum(rate(container_cpu_usage_seconds_total{namespace=\"$namespace\", pod=~\"$pod\", container!=\"\", image!=\"\"}[5m])) by (pod)",
"interval": "",
- "legendFormat": "{{container}}",
+ "legendFormat": {{ `"{{container}}"` }},
"refId": "A"
}
],
@@ -520,7 +521,7 @@
"exemplar": true,
"expr": "sum(container_memory_working_set_bytes{namespace=\"$namespace\", pod=~\"$pod\", container!=\"\", image!=\"\"}) by (pod)",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -618,7 +619,7 @@
"exemplar": true,
"expr": "sum(process_open_fds{pod=~\"$pod\", namespace=\"$namespace\"}) by (pod)",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -728,7 +729,7 @@
"exemplar": true,
"expr": "mysql_global_status_max_used_connections{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}",
"interval": "",
- "legendFormat": "Max Used Connects - {{pod}}",
+ "legendFormat": {{ `"Max Used Connects - {{pod}}"` }},
"refId": "A"
},
{
@@ -736,7 +737,7 @@
"expr": "mysql_global_variables_max_connections{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}",
"hide": false,
"interval": "",
- "legendFormat": "Max Connects - {{pod}}",
+ "legendFormat": {{ `"Max Connects - {{pod}}"` }},
"refId": "B"
}
],
@@ -833,7 +834,7 @@
"exemplar": true,
"expr": "mysql_global_status_aborted_connects{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}",
"interval": "",
- "legendFormat": "Aborted Connects - {{pod}}",
+ "legendFormat": {{ `"Aborted Connects - {{pod}}"` }},
"refId": "A"
},
{
@@ -841,7 +842,7 @@
"expr": "mysql_global_status_aborted_clients{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}",
"hide": false,
"interval": "",
- "legendFormat": "Aborted Clients - {{pod}}",
+ "legendFormat": {{ `"Aborted Clients - {{pod}}"` }},
"refId": "B"
}
],
@@ -954,7 +955,7 @@
"exemplar": true,
"expr": "mysql_global_status_threads_connected{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}",
"interval": "",
- "legendFormat": "Threads Connected - {{pod}}",
+ "legendFormat": {{ `"Threads Connected - {{pod}}"` }},
"refId": "A"
},
{
@@ -962,7 +963,7 @@
"expr": "mysql_global_status_threads_running{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}",
"hide": false,
"interval": "",
- "legendFormat": "Threads Running - {{pod}}",
+ "legendFormat": {{ `"Threads Running - {{pod}}"` }},
"refId": "B"
}
],
@@ -1060,7 +1061,7 @@
"exemplar": true,
"expr": "mysql_global_variables_thread_cache_size{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}",
"interval": "",
- "legendFormat": "Thread Cache Size - {{pod}}",
+ "legendFormat": {{ `"Thread Cache Size - {{pod}}"` }},
"refId": "A"
},
{
@@ -1068,7 +1069,7 @@
"expr": "mysql_global_status_threads_cached{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}",
"hide": false,
"interval": "",
- "legendFormat": "Threads Cached - {{pod}} ",
+ "legendFormat": {{ `"Threads Cached - {{pod}}"` }},
"refId": "B"
},
{
@@ -1076,7 +1077,7 @@
"expr": "mysql_global_status_threads_created{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}",
"hide": false,
"interval": "",
- "legendFormat": "Threads Created - {{pod}}",
+ "legendFormat": {{ `"Threads Created - {{pod}}"` }},
"refId": "C"
}
],
@@ -1188,7 +1189,7 @@
"exemplar": true,
"expr": "rate(mysql_global_status_created_tmp_tables{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}[5m])",
"interval": "",
- "legendFormat": "Created Tmp Tables - {{pod}}",
+ "legendFormat": {{ `"Created Tmp Tables - {{pod}}"` }},
"refId": "A"
},
{
@@ -1196,7 +1197,7 @@
"expr": "rate(mysql_global_status_created_tmp_disk_tables{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}[5m])",
"hide": false,
"interval": "",
- "legendFormat": "Created Tmp Disk Tables - {{pod}}",
+ "legendFormat": {{ `"Created Tmp Disk Tables - {{pod}}"` }},
"refId": "B"
},
{
@@ -1204,7 +1205,7 @@
"expr": "mysql_global_status_created_tmp_files{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}",
"hide": false,
"interval": "",
- "legendFormat": "Created Tmp Files - {{pod}}",
+ "legendFormat": {{ `"Created Tmp Files - {{pod}}"` }},
"refId": "C"
}
],
@@ -1302,7 +1303,7 @@
"exemplar": true,
"expr": "mysql_global_status_slow_queries{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}",
"interval": "",
- "legendFormat": "Slow Queries - {{pod}}",
+ "legendFormat": {{ `"Slow Queries - {{pod}}"` }},
"refId": "A"
}
],
@@ -1416,7 +1417,7 @@
"exemplar": true,
"expr": "rate(mysql_global_status_select_full_join{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}[5m])",
"interval": "",
- "legendFormat": "Select Full Join - {{pod}}",
+ "legendFormat": {{ `"Select Full Join - {{pod}}"` }},
"refId": "A"
},
{
@@ -1424,7 +1425,7 @@
"expr": "rate(mysql_global_status_select_scan{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}[5m])",
"hide": false,
"interval": "",
- "legendFormat": "Select Scan - {{pod}}",
+ "legendFormat": {{ `"Select Scan - {{pod}}"` }},
"refId": "E"
}
],
@@ -1522,7 +1523,7 @@
"exemplar": true,
"expr": "rate(mysql_global_status_sort_rows{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}[5m])",
"interval": "",
- "legendFormat": "Sort Rows - {{pod}}",
+ "legendFormat": {{ `"Sort Rows - {{pod}}"` }},
"refId": "A"
},
{
@@ -1530,7 +1531,7 @@
"expr": "rate(mysql_global_status_sort_range{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}[5m])",
"hide": false,
"interval": "",
- "legendFormat": "Sort Range - {{pod}}",
+ "legendFormat": {{ `"Sort Range - {{pod}}"` }},
"refId": "B"
},
{
@@ -1538,7 +1539,7 @@
"expr": "rate(mysql_global_status_sort_merge_passes{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}[5m])",
"hide": false,
"interval": "",
- "legendFormat": "Sort Merge Passes - {{pod}}",
+ "legendFormat": {{ `"Sort Merge Passes - {{pod}}"` }},
"refId": "C"
},
{
@@ -1546,7 +1547,7 @@
"expr": "rate(mysql_global_status_sort_scan{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}[5m])",
"hide": false,
"interval": "",
- "legendFormat": "Sort Scan - {{pod}}",
+ "legendFormat": {{ `"Sort Scan - {{pod}}"` }},
"refId": "D"
}
],
@@ -1657,7 +1658,7 @@
"exemplar": true,
"expr": "rate(mysql_global_status_table_locks_immediate{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}[5m])",
"interval": "",
- "legendFormat": "Table Locks Immediate - {{pod}}",
+ "legendFormat": {{ `"Table Locks Immediate - {{pod}}"` }},
"refId": "A"
},
{
@@ -1665,7 +1666,7 @@
"expr": "rate(mysql_global_status_table_locks_waited{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}[5m])",
"hide": false,
"interval": "",
- "legendFormat": "Table Locks Waited - {{pod}}",
+ "legendFormat": {{ `"Table Locks Waited - {{pod}}"` }},
"refId": "B"
}
],
@@ -1762,7 +1763,7 @@
"exemplar": true,
"expr": "rate(mysql_global_status_questions{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}[5m])",
"interval": "",
- "legendFormat": "Questions - {{pod}}",
+ "legendFormat": {{ `"Questions - {{pod}}"` }},
"refId": "A"
}
],
@@ -1890,7 +1891,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 1,
- "legendFormat": "Inbound - {{pod}}",
+ "legendFormat": {{ `"Inbound - {{pod}}"` }},
"metric": "",
"refId": "A",
"step": 20
@@ -1904,7 +1905,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 1,
- "legendFormat": "Outbound - {{pod}}",
+ "legendFormat": {{ `"Outbound - {{pod}}"` }},
"metric": "",
"refId": "B",
"step": 20
@@ -2021,7 +2022,7 @@
"instant": false,
"interval": "1h",
"intervalFactor": 1,
- "legendFormat": "Received - {{pod}}",
+ "legendFormat": {{ `"Received - {{pod}}"` }},
"metric": "",
"refId": "A",
"step": 20
@@ -2035,7 +2036,7 @@
"format": "time_series",
"interval": "1h",
"intervalFactor": 1,
- "legendFormat": "Sent - {{pod}}",
+ "legendFormat": {{ `"Sent - {{pod}}"` }},
"metric": "",
"refId": "B",
"step": 20
@@ -2153,7 +2154,7 @@
"expr": "mysql_global_variables_innodb_buffer_pool_size{namespace=\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}",
"hide": false,
"interval": "",
- "legendFormat": "InnoDB Buffer Pool Size - {{pod}}",
+ "legendFormat": {{ `"InnoDB Buffer Pool Size - {{pod}}"` }},
"refId": "A"
},
{
@@ -2161,7 +2162,7 @@
"expr": "mysql_global_variables_innodb_log_buffer_size{namespace=\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}",
"hide": false,
"interval": "",
- "legendFormat": "InnoDB Log Buffer Size - {{pod}}",
+ "legendFormat": {{ `"InnoDB Log Buffer Size - {{pod}}"` }},
"refId": "B"
},
{
@@ -2169,7 +2170,7 @@
"expr": "mysql_global_status_innodb_mem_dictionary{namespace=\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}",
"hide": false,
"interval": "",
- "legendFormat": "InnoDB Dictionary Size - {{pod}}",
+ "legendFormat": {{ `"InnoDB Dictionary Size - {{pod}}"` }},
"refId": "D"
},
{
@@ -2177,7 +2178,7 @@
"expr": "mysql_global_variables_key_buffer_size{namespace=\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}",
"hide": false,
"interval": "",
- "legendFormat": "Key Buffer Size - {{pod}}",
+ "legendFormat": {{ `"Key Buffer Size - {{pod}}"` }},
"refId": "E"
},
{
@@ -2185,7 +2186,7 @@
"expr": "mysql_global_variables_query_cache_size{namespace=\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}",
"hide": false,
"interval": "",
- "legendFormat": "Query Cache Size - {{pod}}",
+ "legendFormat": {{ `"Query Cache Size - {{pod}}"` }},
"refId": "F"
},
{
@@ -2193,7 +2194,7 @@
"expr": "mysql_global_status_innodb_mem_adaptive_hash{namespace=\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}",
"hide": false,
"interval": "",
- "legendFormat": "Adaptive Hash Index Size - {{pod}}",
+ "legendFormat": {{ `"Adaptive Hash Index Size - {{pod}}"` }},
"refId": "G"
}
],
@@ -2308,7 +2309,7 @@
"expr": "topk(5, rate(mysql_global_status_commands_total{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}[5m]))",
"instant": false,
"interval": "",
- "legendFormat": "Com_{{ command }} - {{pod}}",
+ "legendFormat": {{ `"Com_{{ command }} - {{pod}}"` }},
"refId": "A"
}
],
@@ -2424,7 +2425,7 @@
"instant": false,
"interval": "1h",
"intervalFactor": 1,
- "legendFormat": "Com_{{ command }} - {{pod}}",
+ "legendFormat": {{ `"Com_{{ command }} - {{pod}}"` }},
"metric": "",
"refId": "A",
"step": 20
@@ -2528,7 +2529,7 @@
"expr": "rate(mysql_global_status_handlers_total{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}[5m])>0",
"instant": false,
"interval": "",
- "legendFormat": "{{ handler }} - {{pod}}",
+ "legendFormat": {{ `"{{ handler }} - {{pod}}"` }},
"refId": "A"
}
],
@@ -2642,7 +2643,7 @@
"exemplar": true,
"expr": "rate(mysql_global_status_qcache_free_memory{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}[5m])",
"interval": "",
- "legendFormat": "Query Cache Size - {{pod}}",
+ "legendFormat": {{ `"Query Cache Size - {{pod}}"` }},
"refId": "A"
}
],
@@ -2742,7 +2743,7 @@
"exemplar": true,
"expr": "rate(mysql_global_status_qcache_hits{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}[5m])",
"interval": "",
- "legendFormat": "Hits - {{pod}}",
+ "legendFormat": {{ `"Hits - {{pod}}"` }},
"refId": "A"
},
{
@@ -2750,7 +2751,7 @@
"expr": "rate(mysql_global_status_qcache_inserts{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}[5m])",
"hide": false,
"interval": "",
- "legendFormat": "Inserts - {{pod}}",
+ "legendFormat": {{ `"Inserts - {{pod}}"` }},
"refId": "B"
},
{
@@ -2758,7 +2759,7 @@
"expr": "rate(mysql_global_status_qcache_not_cached{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}[5m])",
"hide": false,
"interval": "",
- "legendFormat": "Not Cached - {{pod}}",
+ "legendFormat": {{ `"Not Cached - {{pod}}"` }},
"refId": "C"
},
{
@@ -2766,7 +2767,7 @@
"expr": "rate(mysql_global_status_qcache_lowmem_prunes{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}[5m])",
"hide": false,
"interval": "",
- "legendFormat": "Prunes - {{pod}}",
+ "legendFormat": {{ `"Prunes - {{pod}}"` }},
"refId": "D"
},
{
@@ -2774,7 +2775,7 @@
"expr": "rate(mysql_global_status_qcache_queries_in_cache{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}[5m])",
"hide": false,
"interval": "",
- "legendFormat": "Queries in Cache - {{pod}}",
+ "legendFormat": {{ `"Queries in Cache - {{pod}}"` }},
"refId": "E"
}
],
@@ -2886,7 +2887,7 @@
"exemplar": true,
"expr": "mysql_global_status_opened_files{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}",
"interval": "",
- "legendFormat": "Openings - {{pod}}",
+ "legendFormat": {{ `"Openings - {{pod}}"` }},
"refId": "A"
}
],
@@ -2984,21 +2985,21 @@
"exemplar": true,
"expr": "mysql_global_status_open_files{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}",
"interval": "",
- "legendFormat": "Open Files - {{pod}}",
+ "legendFormat": {{ `"Open Files - {{pod}}"` }},
"refId": "A"
},
{
"exemplar": true,
"expr": "mysql_global_variables_open_files_limit{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}",
"interval": "",
- "legendFormat": "Open Files Limit - {{pod}}",
+ "legendFormat": {{ `"Open Files Limit - {{pod}}"` }},
"refId": "B"
},
{
"exemplar": true,
"expr": "mysql_global_status_innodb_num_open_files{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}",
"interval": "",
- "legendFormat": "InnoDB Open Files - {{pod}}",
+ "legendFormat": {{ `"InnoDB Open Files - {{pod}}"` }},
"refId": "C"
}
],
@@ -3110,7 +3111,7 @@
"exemplar": true,
"expr": "rate(mysql_global_status_opened_tables{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}[5m])",
"interval": "",
- "legendFormat": "Openings - {{pod}}",
+ "legendFormat": {{ `"Openings - {{pod}}"` }},
"refId": "A"
},
{
@@ -3118,7 +3119,7 @@
"expr": "rate(mysql_global_status_table_open_cache_hits{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}[5m])",
"hide": false,
"interval": "",
- "legendFormat": "Hits - {{pod}}",
+ "legendFormat": {{ `"Hits - {{pod}}"` }},
"refId": "B"
},
{
@@ -3126,7 +3127,7 @@
"expr": "rate(mysql_global_status_table_open_cache_misses{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}[5m])",
"hide": false,
"interval": "",
- "legendFormat": "Misses - {{pod}}",
+ "legendFormat": {{ `"Misses - {{pod}}"` }},
"refId": "C"
},
{
@@ -3134,7 +3135,7 @@
"expr": "rate(mysql_global_status_table_open_cache_overflows{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}[5m])",
"hide": false,
"interval": "",
- "legendFormat": "Misses due to Overflows - {{pod}}",
+ "legendFormat": {{ `"Misses due to Overflows - {{pod}}"` }},
"refId": "D"
},
{
@@ -3142,7 +3143,7 @@
"expr": "rate(mysql_global_status_table_open_cache_hits{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}[5m])",
"hide": false,
"interval": "",
- "legendFormat": "Table Open Cache Hit Ratio - {{pod}}",
+ "legendFormat": {{ `"Table Open Cache Hit Ratio - {{pod}}"` }},
"refId": "E"
}
],
@@ -3240,14 +3241,14 @@
"exemplar": true,
"expr": "mysql_global_status_open_tables{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}",
"interval": "",
- "legendFormat": "Open Tables - {{pod}}",
+ "legendFormat": {{ `"Open Tables - {{pod}}"` }},
"refId": "A"
},
{
"exemplar": true,
"expr": "mysql_global_variables_table_open_cache{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}",
"interval": "",
- "legendFormat": "Table Open Cache - {{pod}}",
+ "legendFormat": {{ `"Table Open Cache - {{pod}}"` }},
"refId": "B"
}
],
@@ -3345,14 +3346,14 @@
"exemplar": true,
"expr": "mysql_global_status_open_table_definitions{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}",
"interval": "",
- "legendFormat": "Open Table Definitions - {{pod}}",
+ "legendFormat": {{ `"Open Table Definitions - {{pod}}"` }},
"refId": "A"
},
{
"exemplar": true,
"expr": "mysql_global_variables_table_definition_cache{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}",
"interval": "",
- "legendFormat": "Table Definitions Cache Size - {{pod}}",
+ "legendFormat": {{ `"Table Definitions Cache Size - {{pod}}"` }},
"refId": "B"
},
{
@@ -3360,7 +3361,7 @@
"expr": "mysql_global_status_opened_table_definitions{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}",
"hide": false,
"interval": "",
- "legendFormat": "Opened Table Definitions - {{pod}}",
+ "legendFormat": {{ `"Opened Table Definitions - {{pod}}"` }},
"refId": "C"
}
],
@@ -3443,7 +3444,6 @@
"value": "demo"
},
"datasource": "${datasource}",
- "definition": "label_values(kube_namespace_labels,namespace)",
"description": null,
"error": null,
"hide": 0,
@@ -3452,7 +3452,13 @@
"multi": false,
"name": "namespace",
"options": [],
+ {{- if $shared }}
"query": "label_values(kube_namespace_labels,namespace)",
+ "type": "query",
+ {{- else }}
+ "query": {{ $.Values.app.namespace | quote }},
+ "type": "constant",
+ {{- end }}
"refresh": 1,
"regex": "",
"skipUrlSync": false,
@@ -3460,7 +3466,6 @@
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
- "type": "query",
"useTags": false
},
{
@@ -3471,7 +3476,6 @@
"value": "sample-mariadb-stats"
},
"datasource": "${datasource}",
- "definition": "label_values(kubedb_com_mariadb_status_phase{namespace=~\"$namespace\"},app)",
"description": "",
"error": null,
"hide": 0,
@@ -3480,7 +3484,13 @@
"multi": false,
"name": "app",
"options": [],
+ {{- if $shared }}
"query": "label_values(kubedb_com_mariadb_status_phase{namespace=~\"$namespace\"},app)",
+ "type": "query",
+ {{- else }}
+ "query": {{ $.Values.app.name | quote }},
+ "type": "constant",
+ {{- end }}
"refresh": 1,
"regex": "",
"skipUrlSync": false,
@@ -3488,7 +3498,6 @@
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
- "type": "query",
"useTags": false
},
{
@@ -3532,7 +3541,11 @@
},
"timepicker": {},
"timezone": "",
+ {{- if $shared }}
"title": "KubeDB / MariaDB / Pod",
+ {{- else }}
+ "title": {{ printf "KubeDB / MariaDB / Pod / %s / %s" $.Values.app.namespace $.Values.app.name | quote }},
+ {{- end }}
"uid": "FktZiiOnz",
"version": 3
}
\ No newline at end of file
diff --git a/charts/kubedb-grafana-dashboards/dashboards/mariadb/mariadb-summary.json b/charts/kubedb-grafana-dashboards/dashboards/mariadb/mariadb-summary.json
index 8a6cc2201..478c72a43 100644
--- a/charts/kubedb-grafana-dashboards/dashboards/mariadb/mariadb-summary.json
+++ b/charts/kubedb-grafana-dashboards/dashboards/mariadb/mariadb-summary.json
@@ -1,3 +1,4 @@
+{{- $shared := and (eq .Values.app.name "") (eq .Values.app.namespace "") -}}
{
"annotations": {
"list": [
@@ -121,7 +122,7 @@
"format": "table",
"instant": true,
"interval": "",
- "legendFormat": "{{phase}}",
+ "legendFormat": {{ `"{{phase}}"` }},
"refId": "A"
}
],
@@ -204,7 +205,7 @@
"instant": true,
"interval": "",
"intervalFactor": 1,
- "legendFormat": "{{ version }}",
+ "legendFormat": {{ `"{{version}}"` }},
"refId": "A"
}
],
@@ -283,7 +284,7 @@
"format": "time_series",
"instant": true,
"interval": "",
- "legendFormat": "{{requireSSL}}",
+ "legendFormat": {{ `"{{requireSSL}}"` }},
"refId": "A"
}
],
@@ -365,7 +366,7 @@
"format": "table",
"instant": true,
"interval": "",
- "legendFormat": "{{terminationPolicy}}",
+ "legendFormat": {{ `"{{terminationPolicy}}"` }},
"refId": "A"
}
],
@@ -794,7 +795,7 @@
"exemplar": true,
"expr": "sum(node_namespace_pod_container:container_cpu_usage_seconds_total:sum_irate{namespace=\"$namespace\", pod=~\"$app-\\\\d+$\"}) by (pod)",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -1197,7 +1198,7 @@
"exemplar": true,
"expr": "sum(node_namespace_pod_container:container_memory_working_set_bytes{namespace=\"$namespace\", pod=~\"$app-\\\\d+$\",container!=\"\"}) by (pod)",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -1704,7 +1705,7 @@
"exemplar": true,
"expr": "avg(container_blkio_device_usage_total{namespace=\"$namespace\", pod=~\"$app-\\\\d+$\"}) by (pod)",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -1803,7 +1804,7 @@
"instant": false,
"interval": "",
"intervalFactor": 1,
- "legendFormat": "{{pod}}-disk-write",
+ "legendFormat": {{ `"{{pod}}-disk-write"` }},
"refId": "A"
},
{
@@ -1812,7 +1813,7 @@
"hide": false,
"instant": false,
"interval": "",
- "legendFormat": "{{pod}}-disk-read",
+ "legendFormat": {{ `"{{pod}}-disk-read"` }},
"refId": "B"
}
],
@@ -1911,7 +1912,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"legendLink": null,
"refId": "A",
"step": 10
@@ -2012,7 +2013,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"legendLink": null,
"refId": "A",
"step": 10
@@ -2521,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"
}
],
@@ -2605,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"
}
],
@@ -2678,7 +2679,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"legendLink": null,
"refId": "A",
"step": 10
@@ -2779,7 +2780,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"legendLink": null,
"refId": "A",
"step": 10
@@ -2867,7 +2868,6 @@
"value": "demo"
},
"datasource": "${datasource}",
- "definition": "label_values(kube_namespace_labels,namespace)",
"description": null,
"error": null,
"hide": 0,
@@ -2876,10 +2876,16 @@
"multi": false,
"name": "namespace",
"options": [],
+ {{- if $shared }}
"query": {
"query": "label_values(kube_namespace_labels,namespace)",
"refId": "Prometheus-namespace-Variable-Query"
},
+ "type": "query",
+ {{- else }}
+ "query": {{ $.Values.app.namespace | quote }},
+ "type": "constant",
+ {{- end }}
"refresh": 1,
"regex": "",
"skipUrlSync": false,
@@ -2887,7 +2893,6 @@
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
- "type": "query",
"useTags": false
},
{
@@ -2898,7 +2903,6 @@
"value": "mariadb-galera"
},
"datasource": "${datasource}",
- "definition": "label_values(kubedb_com_mariadb_status_phase{namespace=~\"$namespace\"},app)",
"description": null,
"error": null,
"hide": 0,
@@ -2907,10 +2911,16 @@
"multi": false,
"name": "app",
"options": [],
+ {{- if $shared }}
"query": {
"query": "label_values(kubedb_com_mariadb_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,
@@ -2918,7 +2928,6 @@
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
- "type": "query",
"useTags": false
}
]
@@ -2953,7 +2962,11 @@
]
},
"timezone": "",
+ {{- if $shared }}
"title": "KubeDB / MariaDB / Summary",
+ {{- else }}
+ "title": {{ printf "KubeDB / MariaDB / Summary / %s / %s" $.Values.app.namespace $.Values.app.name | quote }},
+ {{- end }}
"uid": "VnOgk2Hnk",
"version": 11
}
\ No newline at end of file
diff --git a/charts/kubedb-grafana-dashboards/dashboards/mongodb/mongodb-database-replset-dashboard.json b/charts/kubedb-grafana-dashboards/dashboards/mongodb/mongodb-database-replset-dashboard.json
index cf315e4ce..382c7c604 100644
--- a/charts/kubedb-grafana-dashboards/dashboards/mongodb/mongodb-database-replset-dashboard.json
+++ b/charts/kubedb-grafana-dashboards/dashboards/mongodb/mongodb-database-replset-dashboard.json
@@ -1,3 +1,4 @@
+{{- $shared := and (eq .Values.app.name "") (eq .Values.app.namespace "") -}}
{
"annotations": {
"list": [
@@ -516,7 +517,7 @@
"expr": "rate(mongodb_ss_opcountersRepl{pod=~\"$pod\", legacy_op_type!~\"(command|getmore|query)\"}[$interval]) or irate(mongodb_ss_opcountersRepl{pod=~\"$pod\", legacy_op_type!~\"(command|getmore|query)\"}[5m])",
"interval": "$interval",
"intervalFactor": 1,
- "legendFormat": "{{legacy_op_type}}",
+ "legendFormat": {{ `"{{legacy_op_type}}"` }},
"range": true,
"refId": "A",
"step": 300
@@ -755,7 +756,7 @@
"expr": "rate(mongodb_mongod_metrics_repl_network_getmores_total_milliseconds{pod=~\"$pod\"}[$interval]) or irate(mongodb_mongod_metrics_repl_network_getmores_total_milliseconds{pod=~\"$pod\"}[5m]) or rate(mongodb_ss_metrics_repl_network_getmores_totalMillis{pod=~\"$pod\"}[$interval]) or irate(mongodb_ss_metrics_repl_network_getmores_totalMillis{pod=~\"$pod\"}[5m])",
"interval": "$interval",
"intervalFactor": 1,
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"range": true,
"refId": "A",
"step": 300
@@ -1256,7 +1257,6 @@
"value": "demo"
},
"datasource": "${datasource}",
- "definition": "label_values(kube_namespace_labels,namespace)",
"description": null,
"error": null,
"hide": 0,
@@ -1265,10 +1265,16 @@
"multi": false,
"name": "namespace",
"options": [],
+ {{- if $shared }}
"query": {
"query": "label_values(kube_namespace_labels,namespace)",
"refId": "Prometheus-namespace-Variable-Query"
},
+ "type": "query",
+ {{- else }}
+ "query": {{ $.Values.app.namespace | quote }},
+ "type": "constant",
+ {{- end }}
"refresh": 1,
"regex": "",
"skipUrlSync": false,
@@ -1276,7 +1282,6 @@
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
- "type": "query",
"useTags": false
},
{
@@ -1288,7 +1293,6 @@
"value": "shard1"
},
"datasource": "${datasource}",
- "definition": "",
"description": null,
"error": null,
"hide": 0,
@@ -1298,17 +1302,22 @@
"multiFormat": "glob",
"name": "app",
"options": [],
+ {{- if $shared }}
"query": {
"query": "label_values(mongodb_members_state{namespace=~\"$namespace\"}, rs_nm)",
"refId": "Prometheus-app-Variable-Query"
},
+ "type": "query",
+ {{- else }}
+ "query": {{ $.Values.app.name | quote }},
+ "type": "constant",
+ {{- end }}
"refresh": 2,
"regex": "",
"skipUrlSync": false,
"sort": 1,
"tagValuesQuery": null,
"tagsQuery": null,
- "type": "query",
"useTags": false
},
{
@@ -1377,6 +1386,10 @@
]
},
"timezone": "browser",
+ {{- if $shared }}
"title": "KubeDB / MongoDB / Database / ReplicaSet",
+ {{- else }}
+ "title": {{ printf "KubeDB / MongoDB / Database / ReplicaSet / %s / %s" $.Values.app.namespace $.Values.app.name | quote }},
+ {{- end }}
"version": 2
}
diff --git a/charts/kubedb-grafana-dashboards/dashboards/mongodb/mongodb-pod-dashboard.json b/charts/kubedb-grafana-dashboards/dashboards/mongodb/mongodb-pod-dashboard.json
index 94f011c63..16fb18372 100644
--- a/charts/kubedb-grafana-dashboards/dashboards/mongodb/mongodb-pod-dashboard.json
+++ b/charts/kubedb-grafana-dashboards/dashboards/mongodb/mongodb-pod-dashboard.json
@@ -1,3 +1,4 @@
+{{- $shared := and (eq .Values.app.name "") (eq .Values.app.namespace "") -}}
{
"annotations": {
"list": [
@@ -351,7 +352,7 @@
"hide": false,
"interval": "$interval",
"intervalFactor": 1,
- "legendFormat": "{{legacy_op_type}}",
+ "legendFormat": {{ `"{{legacy_op_type}}"` }},
"refId": "J",
"step": 300
},
@@ -361,7 +362,7 @@
"hide": false,
"interval": "$interval",
"intervalFactor": 1,
- "legendFormat": "repl_{{legacy_op_type}}",
+ "legendFormat": {{ `"repl_{{legacy_op_type}}"` }},
"refId": "A",
"step": 300
},
@@ -480,7 +481,7 @@
"exemplar": false,
"expr": "avg by (service,op_type) (rate(mongodb_ss_opLatencies_latency{service=~\"${app}-stats\"}[$interval]) / (rate(mongodb_ss_opLatencies_ops{service=~\"${app}-stats\"}[$interval]) > 0) or irate(mongodb_ss_opLatencies_latency{service=~\"${app}-stats\"}[5m]) / (irate(mongodb_ss_opLatencies_ops{service=~\"${app}-stats\"}[5m]) > 0))",
"interval": "$interval",
- "legendFormat": "{{op_type}}",
+ "legendFormat": {{ `"{{op_type}}"` }},
"range": true,
"refId": "A"
}
@@ -711,7 +712,7 @@
"hide": false,
"interval": "$interval",
"intervalFactor": 1,
- "legendFormat": "{{csr_type}}",
+ "legendFormat": {{ `"{{csr_type}}"` }},
"range": true,
"refId": "J",
"step": 300
@@ -829,7 +830,7 @@
"hide": false,
"interval": "$interval",
"intervalFactor": 1,
- "legendFormat": "{{doc_op_type}}",
+ "legendFormat": {{ `"{{doc_op_type}}"` }},
"range": true,
"refId": "J",
"step": 300
@@ -948,7 +949,7 @@
"hide": false,
"interval": "$interval",
"intervalFactor": 1,
- "legendFormat": "{{count_type}}",
+ "legendFormat": {{ `"{{count_type}}"` }},
"range": true,
"refId": "J",
"step": 300
@@ -1539,7 +1540,7 @@
"hide": false,
"interval": "$interval",
"intervalFactor": 1,
- "legendFormat": "{{assert_type}}",
+ "legendFormat": {{ `"{{assert_type}}"` }},
"range": true,
"refId": "J",
"step": 300
@@ -1817,7 +1818,6 @@
"value": "demo"
},
"datasource": "${datasource}",
- "definition": "label_values(kube_namespace_labels,namespace)",
"description": null,
"error": null,
"hide": 0,
@@ -1826,10 +1826,16 @@
"multi": false,
"name": "namespace",
"options": [],
+ {{- if $shared }}
"query": {
"query": "label_values(kube_namespace_labels,namespace)",
"refId": "Prometheus-namespace-Variable-Query"
},
+ "type": "query",
+ {{- else }}
+ "query": {{ $.Values.app.namespace | quote }},
+ "type": "constant",
+ {{- end }}
"refresh": 1,
"regex": "",
"skipUrlSync": false,
@@ -1837,7 +1843,6 @@
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
- "type": "query",
"useTags": false
},
{
@@ -1848,7 +1853,6 @@
"value": "mg-rs"
},
"datasource": "${datasource}",
- "definition": "label_values(kubedb_com_mongodb_status_phase{namespace=~\"$namespace\"},app)",
"description": null,
"error": null,
"hide": 0,
@@ -1857,17 +1861,22 @@
"multi": false,
"name": "app",
"options": [],
+ {{- if $shared }}
"query": {
"query": "label_values(kubedb_com_mongodb_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": "",
"tagsQuery": "",
- "type": "query",
"useTags": false
},
{
@@ -1936,6 +1945,10 @@
]
},
"timezone": "browser",
+ {{- if $shared }}
"title": "KubeDB / MongoDB / Pod",
+ {{- else }}
+ "title": {{ printf "KubeDB / MongoDB / Pod / %s / %s" $.Values.app.namespace $.Values.app.name | quote }},
+ {{- end }}
"version": 12
}
diff --git a/charts/kubedb-grafana-dashboards/dashboards/mongodb/mongodb-summary-dashboard.json b/charts/kubedb-grafana-dashboards/dashboards/mongodb/mongodb-summary-dashboard.json
index 7f5e1673c..f2071748f 100644
--- a/charts/kubedb-grafana-dashboards/dashboards/mongodb/mongodb-summary-dashboard.json
+++ b/charts/kubedb-grafana-dashboards/dashboards/mongodb/mongodb-summary-dashboard.json
@@ -1,3 +1,4 @@
+{{- $shared := and (eq .Values.app.name "") (eq .Values.app.namespace "") -}}
{
"annotations": {
"list": [
@@ -121,7 +122,7 @@
"format": "table",
"instant": true,
"interval": "",
- "legendFormat": "{{phase}}",
+ "legendFormat": {{ `"{{phase}}"` }},
"refId": "A"
}
],
@@ -454,7 +455,7 @@
"instant": true,
"interval": "",
"intervalFactor": 1,
- "legendFormat": "{{version}}",
+ "legendFormat": {{ `"{{version}}"` }},
"refId": "A"
}
],
@@ -715,7 +716,7 @@
"format": "table",
"instant": true,
"interval": "",
- "legendFormat": "{{terminationPolicy}}",
+ "legendFormat": {{ `"{{terminationPolicy}}"` }},
"refId": "A"
}
],
@@ -792,7 +793,7 @@
"exemplar": false,
"expr": "sum(node_namespace_pod_container:container_cpu_usage_seconds_total:sum_irate{namespace=\"$namespace\", pod=~\"$app-\\\\d+$|$app-shard\\\\d+-\\\\d+$\"}) by (pod)",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -1204,7 +1205,7 @@
"exemplar": false,
"expr": "sum(node_namespace_pod_container:container_memory_working_set_bytes{namespace=\"$namespace\", pod=~\"$app-\\\\d+$|$app-shard\\\\d+-\\\\d+$\",container!=\"\"}) by (pod)",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -1719,7 +1720,7 @@
"exemplar": false,
"expr": "avg(container_blkio_device_usage_total{namespace=\"$namespace\", pod=~\"$app-\\\\d+$|$app-shard\\\\d+-\\\\d+$\"}) by (pod)",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -1826,7 +1827,7 @@
"instant": false,
"interval": "",
"intervalFactor": 1,
- "legendFormat": "{{pod}}-disk-write",
+ "legendFormat": {{ `"{{pod}}-disk-write"` }},
"refId": "A"
},
{
@@ -1835,7 +1836,7 @@
"hide": false,
"instant": false,
"interval": "",
- "legendFormat": "{{pod}}-disk-read",
+ "legendFormat": {{ `"{{pod}}-disk-read"` }},
"refId": "B"
}
],
@@ -1942,7 +1943,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"legendLink": null,
"refId": "A",
"step": 10
@@ -2051,7 +2052,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"legendLink": null,
"refId": "A",
"step": 10
@@ -2560,7 +2561,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"
}
],
@@ -2644,7 +2645,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"
}
],
@@ -2727,7 +2728,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"legendLink": null,
"refId": "A",
"step": 10
@@ -2836,7 +2837,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"legendLink": null,
"refId": "A",
"step": 10
@@ -2924,7 +2925,6 @@
"value": "demo"
},
"datasource": "${datasource}",
- "definition": "label_values(kube_namespace_labels,namespace)",
"description": null,
"error": null,
"hide": 0,
@@ -2933,10 +2933,16 @@
"multi": false,
"name": "namespace",
"options": [],
+ {{- if $shared }}
"query": {
"query": "label_values(kube_namespace_labels,namespace)",
"refId": "Prometheus-namespace-Variable-Query"
},
+ "type": "query",
+ {{- else }}
+ "query": {{ $.Values.app.namespace | quote }},
+ "type": "constant",
+ {{- end }}
"refresh": 1,
"regex": "",
"skipUrlSync": false,
@@ -2944,7 +2950,6 @@
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
- "type": "query",
"useTags": false
},
{
@@ -2955,7 +2960,6 @@
"value": "mg4"
},
"datasource": "${datasource}",
- "definition": "label_values(kubedb_com_mongodb_status_phase{namespace=~\"$namespace\"},app)",
"description": null,
"error": null,
"hide": 0,
@@ -2964,10 +2968,16 @@
"multi": false,
"name": "app",
"options": [],
+ {{- if $shared }}
"query": {
"query": "label_values(kubedb_com_mongodb_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,
@@ -2975,7 +2985,6 @@
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
- "type": "query",
"useTags": false
}
]
@@ -3010,7 +3019,11 @@
]
},
"timezone": "",
+ {{- if $shared }}
"title": "KubeDB / MongoDB / Summary",
+ {{- else }}
+ "title": {{ printf "KubeDB / MongoDB / Summary / %s / %s" $.Values.app.namespace $.Values.app.name | quote }},
+ {{- end }}
"uid": "92M7QvyVk",
"version": 1
}
\ No newline at end of file
diff --git a/charts/kubedb-grafana-dashboards/dashboards/mysql/mysql_database_dashboard.json b/charts/kubedb-grafana-dashboards/dashboards/mysql/mysql_database_dashboard.json
index b3045ccc5..0be9170e8 100644
--- a/charts/kubedb-grafana-dashboards/dashboards/mysql/mysql_database_dashboard.json
+++ b/charts/kubedb-grafana-dashboards/dashboards/mysql/mysql_database_dashboard.json
@@ -1,3 +1,4 @@
+{{- $shared := and (eq .Values.app.name "") (eq .Values.app.namespace "") -}}
{
"annotations": {
"list": [
@@ -138,7 +139,7 @@
"instant": true,
"interval": "",
"intervalFactor": 1,
- "legendFormat": "{{ pod }}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -242,7 +243,7 @@
"format": "table",
"instant": true,
"interval": "",
- "legendFormat": "{{ pod }}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -316,7 +317,7 @@
"exemplar": true,
"expr": "rate(mysql_global_status_queries{namespace=~\"$namespace\",service=~\"$app+-stats\"}[5m])",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -418,7 +419,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 1,
- "legendFormat": "Current - {{ pod }}",
+ "legendFormat": {{ `"Current - {{ pod }}"` }},
"refId": "A"
},
{
@@ -427,7 +428,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 1,
- "legendFormat": "Max - {{ pod }}",
+ "legendFormat": {{ `"Max - {{ pod }}"` }},
"refId": "B"
}
],
@@ -533,7 +534,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 1,
- "legendFormat": "reads - {{ pod }}",
+ "legendFormat": {{ `"reads - {{ pod }}"` }},
"refId": "A"
},
{
@@ -542,7 +543,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 1,
- "legendFormat": "write - {{ pod }}",
+ "legendFormat": {{ `"write - {{ pod }}"` }},
"refId": "B"
}
],
@@ -648,7 +649,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 1,
- "legendFormat": "received - {{ pod }}",
+ "legendFormat": {{ `"received - {{ pod }}"` }},
"refId": "A"
},
{
@@ -657,7 +658,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 1,
- "legendFormat": "sent - {{ pod }}",
+ "legendFormat": {{ `"sent - {{ pod }}"` }},
"refId": "B"
}
],
@@ -758,7 +759,7 @@
"expr": "topk(3, rate(mysql_global_status_commands_total{namespace=~\"$namespace\",service=~\"$app+-stats\"}[5m]))",
"instant": false,
"interval": "",
- "legendFormat": "{{ pod }} = '{{ command }}'",
+ "legendFormat": {{ `"{{ pod }} = '{{ command }}'"` }},
"refId": "A"
}
],
@@ -856,7 +857,7 @@
"exemplar": true,
"expr": "rate(mysql_global_status_opened_files{namespace=~\"$namespace\",service=~\"$app+-stats\"}[1m])",
"interval": "",
- "legendFormat": "{{ pod }}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -954,21 +955,21 @@
"exemplar": true,
"expr": "mysql_global_status_open_files{namespace=~\"$namespace\",service=~\"$app+-stats\"}",
"interval": "",
- "legendFormat": "Open Files - {{ pod }}",
+ "legendFormat": {{ `"Open Files - {{ pod }}"` }},
"refId": "A"
},
{
"exemplar": true,
"expr": "mysql_global_variables_open_files_limit{namespace=~\"$namespace\",service=~\"$app+-stats\"}",
"interval": "",
- "legendFormat": "Open Files Limit - {{ pod }}",
+ "legendFormat": {{ `"Open Files Limit - {{ pod }}"` }},
"refId": "B"
},
{
"exemplar": true,
"expr": "mysql_global_status_innodb_num_open_files{namespace=~\"$namespace\",service=~\"$app+-stats\"}",
"interval": "",
- "legendFormat": "InnoDB Open Files - {{ pod }}",
+ "legendFormat": {{ `"InnoDB Open Files - {{ pod }}"` }},
"refId": "C"
}
],
@@ -1067,7 +1068,7 @@
"exemplar": true,
"expr": "rate(mysql_global_status_slow_queries{namespace=~\"$namespace\",service=~\"$app+-stats\"}[1m])",
"interval": "",
- "legendFormat": "Slow Queries on {{ pod }}",
+ "legendFormat": {{ `"Slow Queries on {{ pod }}"` }},
"refId": "A"
}
],
@@ -1164,14 +1165,14 @@
"exemplar": true,
"expr": "rate(mysql_global_status_aborted_connects{namespace=~\"$namespace\",service=~\"$app+-stats\"}[5m])",
"interval": "",
- "legendFormat": "Aborted Connects (attempts) on - {{ pod }}",
+ "legendFormat": {{ `"Aborted Connects (attempts) on - {{ pod }}"` }},
"refId": "A"
},
{
"exemplar": true,
"expr": "rate(mysql_global_status_aborted_clients{namespace=~\"$namespace\",service=~\"$app+-stats\"}[5m])",
"interval": "",
- "legendFormat": "Aborted Clients (timeout) on - {{ pod }}",
+ "legendFormat": {{ `"Aborted Clients (timeout) on - {{ pod }}"` }},
"refId": "B"
}
],
@@ -1257,7 +1258,6 @@
"value": "demo"
},
"datasource": "${datasource}",
- "definition": "label_values(kube_namespace_labels,namespace)",
"description": null,
"error": null,
"hide": 0,
@@ -1266,7 +1266,13 @@
"multi": false,
"name": "namespace",
"options": [],
+ {{- if $shared }}
"query": "label_values(kube_namespace_labels,namespace)",
+ "type": "query",
+ {{- else }}
+ "query": {{ $.Values.app.namespace | quote }},
+ "type": "constant",
+ {{- end }}
"refresh": 1,
"regex": "",
"skipUrlSync": false,
@@ -1274,7 +1280,6 @@
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
- "type": "query",
"useTags": false
},
{
@@ -1285,7 +1290,6 @@
"value": "sample-mysql-stats"
},
"datasource": "${datasource}",
- "definition": "label_values(kubedb_com_mysql_status_phase{namespace=~\"$namespace\"},app)",
"description": "",
"error": null,
"hide": 0,
@@ -1294,7 +1298,13 @@
"multi": false,
"name": "app",
"options": [],
+ {{- if $shared }}
"query": "label_values(kubedb_com_mysql_status_phase{namespace=~\"$namespace\"},app)",
+ "type": "query",
+ {{- else }}
+ "query": {{ $.Values.app.name | quote }},
+ "type": "constant",
+ {{- end }}
"refresh": 1,
"regex": "",
"skipUrlSync": false,
@@ -1302,7 +1312,6 @@
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
- "type": "query",
"useTags": false
}
]
@@ -1313,7 +1322,11 @@
},
"timepicker": {},
"timezone": "",
+ {{- if $shared }}
"title": "KubeDB / MySQL / Database",
+ {{- else }}
+ "title": {{ printf "KubeDB / MySQL / Database / %s / %s" $.Values.app.namespace $.Values.app.name | quote }},
+ {{- end }}
"uid": "ohrahgv7T",
"version": 2
}
\ No newline at end of file
diff --git a/charts/kubedb-grafana-dashboards/dashboards/mysql/mysql_group_replication.json b/charts/kubedb-grafana-dashboards/dashboards/mysql/mysql_group_replication.json
index e31055b0f..349a737e9 100644
--- a/charts/kubedb-grafana-dashboards/dashboards/mysql/mysql_group_replication.json
+++ b/charts/kubedb-grafana-dashboards/dashboards/mysql/mysql_group_replication.json
@@ -1,3 +1,4 @@
+{{- $shared := and (eq .Values.app.name "") (eq .Values.app.namespace "") -}}
{
"annotations": {
"list": [
@@ -112,7 +113,7 @@
"exemplar": true,
"expr": "avg by(member_host)(mysql_perf_schema_replication_group_member_info{namespace=~\"$namespace\",service=~\"$app+-stats\"})",
"interval": "",
- "legendFormat": "{{member_host}}",
+ "legendFormat": {{ `"{{member_host}}"` }},
"refId": "A"
}
],
@@ -180,7 +181,7 @@
"exemplar": true,
"expr": "avg by(member_host)(mysql_perf_schema_replication_group_member_info{namespace=~\"$namespace\",service=~\"$app+-stats\", member_role=\"PRIMARY\"})",
"interval": "",
- "legendFormat": "{{member_host}}",
+ "legendFormat": {{ `"{{member_host}}"` }},
"refId": "A"
}
],
@@ -256,7 +257,7 @@
"exemplar": true,
"expr": "max by (pod)(max_over_time(mysql_perf_schema_replication_group_worker_lag_in_seconds{namespace=~\"$namespace\",service=~\"$app+-stats\"}[5m]))",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -356,7 +357,7 @@
"exemplar": true,
"expr": "max by (pod)(max_over_time(mysql_perf_schema_replication_group_worker_transport_time_seconds{namespace=~\"$namespace\",service=~\"$app+-stats\"}[5m])) < 20000000",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -456,7 +457,7 @@
"exemplar": true,
"expr": "max by (pod)(max_over_time(mysql_perf_schema_replication_group_worker_apply_time_seconds{namespace=~\"$namespace\",service=~\"$app+-stats\"}[5m])) < 20000000",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -556,7 +557,7 @@
"exemplar": true,
"expr": "max by (pod)(max_over_time(mysql_perf_schema_replication_group_worker_apply_time_seconds{namespace=~\"$namespace\",service=~\"$app+-stats\"}[5m])) < 20000000",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -656,7 +657,7 @@
"exemplar": true,
"expr": "max by (pod)(max_over_time(mysql_perf_schema_replication_group_worker_time_RL_seconds{namespace=~\"$namespace\",service=~\"$app+-stats\"}[5m])) < 20000000",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -770,7 +771,7 @@
"exemplar": true,
"expr": "avg by (pod)(rate(mysql_perf_schema_transactions_checked_total{namespace=~\"$namespace\",service=~\"$app+-stats\"}[5m]) or rate(mysql_perf_schema_5_transactions_checked_total{namespace=~\"$namespace\",service=~\"$app+-stats\"}[5m])) ",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -870,7 +871,7 @@
"exemplar": true,
"expr": "avg by (pod)(rate(mysql_perf_schema_transactions_rows_validating_total{namespace=~\"$namespace\",service=~\"$app+-stats\"}[5m]) or rate(mysql_perf_schema_5_transactions_rows_validating_total{namespace=~\"$namespace\",service=~\"$app+-stats\"}[5m])) ",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -970,7 +971,7 @@
"exemplar": true,
"expr": "avg by (pod)(rate(mysql_perf_schema_transactions_remote_applied_total{namespace=~\"$namespace\",service=~\"$app+-stats\"}[5m])) ",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -1070,7 +1071,7 @@
"exemplar": true,
"expr": "avg by (pod)(rate(mysql_perf_schema_transactions_local_proposed_total{namespace=~\"$namespace\",service=~\"$app+-stats\"}[5m])) ",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -1170,7 +1171,7 @@
"exemplar": true,
"expr": "avg by (pod)(rate(mysql_perf_schema_transactions_remote_in_applier_queue{namespace=~\"$namespace\",service=~\"$app+-stats\"}[5m])) ",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -1270,7 +1271,7 @@
"exemplar": true,
"expr": "avg by (pod)(rate(mysql_perf_schema_transactions_local_rollback_total{namespace=~\"$namespace\",service=~\"$app+-stats\"}[5m])) ",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -1370,7 +1371,7 @@
"exemplar": true,
"expr": "avg by (pod)(rate(mysql_perf_schema_transactions_in_queue{namespace=~\"$namespace\",service=~\"$app+-stats\"}[5m]) or rate(mysql_perf_schema_5_transactions_in_queue{namespace=~\"$namespace\",service=~\"$app+-stats\"}[5m])) ",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -1484,7 +1485,7 @@
"exemplar": true,
"expr": "avg by (pod)(rate(mysql_perf_schema_conflicts_detected_total{namespace=~\"$namespace\",service=~\"$app+-stats\"}[5m]) or rate(mysql_perf_schema_5_conflicts_detected_total{namespace=~\"$namespace\",service=~\"$app+-stats\"}[5m])) ",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -1567,7 +1568,6 @@
"value": "demo"
},
"datasource": "${datasource}",
- "definition": "label_values(kube_namespace_labels,namespace)",
"description": null,
"error": null,
"hide": 0,
@@ -1576,7 +1576,13 @@
"multi": false,
"name": "namespace",
"options": [],
+ {{- if $shared }}
"query": "label_values(kube_namespace_labels,namespace)",
+ "type": "query",
+ {{- else }}
+ "query": {{ $.Values.app.namespace | quote }},
+ "type": "constant",
+ {{- end }}
"refresh": 1,
"regex": "",
"skipUrlSync": false,
@@ -1584,7 +1590,6 @@
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
- "type": "query",
"useTags": false
},
{
@@ -1595,7 +1600,6 @@
"value": "old-mysql-stats"
},
"datasource": "${datasource}",
- "definition": "label_values(kubedb_com_mysql_status_phase{namespace=~\"$namespace\"},app)",
"description": "",
"error": null,
"hide": 0,
@@ -1604,7 +1608,13 @@
"multi": false,
"name": "app",
"options": [],
+ {{- if $shared }}
"query": "label_values(kubedb_com_mysql_status_phase{namespace=~\"$namespace\"},app)",
+ "type": "query",
+ {{- else }}
+ "query": {{ $.Values.app.name | quote }},
+ "type": "constant",
+ {{- end }}
"refresh": 1,
"regex": "",
"skipUrlSync": false,
@@ -1612,7 +1622,6 @@
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
- "type": "query",
"useTags": false
}
]
@@ -1623,7 +1632,11 @@
},
"timepicker": {},
"timezone": "",
+ {{- if $shared }}
"title": "KubeDB / MySQL / Group-Replication-Summary",
+ {{- else }}
+ "title": {{ printf "KubeDB / MySQL / Group-Replication-Summary / %s / %s" $.Values.app.namespace $.Values.app.name | quote }},
+ {{- end }}
"uid": "Zmva7c57k",
"version": 2
}
\ No newline at end of file
diff --git a/charts/kubedb-grafana-dashboards/dashboards/mysql/mysql_pod_dashboard.json b/charts/kubedb-grafana-dashboards/dashboards/mysql/mysql_pod_dashboard.json
index 5562b4362..413b69784 100644
--- a/charts/kubedb-grafana-dashboards/dashboards/mysql/mysql_pod_dashboard.json
+++ b/charts/kubedb-grafana-dashboards/dashboards/mysql/mysql_pod_dashboard.json
@@ -1,3 +1,4 @@
+{{- $shared := and (eq .Values.app.name "") (eq .Values.app.namespace "") -}}
{
"annotations": {
"list": [
@@ -82,7 +83,7 @@
"exemplar": true,
"expr": "mysql_up{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}",
"interval": "",
- "legendFormat": "{{pod}} ",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -157,7 +158,7 @@
"format": "time_series",
"instant": false,
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -217,7 +218,7 @@
"exemplar": true,
"expr": "mysql_version_info{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}",
"interval": "",
- "legendFormat": "{{version}}",
+ "legendFormat": {{ `"{{version}}"` }},
"refId": "A"
}
],
@@ -273,7 +274,7 @@
"exemplar": true,
"expr": "rate(mysql_global_status_queries{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}[5m])",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -350,7 +351,7 @@
"format": "time_series",
"instant": false,
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -423,7 +424,7 @@
"exemplar": true,
"expr": "sum(rate(container_cpu_usage_seconds_total{namespace=\"$namespace\", pod=~\"$pod\", container!=\"\", image!=\"\"}[5m])) by (pod)",
"interval": "",
- "legendFormat": "{{container}}",
+ "legendFormat": {{ `"{{container}}"` }},
"refId": "A"
}
],
@@ -520,7 +521,7 @@
"exemplar": true,
"expr": "sum(container_memory_working_set_bytes{namespace=\"$namespace\", pod=~\"$pod\", container!=\"\", image!=\"\"}) by (pod)",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -618,7 +619,7 @@
"exemplar": true,
"expr": "sum(process_open_fds{pod=~\"$pod\", namespace=\"$namespace\"}) by (pod)",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -728,7 +729,7 @@
"exemplar": true,
"expr": "mysql_global_status_max_used_connections{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}",
"interval": "",
- "legendFormat": "Max Used Connects - {{pod}}",
+ "legendFormat": {{ `"Max Used Connects - {{pod}}"` }},
"refId": "A"
},
{
@@ -736,7 +737,7 @@
"expr": "mysql_global_variables_max_connections{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}",
"hide": false,
"interval": "",
- "legendFormat": "Max Connects - {{pod}}",
+ "legendFormat": {{ `"Max Connects - {{pod}}"` }},
"refId": "B"
}
],
@@ -833,7 +834,7 @@
"exemplar": true,
"expr": "mysql_global_status_aborted_connects{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}",
"interval": "",
- "legendFormat": "Aborted Connects - {{pod}}",
+ "legendFormat": {{ `"Aborted Connects - {{pod}}"` }},
"refId": "A"
},
{
@@ -841,7 +842,7 @@
"expr": "mysql_global_status_aborted_clients{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}",
"hide": false,
"interval": "",
- "legendFormat": "Aborted Clients - {{pod}}",
+ "legendFormat": {{ `"Aborted Clients - {{pod}}"` }},
"refId": "B"
}
],
@@ -954,7 +955,7 @@
"exemplar": true,
"expr": "mysql_global_status_threads_connected{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}",
"interval": "",
- "legendFormat": "Threads Connected - {{pod}}",
+ "legendFormat": {{ `"Threads Connected - {{pod}}"` }},
"refId": "A"
},
{
@@ -962,7 +963,7 @@
"expr": "mysql_global_status_threads_running{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}",
"hide": false,
"interval": "",
- "legendFormat": "Threads Running - {{pod}}",
+ "legendFormat": {{ `"Threads Running - {{pod}}"` }},
"refId": "B"
}
],
@@ -1060,7 +1061,7 @@
"exemplar": true,
"expr": "mysql_global_variables_thread_cache_size{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}",
"interval": "",
- "legendFormat": "Thread Cache Size - {{pod}}",
+ "legendFormat": {{ `"Thread Cache Size - {{pod}}"` }},
"refId": "A"
},
{
@@ -1068,7 +1069,7 @@
"expr": "mysql_global_status_threads_cached{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}",
"hide": false,
"interval": "",
- "legendFormat": "Threads Cached - {{pod}} ",
+ "legendFormat": {{ `"Threads Cached - {{pod}}"` }},
"refId": "B"
},
{
@@ -1076,7 +1077,7 @@
"expr": "mysql_global_status_threads_created{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}",
"hide": false,
"interval": "",
- "legendFormat": "Threads Created - {{pod}}",
+ "legendFormat": {{ `"Threads Created - {{pod}}"` }},
"refId": "C"
}
],
@@ -1188,7 +1189,7 @@
"exemplar": true,
"expr": "rate(mysql_global_status_created_tmp_tables{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}[5m])",
"interval": "",
- "legendFormat": "Created Tmp Tables - {{pod}}",
+ "legendFormat": {{ `"Created Tmp Tables - {{pod}}"` }},
"refId": "A"
},
{
@@ -1196,7 +1197,7 @@
"expr": "rate(mysql_global_status_created_tmp_disk_tables{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}[5m])",
"hide": false,
"interval": "",
- "legendFormat": "Created Tmp Disk Tables - {{pod}}",
+ "legendFormat": {{ `"Created Tmp Disk Tables - {{pod}}"` }},
"refId": "B"
},
{
@@ -1204,7 +1205,7 @@
"expr": "mysql_global_status_created_tmp_files{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}",
"hide": false,
"interval": "",
- "legendFormat": "Created Tmp Files - {{pod}}",
+ "legendFormat": {{ `"Created Tmp Files - {{pod}}"` }},
"refId": "C"
}
],
@@ -1302,7 +1303,7 @@
"exemplar": true,
"expr": "mysql_global_status_slow_queries{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}",
"interval": "",
- "legendFormat": "Slow Queries - {{pod}}",
+ "legendFormat": {{ `"Slow Queries - {{pod}}"` }},
"refId": "A"
}
],
@@ -1416,7 +1417,7 @@
"exemplar": true,
"expr": "rate(mysql_global_status_select_full_join{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}[5m])",
"interval": "",
- "legendFormat": "Select Full Join - {{pod}}",
+ "legendFormat": {{ `"Select Full Join - {{pod}}"` }},
"refId": "A"
},
{
@@ -1424,7 +1425,7 @@
"expr": "rate(mysql_global_status_select_scan{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}[5m])",
"hide": false,
"interval": "",
- "legendFormat": "Select Scan - {{pod}}",
+ "legendFormat": {{ `"Select Scan - {{pod}}"` }},
"refId": "E"
}
],
@@ -1522,7 +1523,7 @@
"exemplar": true,
"expr": "rate(mysql_global_status_sort_rows{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}[5m])",
"interval": "",
- "legendFormat": "Sort Rows - {{pod}}",
+ "legendFormat": {{ `"Sort Rows - {{pod}}"` }},
"refId": "A"
},
{
@@ -1530,7 +1531,7 @@
"expr": "rate(mysql_global_status_sort_range{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}[5m])",
"hide": false,
"interval": "",
- "legendFormat": "Sort Range - {{pod}}",
+ "legendFormat": {{ `"Sort Range - {{pod}}"` }},
"refId": "B"
},
{
@@ -1538,7 +1539,7 @@
"expr": "rate(mysql_global_status_sort_merge_passes{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}[5m])",
"hide": false,
"interval": "",
- "legendFormat": "Sort Merge Passes - {{pod}}",
+ "legendFormat": {{ `"Sort Merge Passes - {{pod}}"` }},
"refId": "C"
},
{
@@ -1546,7 +1547,7 @@
"expr": "rate(mysql_global_status_sort_scan{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}[5m])",
"hide": false,
"interval": "",
- "legendFormat": "Sort Scan - {{pod}}",
+ "legendFormat": {{ `"Sort Scan - {{pod}}"` }},
"refId": "D"
}
],
@@ -1657,7 +1658,7 @@
"exemplar": true,
"expr": "rate(mysql_global_status_table_locks_immediate{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}[5m])",
"interval": "",
- "legendFormat": "Table Locks Immediate - {{pod}}",
+ "legendFormat": {{ `"Table Locks Immediate - {{pod}}"` }},
"refId": "A"
},
{
@@ -1665,7 +1666,7 @@
"expr": "rate(mysql_global_status_table_locks_waited{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}[5m])",
"hide": false,
"interval": "",
- "legendFormat": "Table Locks Waited - {{pod}}",
+ "legendFormat": {{ `"Table Locks Waited - {{pod}}"` }},
"refId": "B"
}
],
@@ -1762,7 +1763,7 @@
"exemplar": true,
"expr": "rate(mysql_global_status_questions{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}[5m])",
"interval": "",
- "legendFormat": "Questions - {{pod}}",
+ "legendFormat": {{ `"Questions - {{pod}}"` }},
"refId": "A"
}
],
@@ -1890,7 +1891,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 1,
- "legendFormat": "Inbound - {{pod}}",
+ "legendFormat": {{ `"Inbound - {{pod}}"` }},
"metric": "",
"refId": "A",
"step": 20
@@ -1904,7 +1905,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 1,
- "legendFormat": "Outbound - {{pod}}",
+ "legendFormat": {{ `"Outbound - {{pod}}"` }},
"metric": "",
"refId": "B",
"step": 20
@@ -2021,7 +2022,7 @@
"instant": false,
"interval": "1h",
"intervalFactor": 1,
- "legendFormat": "Received - {{pod}}",
+ "legendFormat": {{ `"Received - {{pod}}"` }},
"metric": "",
"refId": "A",
"step": 20
@@ -2035,7 +2036,7 @@
"format": "time_series",
"interval": "1h",
"intervalFactor": 1,
- "legendFormat": "Sent - {{pod}}",
+ "legendFormat": {{ `"Sent - {{pod}}"` }},
"metric": "",
"refId": "B",
"step": 20
@@ -2153,7 +2154,7 @@
"expr": "mysql_global_variables_innodb_buffer_pool_size{namespace=\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}",
"hide": false,
"interval": "",
- "legendFormat": "InnoDB Buffer Pool Size - {{pod}}",
+ "legendFormat": {{ `"InnoDB Buffer Pool Size - {{pod}}"` }},
"refId": "A"
},
{
@@ -2161,7 +2162,7 @@
"expr": "mysql_global_variables_innodb_log_buffer_size{namespace=\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}",
"hide": false,
"interval": "",
- "legendFormat": "InnoDB Log Buffer Size - {{pod}}",
+ "legendFormat": {{ `"InnoDB Log Buffer Size - {{pod}}"` }},
"refId": "B"
},
{
@@ -2169,7 +2170,7 @@
"expr": "mysql_global_status_innodb_mem_dictionary{namespace=\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}",
"hide": false,
"interval": "",
- "legendFormat": "InnoDB Dictionary Size - {{pod}}",
+ "legendFormat": {{ `"InnoDB Dictionary Size - {{pod}}"` }},
"refId": "D"
},
{
@@ -2177,7 +2178,7 @@
"expr": "mysql_global_variables_key_buffer_size{namespace=\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}",
"hide": false,
"interval": "",
- "legendFormat": "Key Buffer Size - {{pod}}",
+ "legendFormat": {{ `"Key Buffer Size - {{pod}}"` }},
"refId": "E"
},
{
@@ -2185,7 +2186,7 @@
"expr": "mysql_global_variables_query_cache_size{namespace=\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}",
"hide": false,
"interval": "",
- "legendFormat": "Query Cache Size - {{pod}}",
+ "legendFormat": {{ `"Query Cache Size - {{pod}}"` }},
"refId": "F"
},
{
@@ -2193,7 +2194,7 @@
"expr": "mysql_global_status_innodb_mem_adaptive_hash{namespace=\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}",
"hide": false,
"interval": "",
- "legendFormat": "Adaptive Hash Index Size - {{pod}}",
+ "legendFormat": {{ `"Adaptive Hash Index Size - {{pod}}"` }},
"refId": "G"
}
],
@@ -2308,7 +2309,7 @@
"expr": "topk(5, rate(mysql_global_status_commands_total{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}[5m]))",
"instant": false,
"interval": "",
- "legendFormat": "Com_{{ command }} - {{pod}}",
+ "legendFormat": {{ `"Com_{{ command }} - {{pod}}"` }},
"refId": "A"
}
],
@@ -2424,7 +2425,7 @@
"instant": false,
"interval": "1h",
"intervalFactor": 1,
- "legendFormat": "Com_{{ command }} - {{pod}}",
+ "legendFormat": {{ `"Com_{{ command }} - {{pod}}"` }},
"metric": "",
"refId": "A",
"step": 20
@@ -2528,7 +2529,7 @@
"expr": "rate(mysql_global_status_handlers_total{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}[5m])>0",
"instant": false,
"interval": "",
- "legendFormat": "{{ handler }} - {{pod}}",
+ "legendFormat": {{ `"{{ handler }} - {{pod}}"` }},
"refId": "A"
}
],
@@ -2642,7 +2643,7 @@
"exemplar": true,
"expr": "rate(mysql_global_status_qcache_free_memory{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}[5m])",
"interval": "",
- "legendFormat": "Query Cache Size - {{pod}}",
+ "legendFormat": {{ `"Query Cache Size - {{pod}}"` }},
"refId": "A"
}
],
@@ -2742,7 +2743,7 @@
"exemplar": true,
"expr": "rate(mysql_global_status_qcache_hits{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}[5m])",
"interval": "",
- "legendFormat": "Hits - {{pod}}",
+ "legendFormat": {{ `"Hits - {{pod}}"` }},
"refId": "A"
},
{
@@ -2750,7 +2751,7 @@
"expr": "rate(mysql_global_status_qcache_inserts{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}[5m])",
"hide": false,
"interval": "",
- "legendFormat": "Inserts - {{pod}}",
+ "legendFormat": {{ `"Inserts - {{pod}}"` }},
"refId": "B"
},
{
@@ -2758,7 +2759,7 @@
"expr": "rate(mysql_global_status_qcache_not_cached{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}[5m])",
"hide": false,
"interval": "",
- "legendFormat": "Not Cached - {{pod}}",
+ "legendFormat": {{ `"Not Cached - {{pod}}"` }},
"refId": "C"
},
{
@@ -2766,7 +2767,7 @@
"expr": "rate(mysql_global_status_qcache_lowmem_prunes{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}[5m])",
"hide": false,
"interval": "",
- "legendFormat": "Prunes - {{pod}}",
+ "legendFormat": {{ `"Prunes - {{pod}}"` }},
"refId": "D"
},
{
@@ -2774,7 +2775,7 @@
"expr": "rate(mysql_global_status_qcache_queries_in_cache{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}[5m])",
"hide": false,
"interval": "",
- "legendFormat": "Queries in Cache - {{pod}}",
+ "legendFormat": {{ `"Queries in Cache - {{pod}}"` }},
"refId": "E"
}
],
@@ -2886,7 +2887,7 @@
"exemplar": true,
"expr": "mysql_global_status_opened_files{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}",
"interval": "",
- "legendFormat": "Openings - {{pod}}",
+ "legendFormat": {{ `"Openings - {{pod}}"` }},
"refId": "A"
}
],
@@ -2984,21 +2985,21 @@
"exemplar": true,
"expr": "mysql_global_status_open_files{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}",
"interval": "",
- "legendFormat": "Open Files - {{pod}}",
+ "legendFormat": {{ `"Open Files - {{pod}}"` }},
"refId": "A"
},
{
"exemplar": true,
"expr": "mysql_global_variables_open_files_limit{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}",
"interval": "",
- "legendFormat": "Open Files Limit - {{pod}}",
+ "legendFormat": {{ `"Open Files Limit - {{pod}}"` }},
"refId": "B"
},
{
"exemplar": true,
"expr": "mysql_global_status_innodb_num_open_files{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}",
"interval": "",
- "legendFormat": "InnoDB Open Files - {{pod}}",
+ "legendFormat": {{ `"InnoDB Open Files - {{pod}}"` }},
"refId": "C"
}
],
@@ -3110,7 +3111,7 @@
"exemplar": true,
"expr": "rate(mysql_global_status_opened_tables{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}[5m])",
"interval": "",
- "legendFormat": "Openings - {{pod}}",
+ "legendFormat": {{ `"Openings - {{pod}}"` }},
"refId": "A"
},
{
@@ -3118,7 +3119,7 @@
"expr": "rate(mysql_global_status_table_open_cache_hits{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}[5m])",
"hide": false,
"interval": "",
- "legendFormat": "Hits - {{pod}}",
+ "legendFormat": {{ `"Hits - {{pod}}"` }},
"refId": "B"
},
{
@@ -3126,7 +3127,7 @@
"expr": "rate(mysql_global_status_table_open_cache_misses{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}[5m])",
"hide": false,
"interval": "",
- "legendFormat": "Misses - {{pod}}",
+ "legendFormat": {{ `"Misses - {{pod}}"` }},
"refId": "C"
},
{
@@ -3134,7 +3135,7 @@
"expr": "rate(mysql_global_status_table_open_cache_overflows{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}[5m])",
"hide": false,
"interval": "",
- "legendFormat": "Misses due to Overflows - {{pod}}",
+ "legendFormat": {{ `"Misses due to Overflows - {{pod}}"` }},
"refId": "D"
},
{
@@ -3142,7 +3143,7 @@
"expr": "rate(mysql_global_status_table_open_cache_hits{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}[5m])",
"hide": false,
"interval": "",
- "legendFormat": "Table Open Cache Hit Ratio - {{pod}}",
+ "legendFormat": {{ `"Table Open Cache Hit Ratio - {{pod}}"` }},
"refId": "E"
}
],
@@ -3240,14 +3241,14 @@
"exemplar": true,
"expr": "mysql_global_status_open_tables{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}",
"interval": "",
- "legendFormat": "Open Tables - {{pod}}",
+ "legendFormat": {{ `"Open Tables - {{pod}}"` }},
"refId": "A"
},
{
"exemplar": true,
"expr": "mysql_global_variables_table_open_cache{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}",
"interval": "",
- "legendFormat": "Table Open Cache - {{pod}}",
+ "legendFormat": {{ `"Table Open Cache - {{pod}}"` }},
"refId": "B"
}
],
@@ -3345,14 +3346,14 @@
"exemplar": true,
"expr": "mysql_global_status_open_table_definitions{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}",
"interval": "",
- "legendFormat": "Open Table Definitions - {{pod}}",
+ "legendFormat": {{ `"Open Table Definitions - {{pod}}"` }},
"refId": "A"
},
{
"exemplar": true,
"expr": "mysql_global_variables_table_definition_cache{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}",
"interval": "",
- "legendFormat": "Table Definitions Cache Size - {{pod}}",
+ "legendFormat": {{ `"Table Definitions Cache Size - {{pod}}"` }},
"refId": "B"
},
{
@@ -3360,7 +3361,7 @@
"expr": "mysql_global_status_opened_table_definitions{namespace=~\"$namespace\",service=~\"$app+-stats\",pod=~\"$pod\"}",
"hide": false,
"interval": "",
- "legendFormat": "Opened Table Definitions - {{pod}}",
+ "legendFormat": {{ `"Opened Table Definitions - {{pod}}"` }},
"refId": "C"
}
],
@@ -3443,7 +3444,6 @@
"value": "demo"
},
"datasource": "${datasource}",
- "definition": "label_values(kube_namespace_labels,namespace)",
"description": null,
"error": null,
"hide": 0,
@@ -3452,7 +3452,13 @@
"multi": false,
"name": "namespace",
"options": [],
+ {{- if $shared }}
"query": "label_values(kube_namespace_labels,namespace)",
+ "type": "query",
+ {{- else }}
+ "query": {{ $.Values.app.namespace | quote }},
+ "type": "constant",
+ {{- end }}
"refresh": 1,
"regex": "",
"skipUrlSync": false,
@@ -3460,7 +3466,6 @@
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
- "type": "query",
"useTags": false
},
{
@@ -3471,7 +3476,6 @@
"value": "sample-mysql-stats"
},
"datasource": "${datasource}",
- "definition": "label_values(kubedb_com_mysql_status_phase{namespace=~\"$namespace\"},app)",
"description": "",
"error": null,
"hide": 0,
@@ -3480,7 +3484,13 @@
"multi": false,
"name": "app",
"options": [],
+ {{- if $shared }}
"query": "label_values(kubedb_com_mysql_status_phase{namespace=~\"$namespace\"},app)",
+ "type": "query",
+ {{- else }}
+ "query": {{ $.Values.app.name | quote }},
+ "type": "constant",
+ {{- end }}
"refresh": 1,
"regex": "",
"skipUrlSync": false,
@@ -3488,7 +3498,6 @@
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
- "type": "query",
"useTags": false
},
{
@@ -3531,7 +3540,11 @@
},
"timepicker": {},
"timezone": "",
+ {{- if $shared }}
"title": "KubeDB / MySQL / Pod",
+ {{- else }}
+ "title": {{ printf "KubeDB / MySQL / Pod / %s / %s" $.Values.app.namespace $.Values.app.name | quote }},
+ {{- end }}
"uid": "FktZiiOnz",
"version": 6
}
\ No newline at end of file
diff --git a/charts/kubedb-grafana-dashboards/dashboards/mysql/mysql_summary_dashboard.json b/charts/kubedb-grafana-dashboards/dashboards/mysql/mysql_summary_dashboard.json
index 5e9d024ef..b910a74f6 100644
--- a/charts/kubedb-grafana-dashboards/dashboards/mysql/mysql_summary_dashboard.json
+++ b/charts/kubedb-grafana-dashboards/dashboards/mysql/mysql_summary_dashboard.json
@@ -1,3 +1,4 @@
+{{- $shared := and (eq .Values.app.name "") (eq .Values.app.namespace "") -}}
{
"annotations": {
"list": [
@@ -121,7 +122,7 @@
"format": "table",
"instant": true,
"interval": "",
- "legendFormat": "{{phase}}",
+ "legendFormat": {{ `"{{phase}}"` }},
"refId": "A"
}
],
@@ -204,7 +205,7 @@
"instant": true,
"interval": "",
"intervalFactor": 1,
- "legendFormat": "{{ version }}",
+ "legendFormat": {{ `"{{version}}"` }},
"refId": "A"
}
],
@@ -287,7 +288,7 @@
"instant": true,
"interval": "",
"intervalFactor": 1,
- "legendFormat": "{{ useAddressType }}",
+ "legendFormat": {{ `"{{ useAddressType }}"` }},
"refId": "A"
}
],
@@ -366,7 +367,7 @@
"format": "time_series",
"instant": true,
"interval": "",
- "legendFormat": "{{requireSSL}}",
+ "legendFormat": {{ `"{{requireSSL}}"` }},
"refId": "A"
}
],
@@ -448,7 +449,7 @@
"format": "table",
"instant": true,
"interval": "",
- "legendFormat": "{{terminationPolicy}}",
+ "legendFormat": {{ `"{{terminationPolicy}}"` }},
"refId": "A"
}
],
@@ -877,7 +878,7 @@
"exemplar": true,
"expr": "sum(node_namespace_pod_container:container_cpu_usage_seconds_total:sum_irate{namespace=\"$namespace\", pod=~\"$app-\\\\d+$\"}) by (pod)",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -1280,7 +1281,7 @@
"exemplar": true,
"expr": "sum(node_namespace_pod_container:container_memory_working_set_bytes{namespace=\"$namespace\", pod=~\"$app-\\\\d+$\",container!=\"\"}) by (pod)",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -1787,7 +1788,7 @@
"exemplar": true,
"expr": "avg(container_blkio_device_usage_total{namespace=\"$namespace\", pod=~\"$app-\\\\d+$\"}) by (pod)",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -1886,7 +1887,7 @@
"instant": false,
"interval": "",
"intervalFactor": 1,
- "legendFormat": "{{pod}}-disk-write",
+ "legendFormat": {{ `"{{pod}}-disk-write"` }},
"refId": "A"
},
{
@@ -1895,7 +1896,7 @@
"hide": false,
"instant": false,
"interval": "",
- "legendFormat": "{{pod}}-disk-read",
+ "legendFormat": {{ `"{{pod}}-disk-read"` }},
"refId": "B"
}
],
@@ -1994,7 +1995,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"legendLink": null,
"refId": "A",
"step": 10
@@ -2095,7 +2096,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"legendLink": null,
"refId": "A",
"step": 10
@@ -2604,7 +2605,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"
}
],
@@ -2688,7 +2689,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"
}
],
@@ -2761,7 +2762,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"legendLink": null,
"refId": "A",
"step": 10
@@ -2862,7 +2863,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"legendLink": null,
"refId": "A",
"step": 10
@@ -2950,7 +2951,6 @@
"value": "demo"
},
"datasource": "${datasource}",
- "definition": "label_values(kube_namespace_labels,namespace)",
"description": null,
"error": null,
"hide": 0,
@@ -2959,10 +2959,16 @@
"multi": false,
"name": "namespace",
"options": [],
+ {{- if $shared }}
"query": {
"query": "label_values(kube_namespace_labels,namespace)",
"refId": "Prometheus-namespace-Variable-Query"
},
+ "type": "query",
+ {{- else }}
+ "query": {{ $.Values.app.namespace | quote }},
+ "type": "constant",
+ {{- end }}
"refresh": 1,
"regex": "",
"skipUrlSync": false,
@@ -2970,7 +2976,6 @@
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
- "type": "query",
"useTags": false
},
{
@@ -2981,7 +2986,6 @@
"value": "coreos-prom-mysql"
},
"datasource": "${datasource}",
- "definition": "label_values(kubedb_com_mysql_status_phase{namespace=~\"$namespace\"},app)",
"description": null,
"error": null,
"hide": 0,
@@ -2990,10 +2994,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,
@@ -3001,7 +3011,6 @@
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
- "type": "query",
"useTags": false
}
]
@@ -3036,7 +3045,11 @@
]
},
"timezone": "",
+ {{- if $shared }}
"title": "KubeDB / MySQL / Summary",
+ {{- else }}
+ "title": {{ printf "KubeDB / MySQL / Summary / %s / %s" $.Values.app.namespace $.Values.app.name | quote }},
+ {{- end }}
"uid": "VsnOgk2Hnk",
"version": 3
}
\ No newline at end of file
diff --git a/charts/kubedb-grafana-dashboards/dashboards/perconaxtradb/perconaxtradb-database.json b/charts/kubedb-grafana-dashboards/dashboards/perconaxtradb/perconaxtradb-database.json
index b3c9f87e1..b44c38250 100644
--- a/charts/kubedb-grafana-dashboards/dashboards/perconaxtradb/perconaxtradb-database.json
+++ b/charts/kubedb-grafana-dashboards/dashboards/perconaxtradb/perconaxtradb-database.json
@@ -1,3 +1,4 @@
+{{- $shared := and (eq .Values.app.name "") (eq .Values.app.namespace "") -}}
{
"annotations": {
"list": [
@@ -138,7 +139,7 @@
"instant": true,
"interval": "",
"intervalFactor": 1,
- "legendFormat": "{{ pod }}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -242,7 +243,7 @@
"format": "table",
"instant": true,
"interval": "",
- "legendFormat": "{{ pod }}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -486,7 +487,7 @@
"exemplar": true,
"expr": "rate(mysql_global_status_queries{namespace=~\"$namespace\",service=~\"$app\"}[5m])",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -588,7 +589,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 1,
- "legendFormat": "Current - {{ pod }}",
+ "legendFormat": {{ `"Current - {{ pod }}"` }},
"refId": "A"
},
{
@@ -597,7 +598,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 1,
- "legendFormat": "Max - {{ pod }}",
+ "legendFormat": {{ `"Max - {{ pod }}"` }},
"refId": "B"
}
],
@@ -703,7 +704,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 1,
- "legendFormat": "reads - {{ pod }}",
+ "legendFormat": {{ `"reads - {{ pod }}"` }},
"refId": "A"
},
{
@@ -712,7 +713,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 1,
- "legendFormat": "write - {{ pod }}",
+ "legendFormat": {{ `"write - {{ pod }}"` }},
"refId": "B"
}
],
@@ -818,7 +819,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 1,
- "legendFormat": "received - {{ pod }}",
+ "legendFormat": {{ `"received - {{ pod }}"` }},
"refId": "A"
},
{
@@ -827,7 +828,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 1,
- "legendFormat": "sent - {{ pod }}",
+ "legendFormat": {{ `"sent - {{ pod }}"` }},
"refId": "B"
}
],
@@ -928,7 +929,7 @@
"expr": "topk(3, rate(mysql_global_status_commands_total{namespace=~\"$namespace\",service=~\"$app\"}[5m]))",
"instant": false,
"interval": "",
- "legendFormat": "{{ pod }} = '{{ command }}'",
+ "legendFormat": {{ `"{{ pod }} = '{{ command }}'"` }},
"refId": "A"
}
],
@@ -1026,7 +1027,7 @@
"exemplar": true,
"expr": "rate(mysql_global_status_opened_files{namespace=~\"$namespace\",service=~\"$app\"}[1m])",
"interval": "",
- "legendFormat": "{{ pod }}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -1124,21 +1125,21 @@
"exemplar": true,
"expr": "mysql_global_status_open_files{namespace=~\"$namespace\",service=~\"$app\"}",
"interval": "",
- "legendFormat": "Open Files - {{ pod }}",
+ "legendFormat": {{ `"Open Files - {{ pod }}"` }},
"refId": "A"
},
{
"exemplar": true,
"expr": "mysql_global_variables_open_files_limit{namespace=~\"$namespace\",service=~\"$app\"}",
"interval": "",
- "legendFormat": "Open Files Limit - {{ pod }}",
+ "legendFormat": {{ `"Open Files Limit - {{ pod }}"` }},
"refId": "B"
},
{
"exemplar": true,
"expr": "mysql_global_status_innodb_num_open_files{namespace=~\"$namespace\",service=~\"$app\"}",
"interval": "",
- "legendFormat": "InnoDB Open Files - {{ pod }}",
+ "legendFormat": {{ `"InnoDB Open Files - {{ pod }}"` }},
"refId": "C"
}
],
@@ -1237,7 +1238,7 @@
"exemplar": true,
"expr": "rate(mysql_global_status_slow_queries{namespace=~\"$namespace\",service=~\"$app\"}[1m])",
"interval": "",
- "legendFormat": "Slow Queries on {{ pod }}",
+ "legendFormat": {{ `"Slow Queries on {{ pod }}"` }},
"refId": "A"
}
],
@@ -1334,14 +1335,14 @@
"exemplar": true,
"expr": "rate(mysql_global_status_aborted_connects{namespace=~\"$namespace\",service=~\"$app\"}[5m])",
"interval": "",
- "legendFormat": "Aborted Connects (attempts) on - {{ pod }}",
+ "legendFormat": {{ `"Aborted Connects (attempts) on - {{ pod }}"` }},
"refId": "A"
},
{
"exemplar": true,
"expr": "rate(mysql_global_status_aborted_clients{namespace=~\"$namespace\",service=~\"$app\"}[5m])",
"interval": "",
- "legendFormat": "Aborted Clients (timeout) on - {{ pod }}",
+ "legendFormat": {{ `"Aborted Clients (timeout) on - {{ pod }}"` }},
"refId": "B"
}
],
@@ -1427,7 +1428,6 @@
"value": "demo"
},
"datasource": "${datasource}",
- "definition": "label_values(kube_namespace_labels,namespace)",
"description": null,
"error": null,
"hide": 0,
@@ -1436,7 +1436,13 @@
"multi": false,
"name": "namespace",
"options": [],
+ {{- if $shared }}
"query": "label_values(kube_namespace_labels,namespace)",
+ "type": "query",
+ {{- else }}
+ "query": {{ $.Values.app.namespace | quote }},
+ "type": "constant",
+ {{- end }}
"refresh": 1,
"regex": "",
"skipUrlSync": false,
@@ -1444,7 +1450,6 @@
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
- "type": "query",
"useTags": false
},
{
@@ -1455,7 +1460,6 @@
"value": "sample-perconaxtradb-stats"
},
"datasource": "${datasource}",
- "definition": "label_values(mysql_up{namespace=~\"$namespace\"}, service)",
"description": "PerconaXtraDB stats service name",
"error": null,
"hide": 0,
@@ -1464,7 +1468,13 @@
"multi": false,
"name": "app",
"options": [],
+ {{- if $shared }}
"query": "label_values(mysql_up{namespace=~\"$namespace\"}, service)",
+ "type": "query",
+ {{- else }}
+ "query": {{ $.Values.app.name | quote }},
+ "type": "constant",
+ {{- end }}
"refresh": 1,
"regex": "",
"skipUrlSync": false,
@@ -1472,7 +1482,6 @@
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
- "type": "query",
"useTags": false
}
]
@@ -1483,7 +1492,11 @@
},
"timepicker": {},
"timezone": "",
+ {{- if $shared }}
"title": "KubeDB / PerconaXtraDB / Database",
+ {{- else }}
+ "title": {{ printf "KubeDB / PerconaXtraDB / Database / %s / %s" $.Values.app.namespace $.Values.app.name | quote }},
+ {{- end }}
"uid": "ohrahgv7z",
"version": 8
}
\ No newline at end of file
diff --git a/charts/kubedb-grafana-dashboards/dashboards/perconaxtradb/perconaxtradb-galera.json b/charts/kubedb-grafana-dashboards/dashboards/perconaxtradb/perconaxtradb-galera.json
index a64b7dc71..4502dde2d 100644
--- a/charts/kubedb-grafana-dashboards/dashboards/perconaxtradb/perconaxtradb-galera.json
+++ b/charts/kubedb-grafana-dashboards/dashboards/perconaxtradb/perconaxtradb-galera.json
@@ -1,3 +1,4 @@
+{{- $shared := and (eq .Values.app.name "") (eq .Values.app.namespace "") -}}
{
"annotations": {
"list": [
@@ -80,7 +81,7 @@
"exemplar": true,
"expr": "avg by(wsrep_cluster_name)(mysql_galera_variables_info{namespace=~\"$namespace\",service=~\"$app\"})",
"interval": "",
- "legendFormat": "{{wsrep_cluster_name}}",
+ "legendFormat": {{ `"{{wsrep_cluster_name}}"` }},
"refId": "A"
}
],
@@ -182,7 +183,7 @@
"exemplar": true,
"expr": "avg by(pod)(mysql_galera_variables_info{namespace=~\"$namespace\",service=~\"$app\"})",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -256,7 +257,7 @@
"exemplar": true,
"expr": "avg_over_time(mysql_galera_evs_repl_latency_avg_seconds{namespace=~\"$namespace\",service=~\"$app\"}[5m])",
"interval": "",
- "legendFormat": "{{pod}} - Latency Average",
+ "legendFormat": {{ `"{{pod}} - Latency Average"` }},
"refId": "A"
}
],
@@ -356,7 +357,7 @@
"exemplar": true,
"expr": "rate(mysql_galera_evs_repl_latency_stdev{namespace=~\"$namespace\",service=~\"$app\"}[1m])",
"interval": "",
- "legendFormat": "{{pod}} - Latency Average",
+ "legendFormat": {{ `"{{pod}} - Latency Average"` }},
"refId": "A"
}
],
@@ -456,7 +457,7 @@
"exemplar": true,
"expr": "rate(mysql_galera_evs_repl_latency_sample_size{namespace=~\"$namespace\",service=~\"$app\"}[1m])",
"interval": "",
- "legendFormat": "{{pod}} - Latency Average",
+ "legendFormat": {{ `"{{pod}} - Latency Average"` }},
"refId": "A"
}
],
@@ -539,7 +540,6 @@
"value": "demo"
},
"datasource": "${datasource}",
- "definition": "label_values(kube_namespace_labels,namespace)",
"description": null,
"error": null,
"hide": 0,
@@ -548,7 +548,13 @@
"multi": false,
"name": "namespace",
"options": [],
+ {{- if $shared }}
"query": "label_values(kube_namespace_labels,namespace)",
+ "type": "query",
+ {{- else }}
+ "query": {{ $.Values.app.namespace | quote }},
+ "type": "constant",
+ {{- end }}
"refresh": 1,
"regex": "",
"skipUrlSync": false,
@@ -556,7 +562,6 @@
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
- "type": "query",
"useTags": false
},
{
@@ -567,7 +572,6 @@
"value": "sample-perconaxtradb-stats"
},
"datasource": "${datasource}",
- "definition": "label_values(mysql_up{namespace=~\"$namespace\"}, service)",
"description": "",
"error": null,
"hide": 0,
@@ -576,7 +580,13 @@
"multi": false,
"name": "app",
"options": [],
+ {{- if $shared }}
"query": "label_values(mysql_up{namespace=~\"$namespace\"}, service)",
+ "type": "query",
+ {{- else }}
+ "query": {{ $.Values.app.name | quote }},
+ "type": "constant",
+ {{- end }}
"refresh": 1,
"regex": "",
"skipUrlSync": false,
@@ -584,7 +594,6 @@
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
- "type": "query",
"useTags": false
}
]
@@ -595,7 +604,11 @@
},
"timepicker": {},
"timezone": "",
+ {{- if $shared }}
"title": "KubeDB / PerconaXtraDB / Galera-Cluster",
+ {{- else }}
+ "title": {{ printf "KubeDB / PerconaXtraDB / Galera-Cluster / %s / %s" $.Values.app.namespace $.Values.app.name | quote }},
+ {{- end }}
"uid": "Zmva7c57k",
"version": 5
}
\ No newline at end of file
diff --git a/charts/kubedb-grafana-dashboards/dashboards/perconaxtradb/perconaxtradb-pod.json b/charts/kubedb-grafana-dashboards/dashboards/perconaxtradb/perconaxtradb-pod.json
index 2e594e219..29fc177ac 100644
--- a/charts/kubedb-grafana-dashboards/dashboards/perconaxtradb/perconaxtradb-pod.json
+++ b/charts/kubedb-grafana-dashboards/dashboards/perconaxtradb/perconaxtradb-pod.json
@@ -1,3 +1,4 @@
+{{- $shared := and (eq .Values.app.name "") (eq .Values.app.namespace "") -}}
{
"annotations": {
"list": [
@@ -82,7 +83,7 @@
"exemplar": true,
"expr": "mysql_up{namespace=~\"$namespace\",service=~\"$app\",pod=~\"$pod\"}",
"interval": "",
- "legendFormat": "{{pod}} ",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -157,7 +158,7 @@
"format": "time_series",
"instant": false,
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -217,7 +218,7 @@
"exemplar": true,
"expr": "mysql_version_info{namespace=~\"$namespace\",service=~\"$app\",pod=~\"$pod\"}",
"interval": "",
- "legendFormat": "{{version}}",
+ "legendFormat": {{ `"{{version}}"` }},
"refId": "A"
}
],
@@ -273,7 +274,7 @@
"exemplar": true,
"expr": "rate(mysql_global_status_queries{namespace=~\"$namespace\",service=~\"$app\",pod=~\"$pod\"}[5m])",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -350,7 +351,7 @@
"format": "time_series",
"instant": false,
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -423,7 +424,7 @@
"exemplar": true,
"expr": "sum(rate(container_cpu_usage_seconds_total{namespace=\"$namespace\", pod=\"$pod\", container!=\"\", image!=\"\"}[5m])) by (pod)",
"interval": "",
- "legendFormat": "{{container}}",
+ "legendFormat": {{ `"{{container}}"` }},
"refId": "A"
}
],
@@ -520,7 +521,7 @@
"exemplar": true,
"expr": "sum(container_memory_working_set_bytes{namespace=\"$namespace\", pod=\"$pod\", container!=\"\", image!=\"\"}) by (pod)",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -618,7 +619,7 @@
"exemplar": true,
"expr": "sum(process_open_fds{pod=\"$pod\", namespace=\"$namespace\"}) by (pod)",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -728,7 +729,7 @@
"exemplar": true,
"expr": "mysql_global_status_max_used_connections{namespace=~\"$namespace\",service=~\"$app\",pod=~\"$pod\"}",
"interval": "",
- "legendFormat": "Max Used Connects - {{pod}}",
+ "legendFormat": {{ `"Max Used Connects - {{pod}}"` }},
"refId": "A"
},
{
@@ -736,7 +737,7 @@
"expr": "mysql_global_variables_max_connections{namespace=~\"$namespace\",service=~\"$app\",pod=~\"$pod\"}",
"hide": false,
"interval": "",
- "legendFormat": "Max Connects - {{pod}}",
+ "legendFormat": {{ `"Max Connects - {{pod}}"` }},
"refId": "B"
}
],
@@ -833,7 +834,7 @@
"exemplar": true,
"expr": "mysql_global_status_aborted_connects{namespace=~\"$namespace\",service=~\"$app\",pod=~\"$pod\"}",
"interval": "",
- "legendFormat": "Aborted Connects - {{pod}}",
+ "legendFormat": {{ `"Aborted Connects - {{pod}}"` }},
"refId": "A"
},
{
@@ -841,7 +842,7 @@
"expr": "mysql_global_status_aborted_clients{namespace=~\"$namespace\",service=~\"$app\",pod=~\"$pod\"}",
"hide": false,
"interval": "",
- "legendFormat": "Aborted Clients - {{pod}}",
+ "legendFormat": {{ `"Aborted Clients - {{pod}}"` }},
"refId": "B"
}
],
@@ -954,7 +955,7 @@
"exemplar": true,
"expr": "mysql_global_status_threads_connected{namespace=~\"$namespace\",service=~\"$app\",pod=~\"$pod\"}",
"interval": "",
- "legendFormat": "Threads Connected - {{pod}}",
+ "legendFormat": {{ `"Threads Connected - {{pod}}"` }},
"refId": "A"
},
{
@@ -962,7 +963,7 @@
"expr": "mysql_global_status_threads_running{namespace=~\"$namespace\",service=~\"$app\",pod=~\"$pod\"}",
"hide": false,
"interval": "",
- "legendFormat": "Threads Running - {{pod}}",
+ "legendFormat": {{ `"Threads Running - {{pod}}"` }},
"refId": "B"
}
],
@@ -1060,7 +1061,7 @@
"exemplar": true,
"expr": "mysql_global_variables_thread_cache_size{namespace=~\"$namespace\",service=~\"$app\",pod=~\"$pod\"}",
"interval": "",
- "legendFormat": "Thread Cache Size - {{pod}}",
+ "legendFormat": {{ `"Thread Cache Size - {{pod}}"` }},
"refId": "A"
},
{
@@ -1068,7 +1069,7 @@
"expr": "mysql_global_status_threads_cached{namespace=~\"$namespace\",service=~\"$app\",pod=~\"$pod\"}",
"hide": false,
"interval": "",
- "legendFormat": "Threads Cached - {{pod}} ",
+ "legendFormat": {{ `"Threads Cached - {{pod}}"` }},
"refId": "B"
},
{
@@ -1076,7 +1077,7 @@
"expr": "mysql_global_status_threads_created{namespace=~\"$namespace\",service=~\"$app\",pod=~\"$pod\"}",
"hide": false,
"interval": "",
- "legendFormat": "Threads Created - {{pod}}",
+ "legendFormat": {{ `"Threads Created - {{pod}}"` }},
"refId": "C"
}
],
@@ -1188,7 +1189,7 @@
"exemplar": true,
"expr": "rate(mysql_global_status_created_tmp_tables{namespace=~\"$namespace\",service=~\"$app\",pod=~\"$pod\"}[5m])",
"interval": "",
- "legendFormat": "Created Tmp Tables - {{pod}}",
+ "legendFormat": {{ `"Created Tmp Tables - {{pod}}"` }},
"refId": "A"
},
{
@@ -1196,7 +1197,7 @@
"expr": "rate(mysql_global_status_created_tmp_disk_tables{namespace=~\"$namespace\",service=~\"$app\",pod=~\"$pod\"}[5m])",
"hide": false,
"interval": "",
- "legendFormat": "Created Tmp Disk Tables - {{pod}}",
+ "legendFormat": {{ `"Created Tmp Disk Tables - {{pod}}"` }},
"refId": "B"
},
{
@@ -1204,7 +1205,7 @@
"expr": "mysql_global_status_created_tmp_files{namespace=~\"$namespace\",service=~\"$app\",pod=~\"$pod\"}",
"hide": false,
"interval": "",
- "legendFormat": "Created Tmp Files - {{pod}}",
+ "legendFormat": {{ `"Created Tmp Files - {{pod}}"` }},
"refId": "C"
}
],
@@ -1302,7 +1303,7 @@
"exemplar": true,
"expr": "mysql_global_status_slow_queries{namespace=~\"$namespace\",service=~\"$app\",pod=~\"$pod\"}",
"interval": "",
- "legendFormat": "Slow Queries - {{pod}}",
+ "legendFormat": {{ `"Slow Queries - {{pod}}"` }},
"refId": "A"
}
],
@@ -1416,7 +1417,7 @@
"exemplar": true,
"expr": "rate(mysql_global_status_select_full_join{namespace=~\"$namespace\",service=~\"$app\",pod=~\"$pod\"}[5m])",
"interval": "",
- "legendFormat": "Select Full Join - {{pod}}",
+ "legendFormat": {{ `"Select Full Join - {{pod}}"` }},
"refId": "A"
},
{
@@ -1424,7 +1425,7 @@
"expr": "rate(mysql_global_status_select_scan{namespace=~\"$namespace\",service=~\"$app\",pod=~\"$pod\"}[5m])",
"hide": false,
"interval": "",
- "legendFormat": "Select Scan - {{pod}}",
+ "legendFormat": {{ `"Select Scan - {{pod}}"` }},
"refId": "E"
}
],
@@ -1522,7 +1523,7 @@
"exemplar": true,
"expr": "rate(mysql_global_status_sort_rows{namespace=~\"$namespace\",service=~\"$app\",pod=~\"$pod\"}[5m])",
"interval": "",
- "legendFormat": "Sort Rows - {{pod}}",
+ "legendFormat": {{ `"Sort Rows - {{pod}}"` }},
"refId": "A"
},
{
@@ -1530,7 +1531,7 @@
"expr": "rate(mysql_global_status_sort_range{namespace=~\"$namespace\",service=~\"$app\",pod=~\"$pod\"}[5m])",
"hide": false,
"interval": "",
- "legendFormat": "Sort Range - {{pod}}",
+ "legendFormat": {{ `"Sort Range - {{pod}}"` }},
"refId": "B"
},
{
@@ -1538,7 +1539,7 @@
"expr": "rate(mysql_global_status_sort_merge_passes{namespace=~\"$namespace\",service=~\"$app\",pod=~\"$pod\"}[5m])",
"hide": false,
"interval": "",
- "legendFormat": "Sort Merge Passes - {{pod}}",
+ "legendFormat": {{ `"Sort Merge Passes - {{pod}}"` }},
"refId": "C"
},
{
@@ -1546,7 +1547,7 @@
"expr": "rate(mysql_global_status_sort_scan{namespace=~\"$namespace\",service=~\"$app\",pod=~\"$pod\"}[5m])",
"hide": false,
"interval": "",
- "legendFormat": "Sort Scan - {{pod}}",
+ "legendFormat": {{ `"Sort Scan - {{pod}}"` }},
"refId": "D"
}
],
@@ -1657,7 +1658,7 @@
"exemplar": true,
"expr": "rate(mysql_global_status_table_locks_immediate{namespace=~\"$namespace\",service=~\"$app\",pod=~\"$pod\"}[5m])",
"interval": "",
- "legendFormat": "Table Locks Immediate - {{pod}}",
+ "legendFormat": {{ `"Table Locks Immediate - {{pod}}"` }},
"refId": "A"
},
{
@@ -1665,7 +1666,7 @@
"expr": "rate(mysql_global_status_table_locks_waited{namespace=~\"$namespace\",service=~\"$app\",pod=~\"$pod\"}[5m])",
"hide": false,
"interval": "",
- "legendFormat": "Table Locks Waited - {{pod}}",
+ "legendFormat": {{ `"Table Locks Waited - {{pod}}"` }},
"refId": "B"
}
],
@@ -1762,7 +1763,7 @@
"exemplar": true,
"expr": "rate(mysql_global_status_questions{namespace=~\"$namespace\",service=~\"$app\",pod=~\"$pod\"}[5m])",
"interval": "",
- "legendFormat": "Questions - {{pod}}",
+ "legendFormat": {{ `"Questions - {{pod}}"` }},
"refId": "A"
}
],
@@ -1890,7 +1891,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 1,
- "legendFormat": "Inbound - {{pod}}",
+ "legendFormat": {{ `"Inbound - {{pod}}"` }},
"metric": "",
"refId": "A",
"step": 20
@@ -1904,7 +1905,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 1,
- "legendFormat": "Outbound - {{pod}}",
+ "legendFormat": {{ `"Outbound - {{pod}}"` }},
"metric": "",
"refId": "B",
"step": 20
@@ -2021,7 +2022,7 @@
"instant": false,
"interval": "1h",
"intervalFactor": 1,
- "legendFormat": "Received - {{pod}}",
+ "legendFormat": {{ `"Received - {{pod}}"` }},
"metric": "",
"refId": "A",
"step": 20
@@ -2035,7 +2036,7 @@
"format": "time_series",
"interval": "1h",
"intervalFactor": 1,
- "legendFormat": "Sent - {{pod}}",
+ "legendFormat": {{ `"Sent - {{pod}}"` }},
"metric": "",
"refId": "B",
"step": 20
@@ -2153,7 +2154,7 @@
"expr": "mysql_global_variables_innodb_buffer_pool_size{namespace=\"$namespace\",service=\"$app\",pod=\"$pod\"}",
"hide": false,
"interval": "",
- "legendFormat": "InnoDB Buffer Pool Size - {{pod}}",
+ "legendFormat": {{ `"InnoDB Buffer Pool Size - {{pod}}"` }},
"refId": "A"
},
{
@@ -2161,7 +2162,7 @@
"expr": "mysql_global_variables_innodb_log_buffer_size{namespace=\"$namespace\",service=\"$app\",pod=\"$pod\"}",
"hide": false,
"interval": "",
- "legendFormat": "InnoDB Log Buffer Size - {{pod}}",
+ "legendFormat": {{ `"InnoDB Log Buffer Size - {{pod}}"` }},
"refId": "B"
},
{
@@ -2169,7 +2170,7 @@
"expr": "mysql_global_status_innodb_mem_dictionary{namespace=\"$namespace\",service=\"$app\",pod=\"$pod\"}",
"hide": false,
"interval": "",
- "legendFormat": "InnoDB Dictionary Size - {{pod}}",
+ "legendFormat": {{ `"InnoDB Dictionary Size - {{pod}}"` }},
"refId": "D"
},
{
@@ -2177,7 +2178,7 @@
"expr": "mysql_global_variables_key_buffer_size{namespace=\"$namespace\",service=\"$app\",pod=\"$pod\"}",
"hide": false,
"interval": "",
- "legendFormat": "Key Buffer Size - {{pod}}",
+ "legendFormat": {{ `"Key Buffer Size - {{pod}}"` }},
"refId": "E"
},
{
@@ -2185,7 +2186,7 @@
"expr": "mysql_global_variables_query_cache_size{namespace=\"$namespace\",service=\"$app\",pod=\"$pod\"}",
"hide": false,
"interval": "",
- "legendFormat": "Query Cache Size - {{pod}}",
+ "legendFormat": {{ `"Query Cache Size - {{pod}}"` }},
"refId": "F"
},
{
@@ -2193,7 +2194,7 @@
"expr": "mysql_global_status_innodb_mem_adaptive_hash{namespace=\"$namespace\",service=\"$app\",pod=\"$pod\"}",
"hide": false,
"interval": "",
- "legendFormat": "Adaptive Hash Index Size - {{pod}}",
+ "legendFormat": {{ `"Adaptive Hash Index Size - {{pod}}"` }},
"refId": "G"
}
],
@@ -2308,7 +2309,7 @@
"expr": "topk(5, rate(mysql_global_status_commands_total{namespace=~\"$namespace\",service=~\"$app\",pod=~\"$pod\"}[5m]))",
"instant": false,
"interval": "",
- "legendFormat": "Com_{{ command }} - {{pod}}",
+ "legendFormat": {{ `"Com_{{ command }} - {{pod}}"` }},
"refId": "A"
}
],
@@ -2424,7 +2425,7 @@
"instant": false,
"interval": "1h",
"intervalFactor": 1,
- "legendFormat": "Com_{{ command }} - {{pod}}",
+ "legendFormat": {{ `"Com_{{ command }} - {{pod}}"` }},
"metric": "",
"refId": "A",
"step": 20
@@ -2528,7 +2529,7 @@
"expr": "rate(mysql_global_status_handlers_total{namespace=~\"$namespace\",service=~\"$app\",pod=~\"$pod\"}[5m])>0",
"instant": false,
"interval": "",
- "legendFormat": "{{ handler }} - {{pod}}",
+ "legendFormat": {{ `"{{ handler }} - {{pod}}"` }},
"refId": "A"
}
],
@@ -2642,7 +2643,7 @@
"exemplar": true,
"expr": "rate(mysql_global_status_qcache_free_memory{namespace=~\"$namespace\",service=~\"$app\",pod=~\"$pod\"}[5m])",
"interval": "",
- "legendFormat": "Query Cache Size - {{pod}}",
+ "legendFormat": {{ `"Query Cache Size - {{pod}}"` }},
"refId": "A"
}
],
@@ -2742,7 +2743,7 @@
"exemplar": true,
"expr": "rate(mysql_global_status_qcache_hits{namespace=~\"$namespace\",service=~\"$app\",pod=~\"$pod\"}[5m])",
"interval": "",
- "legendFormat": "Hits - {{pod}}",
+ "legendFormat": {{ `"Hits - {{pod}}"` }},
"refId": "A"
},
{
@@ -2750,7 +2751,7 @@
"expr": "rate(mysql_global_status_qcache_inserts{namespace=~\"$namespace\",service=~\"$app\",pod=~\"$pod\"}[5m])",
"hide": false,
"interval": "",
- "legendFormat": "Inserts - {{pod}}",
+ "legendFormat": {{ `"Inserts - {{pod}}"` }},
"refId": "B"
},
{
@@ -2758,7 +2759,7 @@
"expr": "rate(mysql_global_status_qcache_not_cached{namespace=~\"$namespace\",service=~\"$app\",pod=~\"$pod\"}[5m])",
"hide": false,
"interval": "",
- "legendFormat": "Not Cached - {{pod}}",
+ "legendFormat": {{ `"Not Cached - {{pod}}"` }},
"refId": "C"
},
{
@@ -2766,7 +2767,7 @@
"expr": "rate(mysql_global_status_qcache_lowmem_prunes{namespace=~\"$namespace\",service=~\"$app\",pod=~\"$pod\"}[5m])",
"hide": false,
"interval": "",
- "legendFormat": "Prunes - {{pod}}",
+ "legendFormat": {{ `"Prunes - {{pod}}"` }},
"refId": "D"
},
{
@@ -2774,7 +2775,7 @@
"expr": "rate(mysql_global_status_qcache_queries_in_cache{namespace=~\"$namespace\",service=~\"$app\",pod=~\"$pod\"}[5m])",
"hide": false,
"interval": "",
- "legendFormat": "Queries in Cache - {{pod}}",
+ "legendFormat": {{ `"Queries in Cache - {{pod}}"` }},
"refId": "E"
}
],
@@ -2886,7 +2887,7 @@
"exemplar": true,
"expr": "mysql_global_status_opened_files{namespace=~\"$namespace\",service=~\"$app\",pod=~\"$pod\"}",
"interval": "",
- "legendFormat": "Openings - {{pod}}",
+ "legendFormat": {{ `"Openings - {{pod}}"` }},
"refId": "A"
}
],
@@ -2984,21 +2985,21 @@
"exemplar": true,
"expr": "mysql_global_status_open_files{namespace=~\"$namespace\",service=~\"$app\",pod=~\"$pod\"}",
"interval": "",
- "legendFormat": "Open Files - {{pod}}",
+ "legendFormat": {{ `"Open Files - {{pod}}"` }},
"refId": "A"
},
{
"exemplar": true,
"expr": "mysql_global_variables_open_files_limit{namespace=~\"$namespace\",service=~\"$app\",pod=~\"$pod\"}",
"interval": "",
- "legendFormat": "Open Files Limit - {{pod}}",
+ "legendFormat": {{ `"Open Files Limit - {{pod}}"` }},
"refId": "B"
},
{
"exemplar": true,
"expr": "mysql_global_status_innodb_num_open_files{namespace=~\"$namespace\",service=~\"$app\",pod=~\"$pod\"}",
"interval": "",
- "legendFormat": "InnoDB Open Files - {{pod}}",
+ "legendFormat": {{ `"InnoDB Open Files - {{pod}}"` }},
"refId": "C"
}
],
@@ -3110,7 +3111,7 @@
"exemplar": true,
"expr": "rate(mysql_global_status_opened_tables{namespace=~\"$namespace\",service=~\"$app\",pod=~\"$pod\"}[5m])",
"interval": "",
- "legendFormat": "Openings - {{pod}}",
+ "legendFormat": {{ `"Openings - {{pod}}"` }},
"refId": "A"
},
{
@@ -3118,7 +3119,7 @@
"expr": "rate(mysql_global_status_table_open_cache_hits{namespace=~\"$namespace\",service=~\"$app\",pod=~\"$pod\"}[5m])",
"hide": false,
"interval": "",
- "legendFormat": "Hits - {{pod}}",
+ "legendFormat": {{ `"Hits - {{pod}}"` }},
"refId": "B"
},
{
@@ -3126,7 +3127,7 @@
"expr": "rate(mysql_global_status_table_open_cache_misses{namespace=~\"$namespace\",service=~\"$app\",pod=~\"$pod\"}[5m])",
"hide": false,
"interval": "",
- "legendFormat": "Misses - {{pod}}",
+ "legendFormat": {{ `"Misses - {{pod}}"` }},
"refId": "C"
},
{
@@ -3134,7 +3135,7 @@
"expr": "rate(mysql_global_status_table_open_cache_overflows{namespace=~\"$namespace\",service=~\"$app\",pod=~\"$pod\"}[5m])",
"hide": false,
"interval": "",
- "legendFormat": "Misses due to Overflows - {{pod}}",
+ "legendFormat": {{ `"Misses due to Overflows - {{pod}}"` }},
"refId": "D"
},
{
@@ -3142,7 +3143,7 @@
"expr": "rate(mysql_global_status_table_open_cache_hits{namespace=~\"$namespace\",service=~\"$app\",pod=~\"$pod\"}[5m])",
"hide": false,
"interval": "",
- "legendFormat": "Table Open Cache Hit Ratio - {{pod}}",
+ "legendFormat": {{ `"Table Open Cache Hit Ratio - {{pod}}"` }},
"refId": "E"
}
],
@@ -3240,14 +3241,14 @@
"exemplar": true,
"expr": "mysql_global_status_open_tables{namespace=~\"$namespace\",service=~\"$app\",pod=~\"$pod\"}",
"interval": "",
- "legendFormat": "Open Tables - {{pod}}",
+ "legendFormat": {{ `"Open Tables - {{pod}}"` }},
"refId": "A"
},
{
"exemplar": true,
"expr": "mysql_global_variables_table_open_cache{namespace=~\"$namespace\",service=~\"$app\",pod=~\"$pod\"}",
"interval": "",
- "legendFormat": "Table Open Cache - {{pod}}",
+ "legendFormat": {{ `"Table Open Cache - {{pod}}"` }},
"refId": "B"
}
],
@@ -3345,14 +3346,14 @@
"exemplar": true,
"expr": "mysql_global_status_open_table_definitions{namespace=~\"$namespace\",service=~\"$app\",pod=~\"$pod\"}",
"interval": "",
- "legendFormat": "Open Table Definitions - {{pod}}",
+ "legendFormat": {{ `"Open Table Definitions - {{pod}}"` }},
"refId": "A"
},
{
"exemplar": true,
"expr": "mysql_global_variables_table_definition_cache{namespace=~\"$namespace\",service=~\"$app\",pod=~\"$pod\"}",
"interval": "",
- "legendFormat": "Table Definitions Cache Size - {{pod}}",
+ "legendFormat": {{ `"Table Definitions Cache Size - {{pod}}"` }},
"refId": "B"
},
{
@@ -3360,7 +3361,7 @@
"expr": "mysql_global_status_opened_table_definitions{namespace=~\"$namespace\",service=~\"$app\",pod=~\"$pod\"}",
"hide": false,
"interval": "",
- "legendFormat": "Opened Table Definitions - {{pod}}",
+ "legendFormat": {{ `"Opened Table Definitions - {{pod}}"` }},
"refId": "C"
}
],
@@ -3443,7 +3444,6 @@
"value": "demo"
},
"datasource": "${datasource}",
- "definition": "label_values(kube_namespace_labels,namespace)",
"description": null,
"error": null,
"hide": 0,
@@ -3452,7 +3452,13 @@
"multi": false,
"name": "namespace",
"options": [],
+ {{- if $shared }}
"query": "label_values(kube_namespace_labels,namespace)",
+ "type": "query",
+ {{- else }}
+ "query": {{ $.Values.app.namespace | quote }},
+ "type": "constant",
+ {{- end }}
"refresh": 1,
"regex": "",
"skipUrlSync": false,
@@ -3460,7 +3466,6 @@
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
- "type": "query",
"useTags": false
},
{
@@ -3471,7 +3476,6 @@
"value": "sample-perconaxtradb-stats"
},
"datasource": "${datasource}",
- "definition": "label_values(mysql_up{namespace=~\"$namespace\"}, service)",
"description": "",
"error": null,
"hide": 0,
@@ -3480,7 +3484,13 @@
"multi": false,
"name": "app",
"options": [],
+ {{- if $shared }}
"query": "label_values(mysql_up{namespace=~\"$namespace\"}, service)",
+ "type": "query",
+ {{- else }}
+ "query": {{ $.Values.app.name | quote }},
+ "type": "constant",
+ {{- end }}
"refresh": 1,
"regex": "",
"skipUrlSync": false,
@@ -3488,7 +3498,6 @@
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
- "type": "query",
"useTags": false
},
{
@@ -3532,7 +3541,11 @@
},
"timepicker": {},
"timezone": "",
+ {{- if $shared }}
"title": "KubeDB / PerconaXtraDB / Pod",
+ {{- else }}
+ "title": {{ printf "KubeDB / PerconaXtraDB / Pod / %s / %s" $.Values.app.namespace $.Values.app.name | quote }},
+ {{- end }}
"uid": "FktZiiOnz",
"version": 3
}
\ No newline at end of file
diff --git a/charts/kubedb-grafana-dashboards/dashboards/perconaxtradb/perconaxtradb-summary.json b/charts/kubedb-grafana-dashboards/dashboards/perconaxtradb/perconaxtradb-summary.json
index 583f86653..5f777211b 100644
--- a/charts/kubedb-grafana-dashboards/dashboards/perconaxtradb/perconaxtradb-summary.json
+++ b/charts/kubedb-grafana-dashboards/dashboards/perconaxtradb/perconaxtradb-summary.json
@@ -1,3 +1,4 @@
+{{- $shared := and (eq .Values.app.name "") (eq .Values.app.namespace "") -}}
{
"annotations": {
"list": [
@@ -121,7 +122,7 @@
"format": "table",
"instant": true,
"interval": "",
- "legendFormat": "{{phase}}",
+ "legendFormat": {{ `"{{phase}}"` }},
"refId": "A"
}
],
@@ -204,7 +205,7 @@
"instant": true,
"interval": "",
"intervalFactor": 1,
- "legendFormat": "{{ version }}",
+ "legendFormat": {{ `"{{version}}"` }},
"refId": "A"
}
],
@@ -283,7 +284,7 @@
"format": "time_series",
"instant": true,
"interval": "",
- "legendFormat": "{{requireSSL}}",
+ "legendFormat": {{ `"{{requireSSL}}"` }},
"refId": "A"
}
],
@@ -365,7 +366,7 @@
"format": "table",
"instant": true,
"interval": "",
- "legendFormat": "{{terminationPolicy}}",
+ "legendFormat": {{ `"{{terminationPolicy}}"` }},
"refId": "A"
}
],
@@ -794,7 +795,7 @@
"exemplar": true,
"expr": "sum(node_namespace_pod_container:container_cpu_usage_seconds_total:sum_irate{namespace=\"$namespace\", pod=~\"$app-\\\\d+$\"}) by (pod)",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -1197,7 +1198,7 @@
"exemplar": true,
"expr": "sum(node_namespace_pod_container:container_memory_working_set_bytes{namespace=\"$namespace\", pod=~\"$app-\\\\d+$\",container!=\"\"}) by (pod)",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -1704,7 +1705,7 @@
"exemplar": true,
"expr": "avg(container_blkio_device_usage_total{namespace=\"$namespace\", pod=~\"$app-\\\\d+$\"}) by (pod)",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -1803,7 +1804,7 @@
"instant": false,
"interval": "",
"intervalFactor": 1,
- "legendFormat": "{{pod}}-disk-write",
+ "legendFormat": {{ `"{{pod}}-disk-write"` }},
"refId": "A"
},
{
@@ -1812,7 +1813,7 @@
"hide": false,
"instant": false,
"interval": "",
- "legendFormat": "{{pod}}-disk-read",
+ "legendFormat": {{ `"{{pod}}-disk-read"` }},
"refId": "B"
}
],
@@ -1911,7 +1912,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"legendLink": null,
"refId": "A",
"step": 10
@@ -2012,7 +2013,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"legendLink": null,
"refId": "A",
"step": 10
@@ -2521,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"
}
],
@@ -2605,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"
}
],
@@ -2678,7 +2679,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"legendLink": null,
"refId": "A",
"step": 10
@@ -2779,7 +2780,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"legendLink": null,
"refId": "A",
"step": 10
@@ -2867,7 +2868,6 @@
"value": "demo"
},
"datasource": "${datasource}",
- "definition": "label_values(kube_namespace_labels,namespace)",
"description": null,
"error": null,
"hide": 0,
@@ -2876,10 +2876,16 @@
"multi": false,
"name": "namespace",
"options": [],
+ {{- if $shared }}
"query": {
"query": "label_values(kube_namespace_labels,namespace)",
"refId": "Prometheus-namespace-Variable-Query"
},
+ "type": "query",
+ {{- else }}
+ "query": {{ $.Values.app.namespace | quote }},
+ "type": "constant",
+ {{- end }}
"refresh": 1,
"regex": "",
"skipUrlSync": false,
@@ -2887,7 +2893,6 @@
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
- "type": "query",
"useTags": false
},
{
@@ -2898,7 +2903,6 @@
"value": "coreos-prom-px"
},
"datasource": "${datasource}",
- "definition": "label_values(kubedb_com_perconaxtradb_status_phase{namespace=~\"$namespace\"},app)",
"description": null,
"error": null,
"hide": 0,
@@ -2907,10 +2911,16 @@
"multi": false,
"name": "app",
"options": [],
+ {{- if $shared }}
"query": {
"query": "label_values(kubedb_com_perconaxtradb_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,
@@ -2918,7 +2928,6 @@
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
- "type": "query",
"useTags": false
}
]
@@ -2953,7 +2962,11 @@
]
},
"timezone": "",
+ {{- if $shared }}
"title": "KubeDB / PerconaXtraDB / Summary",
+ {{- else }}
+ "title": {{ printf "KubeDB / PerconaXtraDB / Summary / %s / %s" $.Values.app.namespace $.Values.app.name | quote }},
+ {{- end }}
"uid": "VnOgk2Hnkx",
"version": 2
}
\ No newline at end of file
diff --git a/charts/kubedb-grafana-dashboards/dashboards/postgres/postgres_databases_dashboard.json b/charts/kubedb-grafana-dashboards/dashboards/postgres/postgres_databases_dashboard.json
index a5c3588c6..848288bd7 100644
--- a/charts/kubedb-grafana-dashboards/dashboards/postgres/postgres_databases_dashboard.json
+++ b/charts/kubedb-grafana-dashboards/dashboards/postgres/postgres_databases_dashboard.json
@@ -1,3 +1,4 @@
+{{- $shared := and (eq .Values.app.name "") (eq .Values.app.namespace "") -}}
{
"annotations": {
"list": [
@@ -159,7 +160,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 1,
- "legendFormat": "{{datname}} commits",
+ "legendFormat": {{ `"{{datname}} commits"` }},
"refId": "A"
},
{
@@ -168,7 +169,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 1,
- "legendFormat": "{{datname}} rollbacks",
+ "legendFormat": {{ `"{{datname}} rollbacks"` }},
"refId": "B"
}
],
@@ -273,7 +274,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{datname}}",
+ "legendFormat": {{ `"{{datname}}"` }},
"refId": "A",
"step": 2
}
@@ -378,7 +379,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{datname}}, s: {{state}}",
+ "legendFormat": {{ `"{{datname}}, s: {{state}}"` }},
"refId": "A",
"step": 2
}
@@ -486,7 +487,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{datname}}",
+ "legendFormat": {{ `"{{datname}}"` }},
"refId": "A",
"step": 2
}
@@ -593,7 +594,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{datname}},{{mode}}",
+ "legendFormat": {{ `"{{datname}},{{mode}}"` }},
"refId": "A",
"step": 2
}
@@ -699,7 +700,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{datname}}",
+ "legendFormat": {{ `"{{datname}}"` }},
"refId": "A",
"step": 2
}
@@ -804,7 +805,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{datname}}, s: {{state}}",
+ "legendFormat": {{ `"{{datname}}, s: {{state}}"` }},
"refId": "A",
"step": 2
}
@@ -909,7 +910,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{datname}}",
+ "legendFormat": {{ `"{{datname}}"` }},
"refId": "A",
"step": 2
}
@@ -1014,7 +1015,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{datname}}",
+ "legendFormat": {{ `"{{datname}}"` }},
"refId": "A",
"step": 2
}
@@ -1254,7 +1255,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 1,
- "legendFormat": "{{datname}} conflicts",
+ "legendFormat": {{ `"{{datname}} conflicts"` }},
"refId": "B"
},
{
@@ -1263,7 +1264,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 1,
- "legendFormat": "{{datname}} deadlocks",
+ "legendFormat": {{ `"{{datname}} deadlocks"` }},
"refId": "A"
}
],
@@ -1365,7 +1366,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 1,
- "legendFormat": "{{ datname }}",
+ "legendFormat": {{ `"{{datname}}"` }},
"refId": "A"
}
],
@@ -1468,7 +1469,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 1,
- "legendFormat": "{{datname}}",
+ "legendFormat": {{ `"{{datname}}"` }},
"refId": "A"
}
],
@@ -1790,7 +1791,6 @@
"value": "demo"
},
"datasource": "${datasource}",
- "definition": "label_values(kube_namespace_labels,namespace)",
"description": null,
"error": null,
"hide": 0,
@@ -1799,7 +1799,13 @@
"multi": false,
"name": "namespace",
"options": [],
+ {{- if $shared }}
"query": "label_values(kube_namespace_labels,namespace)",
+ "type": "query",
+ {{- else }}
+ "query": {{ $.Values.app.namespace | quote }},
+ "type": "constant",
+ {{- end }}
"refresh": 1,
"regex": "",
"skipUrlSync": false,
@@ -1807,7 +1813,6 @@
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
- "type": "query",
"useTags": false
},
{
@@ -1818,7 +1823,6 @@
"value": "ps-demo"
},
"datasource": "${datasource}",
- "definition": "query_result(kubedb_com_postgres_created{namespace=\"$namespace\"})",
"description": null,
"error": null,
"hide": 0,
@@ -1827,7 +1831,13 @@
"multi": false,
"name": "app",
"options": [],
+ {{- if $shared }}
"query": "query_result(kubedb_com_postgres_created{namespace=\"$namespace\"})",
+ "type": "query",
+ {{- else }}
+ "query": {{ $.Values.app.name | quote }},
+ "type": "constant",
+ {{- end }}
"refresh": 1,
"regex": "/.*app=\"([^\"]+).*/",
"skipUrlSync": false,
@@ -1835,7 +1845,6 @@
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
- "type": "query",
"useTags": false
},
{
@@ -1930,7 +1939,11 @@
]
},
"timezone": "",
+ {{- if $shared }}
"title": "KubeDB / Postgres / Database",
+ {{- else }}
+ "title": {{ printf "KubeDB / Postgres / Database / %s / %s" $.Values.app.namespace $.Values.app.name | quote }},
+ {{- end }}
"uid": "6v_W_NNn_kl",
"version": 2
}
diff --git a/charts/kubedb-grafana-dashboards/dashboards/postgres/postgres_pods_dashboard.json b/charts/kubedb-grafana-dashboards/dashboards/postgres/postgres_pods_dashboard.json
index ff4a9b91a..9f8578cd1 100644
--- a/charts/kubedb-grafana-dashboards/dashboards/postgres/postgres_pods_dashboard.json
+++ b/charts/kubedb-grafana-dashboards/dashboards/postgres/postgres_pods_dashboard.json
@@ -1,3 +1,4 @@
+{{- $shared := and (eq .Values.app.name "") (eq .Values.app.namespace "") -}}
{
"annotations": {
"list": [
@@ -1585,7 +1586,6 @@
"value": "demo"
},
"datasource": "${datasource}",
- "definition": "label_values(kube_namespace_labels,namespace)",
"description": null,
"error": null,
"hide": 0,
@@ -1594,7 +1594,13 @@
"multi": false,
"name": "namespace",
"options": [],
+ {{- if $shared }}
"query": "label_values(kube_namespace_labels,namespace)",
+ "type": "query",
+ {{- else }}
+ "query": {{ $.Values.app.namespace | quote }},
+ "type": "constant",
+ {{- end }}
"refresh": 1,
"regex": "",
"skipUrlSync": false,
@@ -1602,7 +1608,6 @@
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
- "type": "query",
"useTags": false
},
{
@@ -1613,7 +1618,6 @@
"value": "ps-demo"
},
"datasource": "${datasource}",
- "definition": "query_result(kubedb_com_postgres_created{namespace=\"$namespace\"})",
"description": null,
"error": null,
"hide": 0,
@@ -1622,7 +1626,13 @@
"multi": false,
"name": "app",
"options": [],
+ {{- if $shared }}
"query": "query_result(kubedb_com_postgres_created{namespace=\"$namespace\"})",
+ "type": "query",
+ {{- else }}
+ "query": {{ $.Values.app.name | quote }},
+ "type": "constant",
+ {{- end }}
"refresh": 1,
"regex": "/.*app=\"([^\"]+).*/",
"skipUrlSync": false,
@@ -1630,7 +1640,6 @@
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
- "type": "query",
"useTags": false
},
{
@@ -1693,7 +1702,11 @@
]
},
"timezone": "",
+ {{- if $shared }}
"title": "KubeDB / Postgres / Pod",
+ {{- else }}
+ "title": {{ printf "KubeDB / Postgres / Pod / %s / %s" $.Values.app.namespace $.Values.app.name | quote }},
+ {{- end }}
"uid": "IgXOThN7ztest",
"version": 2
}
diff --git a/charts/kubedb-grafana-dashboards/dashboards/postgres/postgres_summary_dashboard.json b/charts/kubedb-grafana-dashboards/dashboards/postgres/postgres_summary_dashboard.json
index 40b51ee0f..f0709c279 100644
--- a/charts/kubedb-grafana-dashboards/dashboards/postgres/postgres_summary_dashboard.json
+++ b/charts/kubedb-grafana-dashboards/dashboards/postgres/postgres_summary_dashboard.json
@@ -1,3 +1,4 @@
+{{- $shared := and (eq .Values.app.name "") (eq .Values.app.namespace "") -}}
{
"annotations": {
"list": [
@@ -99,7 +100,7 @@
"instant": true,
"interval": "",
"intervalFactor": 1,
- "legendFormat": "{{version}}",
+ "legendFormat": {{ `"{{version}}"` }},
"refId": "A"
}
],
@@ -308,7 +309,7 @@
"format": "table",
"instant": true,
"interval": "",
- "legendFormat": "{{phase}}",
+ "legendFormat": {{ `"{{phase}}"` }},
"refId": "A"
}
],
@@ -376,7 +377,7 @@
"format": "table",
"instant": true,
"interval": "",
- "legendFormat": "{{sslMode}}",
+ "legendFormat": {{ `"{{sslMode}}"` }},
"refId": "A"
}
],
@@ -456,7 +457,7 @@
"format": "table",
"instant": true,
"interval": "",
- "legendFormat": "{{terminationPolicy}}",
+ "legendFormat": {{ `"{{terminationPolicy}}"` }},
"refId": "A"
}
],
@@ -880,7 +881,7 @@
"expr": "AVG(rate(pg_stat_replication_reply_time{namespace=\"$namespace\", pod=~\"$app-\\\\d+$\"}[5m])) by (pod)",
"instant": false,
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -987,7 +988,7 @@
"expr": "sum(pg_stat_activity_count{namespace=\"$namespace\",pod=~\"$app-\\\\d+$\"}) by (state)",
"instant": false,
"interval": "",
- "legendFormat": "{{state}}",
+ "legendFormat": {{ `"{{state}}"` }},
"refId": "A"
}
],
@@ -1187,7 +1188,7 @@
"exemplar": false,
"expr": "sum(node_namespace_pod_container:container_cpu_usage_seconds_total:sum_irate{namespace=\"$namespace\", pod=~\"$app-\\\\d+$\"}) by (pod)",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -1595,7 +1596,7 @@
"exemplar": false,
"expr": "sum(node_namespace_pod_container:container_memory_working_set_bytes{namespace=\"$namespace\", pod=~\"$app-\\\\d+$\",container!=\"\"}) by (pod)",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -2107,7 +2108,7 @@
"exemplar": false,
"expr": "avg(container_blkio_device_usage_total{namespace=\"$namespace\", pod=~\"$app-\\\\d+$\"}) by (pod)",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -2217,7 +2218,7 @@
"instant": false,
"interval": "",
"intervalFactor": 1,
- "legendFormat": "{{pod}}-disk-write",
+ "legendFormat": {{ `"{{pod}}-disk-write"` }},
"refId": "A"
},
{
@@ -2226,7 +2227,7 @@
"hide": false,
"instant": false,
"interval": "",
- "legendFormat": "{{pod}}-disk-read",
+ "legendFormat": {{ `"{{pod}}-disk-read"` }},
"refId": "B"
}
],
@@ -2336,7 +2337,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"legendLink": null,
"refId": "A",
"step": 10
@@ -2448,7 +2449,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"legendLink": null,
"refId": "A",
"step": 10
@@ -2957,7 +2958,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"
}
],
@@ -3041,7 +3042,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"
}
],
@@ -3127,7 +3128,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"legendLink": null,
"refId": "A",
"step": 10
@@ -3239,7 +3240,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"legendLink": null,
"refId": "A",
"step": 10
@@ -3326,7 +3327,6 @@
"value": "demo"
},
"datasource": "${datasource}",
- "definition": "label_values(kube_namespace_labels,namespace)",
"description": null,
"error": null,
"hide": 0,
@@ -3335,10 +3335,16 @@
"multi": false,
"name": "namespace",
"options": [],
+ {{- if $shared }}
"query": {
"query": "label_values(kube_namespace_labels,namespace)",
"refId": "Prometheus-namespace-Variable-Query"
},
+ "type": "query",
+ {{- else }}
+ "query": {{ $.Values.app.namespace | quote }},
+ "type": "constant",
+ {{- end }}
"refresh": 1,
"regex": "",
"skipUrlSync": false,
@@ -3346,7 +3352,6 @@
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
- "type": "query",
"useTags": false
},
{
@@ -3357,7 +3362,6 @@
"value": "coreos-prom-postgres"
},
"datasource": "${datasource}",
- "definition": "query_result(kubedb_com_postgres_created{namespace=\"$namespace\"})",
"description": null,
"error": null,
"hide": 0,
@@ -3366,10 +3370,16 @@
"multi": false,
"name": "app",
"options": [],
+ {{- if $shared }}
"query": {
"query": "query_result(kubedb_com_postgres_created{namespace=\"$namespace\"})",
"refId": "Prometheus-app-Variable-Query"
},
+ "type": "query",
+ {{- else }}
+ "query": {{ $.Values.app.name | quote }},
+ "type": "constant",
+ {{- end }}
"refresh": 1,
"regex": "/.*app=\"([^\"]+).*/",
"skipUrlSync": false,
@@ -3377,7 +3387,6 @@
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
- "type": "query",
"useTags": false
}
]
@@ -3412,7 +3421,11 @@
]
},
"timezone": "",
+ {{- if $shared }}
"title": "KubeDB / Postgres / Summary",
+ {{- else }}
+ "title": {{ printf "KubeDB / Postgres / Summary / %s / %s" $.Values.app.namespace $.Values.app.name | quote }},
+ {{- end }}
"uid": "VnOgk2Hnky",
"version": 2
}
diff --git a/charts/kubedb-grafana-dashboards/dashboards/proxysql/proxysql-database.json b/charts/kubedb-grafana-dashboards/dashboards/proxysql/proxysql-database.json
index 284d36642..0dffe30a4 100644
--- a/charts/kubedb-grafana-dashboards/dashboards/proxysql/proxysql-database.json
+++ b/charts/kubedb-grafana-dashboards/dashboards/proxysql/proxysql-database.json
@@ -1,3 +1,4 @@
+{{- $shared := and (eq .Values.app.name "") (eq .Values.app.namespace "") -}}
{
"annotations": {
"list": [
@@ -130,7 +131,7 @@
"instant": true,
"interval": "",
"intervalFactor": 1,
- "legendFormat": "{{ pod }}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -234,7 +235,7 @@
"format": "table",
"instant": true,
"interval": "",
- "legendFormat": "{{ pod }}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -326,7 +327,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 1,
- "legendFormat": "Free_connecntions - {{ pod }}",
+ "legendFormat": {{ `"Free_connecntions - {{ pod }}"` }},
"refId": "A"
},
{
@@ -335,7 +336,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 1,
- "legendFormat": "Used_connections - {{ pod }}",
+ "legendFormat": {{ `"Used_connections - {{ pod }}"` }},
"refId": "B"
}
],
@@ -441,7 +442,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 1,
- "legendFormat": "received - {{ pod }}",
+ "legendFormat": {{ `"received - {{ pod }}"` }},
"refId": "A"
},
{
@@ -450,7 +451,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 1,
- "legendFormat": "sent - {{ pod }}",
+ "legendFormat": {{ `"sent - {{ pod }}"` }},
"refId": "B"
}
],
@@ -549,7 +550,7 @@
"exemplar": true,
"expr": "rate(proxysql_slow_queries_total{namespace=~\"$namespace\",service=~\"$app\"}[1m])",
"interval": "",
- "legendFormat": "Slow Queries on {{ pod }}",
+ "legendFormat": {{ `"Slow Queries on {{ pod }}"` }},
"refId": "A"
}
],
@@ -646,14 +647,14 @@
"exemplar": true,
"expr": "rate(proxysql_server_connections_total{namespace=~\"$namespace\",service=~\"$app\",status=\"aborted\"}[5m])",
"interval": "",
- "legendFormat": "Aborted Connects (attempts) on - {{ pod }}",
+ "legendFormat": {{ `"Aborted Connects (attempts) on - {{ pod }}"` }},
"refId": "A"
},
{
"exemplar": true,
"expr": "rate(proxysql_server_connections_total{namespace=~\"$namespace\",service=~\"$app\",status=\"aborted\"}[5m])",
"interval": "",
- "legendFormat": "Aborted Clients (timeout) on - {{ pod }}",
+ "legendFormat": {{ `"Aborted Clients (timeout) on - {{ pod }}"` }},
"refId": "B"
}
],
@@ -764,7 +765,7 @@
"exemplar": true,
"expr": "rate(proxysql_questions_total{namespace=~\"$namespace\",service=\"$app\"}[1m])",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -858,7 +859,7 @@
"exemplar": true,
"expr": "rate(proxysql_slow_queries_total{namespace=~\"$namespace\",service=\"$app\"}[1m])",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -952,7 +953,7 @@
"exemplar": true,
"expr": "rate(proxysql_gtid_session_collected_total{namespace=~\"$namespace\",service=\"$app\"}[1m])",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -1046,7 +1047,7 @@
"exemplar": true,
"expr": "rate(proxysql_gtid_consistent_queries_total{namespace=~\"$namespace\",service=\"$app\"}[1m])",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -1140,7 +1141,7 @@
"exemplar": true,
"expr": "rate(proxysql_generated_error_packets_total{namespace=~\"$namespace\",service=\"$app\"}[1m])",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -1234,7 +1235,7 @@
"exemplar": true,
"expr": "rate(proxysql_backend_lagging_during_query_total{namespace=~\"$namespace\",service=\"$app\"}[1m])",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -1328,7 +1329,7 @@
"exemplar": true,
"expr": "rate(proxysql_backend_offline_during_query_total{namespace=~\"$namespace\",service=\"$app\"}[1m])",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -1437,7 +1438,7 @@
"exemplar": true,
"expr": "rate(proxysql_query_cache_count_get_total{namespace=~\"$namespace\",service=\"$app\"}[5m]) ",
"interval": "",
- "legendFormat": "{{pod}}:{{status}}",
+ "legendFormat": {{ `"{{pod}}:{{status}}"` }},
"refId": "A"
}
],
@@ -1531,7 +1532,7 @@
"exemplar": true,
"expr": "rate(proxysql_query_cache_count_set_total{namespace=~\"$namespace\",service=\"$app\"}[5m]) ",
"interval": "",
- "legendFormat": "{{pod}}:{{status}}",
+ "legendFormat": {{ `"{{pod}}:{{status}}"` }},
"refId": "A"
}
],
@@ -1625,7 +1626,7 @@
"exemplar": true,
"expr": "rate(proxysql_query_cache_bytes_total{namespace=~\"$namespace\",service=\"$app\"}[5m]) ",
"interval": "",
- "legendFormat": "{{pod}}:{{op}}",
+ "legendFormat": {{ `"{{pod}}:{{op}}"` }},
"refId": "A"
}
],
@@ -1719,7 +1720,7 @@
"exemplar": true,
"expr": "rate(proxysql_query_cache_memory_bytes{namespace=~\"$namespace\",service=\"$app\"}[5m]) ",
"interval": "",
- "legendFormat": "{{pod}}:{{op}}",
+ "legendFormat": {{ `"{{pod}}:{{op}}"` }},
"refId": "A"
}
],
@@ -1813,7 +1814,7 @@
"exemplar": true,
"expr": "rate(proxysql_query_cache_entries_total{namespace=~\"$namespace\",service=\"$app\"}[5m]) ",
"interval": "",
- "legendFormat": "{{pod}}:{{op}}",
+ "legendFormat": {{ `"{{pod}}:{{op}}"` }},
"refId": "A"
}
],
@@ -1907,7 +1908,7 @@
"exemplar": true,
"expr": "rate(proxysql_query_cache_purged_total{namespace=~\"$namespace\",service=\"$app\"}[5m]) ",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -2016,7 +2017,7 @@
"exemplar": true,
"expr": "rate(proxysql_mysql_unexpected_frontend_com_quit_total{namespace=~\"$namespace\",service=\"$app\"}[1m])",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -2110,7 +2111,7 @@
"exemplar": true,
"expr": "rate(proxysql_mysql_unexpected_frontend_packets_total{namespace=~\"$namespace\",service=\"$app\"}[1m])",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -2204,7 +2205,7 @@
"exemplar": true,
"expr": "rate(proxysql_automatic_detected_sql_injection_total{namespace=~\"$namespace\",service=\"$app\"}[1m])",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -2313,7 +2314,7 @@
"exemplar": true,
"expr": "sum(rate(proxysql_cluster_pulled_total{namespace=~\"$namespace\",service=\"$app\",module_name=~\"mysql_variables|admin_variables|proxysql_servers|mysql_servers\"}[1m])) by(module_name,status)",
"interval": "",
- "legendFormat": "{{module_name}} : {{status}}",
+ "legendFormat": {{ `"{{module_name}} : {{status}}"` }},
"refId": "A"
}
],
@@ -2407,7 +2408,7 @@
"exemplar": true,
"expr": "sum(rate(proxysql_cluster_syn_conflict_total{namespace=~\"$namespace\",service=\"$app\",module_name=~\"mysql_variables|admin_variables|proxysql_servers|mysql_servers\"}[1m])) by(module_name)",
"interval": "",
- "legendFormat": "{{module_name}}",
+ "legendFormat": {{ `"{{module_name}}"` }},
"refId": "A"
}
],
@@ -2516,7 +2517,7 @@
"exemplar": true,
"expr": "sum(rate(proxysql_server_connections_total{namespace=~\"$namespace\",service=\"$app\"}[1m])) by(status)",
"interval": "",
- "legendFormat": "{{status}}",
+ "legendFormat": {{ `"{{status}}"` }},
"refId": "A"
}
],
@@ -2610,7 +2611,7 @@
"exemplar": true,
"expr": "sum(rate(proxysql_client_connections_total{namespace=~\"$namespace\",service=\"$app\"}[1m])) by(status)",
"interval": "",
- "legendFormat": "{{status}}",
+ "legendFormat": {{ `"{{status}}"` }},
"refId": "A"
}
],
@@ -2704,7 +2705,7 @@
"exemplar": true,
"expr": "rate(proxysql_server_connections_connected{namespace=~\"$namespace\",service=\"$app\"}[1m])",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -2798,7 +2799,7 @@
"exemplar": true,
"expr": "rate(proxysql_client_connections_connected{namespace=~\"$namespace\",service=\"$app\"}[1m])",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -2892,7 +2893,7 @@
"exemplar": true,
"expr": "proxysql_connpool_conns_latency_us{namespace=~\"$namespace\",service=\"$app\",hostgroup=\"3\"}",
"interval": "",
- "legendFormat": "{{pod}}:{{endpoint}}",
+ "legendFormat": {{ `"{{pod}}:{{endpoint}}"` }},
"refId": "A"
}
],
@@ -2986,7 +2987,7 @@
"exemplar": true,
"expr": "proxysql_connpool_conns_latency_us{namespace=~\"$namespace\",service=\"$app\",hostgroup=\"2\"}",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -3083,7 +3084,7 @@
"expr": "proxysql_connpool_conns_status{namespace=~\"$namespace\",service=\"$app\",hostgroup=\"3\"}",
"instant": false,
"interval": "",
- "legendFormat": "{{pod}} : {{endpoint}}",
+ "legendFormat": {{ `"{{pod}} : {{endpoint}}"` }},
"refId": "A"
}
],
@@ -3180,7 +3181,7 @@
"expr": "proxysql_connpool_conns_status{namespace=~\"$namespace\",service=\"$app\",hostgroup=\"2\"}",
"instant": false,
"interval": "",
- "legendFormat": "{{pod}} : {{endpoint}}",
+ "legendFormat": {{ `"{{pod}} : {{endpoint}}"` }},
"refId": "A"
}
],
@@ -3277,7 +3278,7 @@
"expr": "sum(proxysql_connpool_conns{namespace=~\"$namespace\",service=\"$app\",hostgroup=\"3\"}) by(status,pod)",
"instant": false,
"interval": "",
- "legendFormat": "{{pod}} : {{status}}",
+ "legendFormat": {{ `"{{pod}} : {{status}}"` }},
"refId": "A"
}
],
@@ -3374,7 +3375,7 @@
"expr": "sum(proxysql_connpool_conns{namespace=~\"$namespace\",service=\"$app\",hostgroup=\"2\"}) by(status,pod)",
"instant": false,
"interval": "",
- "legendFormat": "{{pod}} : {{status}}",
+ "legendFormat": {{ `"{{pod}} : {{status}}"` }},
"refId": "A"
}
],
@@ -3471,7 +3472,7 @@
"expr": "proxysql_active_transactions{namespace=~\"$namespace\",service=\"$app\"}",
"instant": false,
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -3568,7 +3569,7 @@
"expr": "proxysql_client_connections_non_idle{namespace=~\"$namespace\",service=\"$app\"}",
"instant": false,
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -3665,7 +3666,7 @@
"expr": "proxysql_mysql_thread_workers{namespace=~\"$namespace\",service=\"$app\"}",
"instant": false,
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -3762,7 +3763,7 @@
"expr": "rate(proxysql_mysql_session_internal_bytes{namespace=~\"$namespace\",service=\"$app\"}[1m])",
"instant": false,
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -3859,7 +3860,7 @@
"expr": "rate(proxysql_connpool_memory_bytes{namespace=~\"$namespace\",service=\"$app\"}[1m])",
"instant": false,
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -3956,7 +3957,7 @@
"expr": "sum(rate(proxysql_connpool_data_bytes_total{namespace=~\"$namespace\",service=\"$app\"}[1m])) by(hostgroup,traffic_flow)",
"instant": false,
"interval": "",
- "legendFormat": "HG {{hostgroup}} : Data {{traffic_flow}}",
+ "legendFormat": {{ `"HG {{hostgroup}} : Data {{traffic_flow}}"` }},
"refId": "A"
}
],
@@ -4053,7 +4054,7 @@
"expr": "sum(rate(proxysql_connpool_conns_total{namespace=~\"$namespace\",service=\"$app\"}[1m])) by(hostgroup)",
"instant": false,
"interval": "",
- "legendFormat": "HG {{hostgroup}} ",
+ "legendFormat": {{ `"HG {{hostgroup}} "` }},
"refId": "A"
}
],
@@ -4150,7 +4151,7 @@
"expr": "sum(rate(proxysql_connpool_conns_queries_total{namespace=~\"$namespace\",service=\"$app\"}[1m])) by(hostgroup)",
"instant": false,
"interval": "",
- "legendFormat": "HG {{hostgroup}} ",
+ "legendFormat": {{ `"HG {{hostgroup}}"` }},
"refId": "A"
}
],
@@ -4259,7 +4260,7 @@
"exemplar": true,
"expr": "rate(proxysql_myhgm_myconnpool_get_total{namespace=~\"$namespace\",service=\"$app\"}[5m])",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -4353,7 +4354,7 @@
"exemplar": true,
"expr": "rate(proxysql_myhgm_myconnpool_get_ok_total{namespace=~\"$namespace\",service=\"$app\"}[5m])",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -4447,7 +4448,7 @@
"exemplar": true,
"expr": "rate(proxysql_myhgm_myconnpool_get_ping_total{namespace=~\"$namespace\",service=\"$app\"}[5m])",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -4541,7 +4542,7 @@
"exemplar": true,
"expr": "rate(proxysql_myhgm_myconnpool_push_total{namespace=~\"$namespace\",service=\"$app\"}[5m])",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -4635,7 +4636,7 @@
"exemplar": true,
"expr": "rate(proxysql_myhgm_myconnpool_reset_total{namespace=~\"$namespace\",service=\"$app\"}[5m])",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -4729,7 +4730,7 @@
"exemplar": true,
"expr": "rate(proxysql_myhgm_myconnpool_destroy_total{namespace=~\"$namespace\",service=\"$app\"}[5m])",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -4823,7 +4824,7 @@
"exemplar": true,
"expr": "rate(proxysql_myhgm_auto_increment_multiplex_total{namespace=~\"$namespace\",service=\"$app\"}[5m])",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -4932,7 +4933,7 @@
"exemplar": true,
"expr": "rate(proxysql_access_denied_wrong_password_total{namespace=~\"$namespace\",service=\"$app\"}[1m])",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -5026,7 +5027,7 @@
"exemplar": true,
"expr": "rate(proxysql_access_denied_max_connections_total{namespace=~\"$namespace\",service=\"$app\"}[1m])",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -5120,7 +5121,7 @@
"exemplar": true,
"expr": "rate(proxysql_access_denied_max_user_connections_total{namespace=~\"$namespace\",service=\"$app\"}[1m])",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -5229,7 +5230,7 @@
"exemplar": true,
"expr": "rate(proxysql_stack_memory_mysql_threads_bytes{namespace=~\"$namespace\",service=\"$app\"}[1m])",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -5323,7 +5324,7 @@
"exemplar": true,
"expr": "rate(proxysql_stack_memory_admin_threads_bytes{namespace=~\"$namespace\",service=\"$app\"}[1m])",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -5417,7 +5418,7 @@
"exemplar": true,
"expr": "rate(proxysql_stack_memory_cluster_threads{namespace=~\"$namespace\",service=\"$app\"}[1m])",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -5526,7 +5527,7 @@
"exemplar": true,
"expr": "rate(proxysql_stmt_client_active{namespace=~\"$namespace\",service=\"$app\"}[1m])",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -5620,7 +5621,7 @@
"exemplar": true,
"expr": "rate(proxysql_stmt_client_active_unique{namespace=~\"$namespace\",service=\"$app\"}[1m])",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -5714,7 +5715,7 @@
"exemplar": true,
"expr": "rate(proxysql_stmt_server_active{namespace=~\"$namespace\",service=\"$app\"}[1m])",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -5808,7 +5809,7 @@
"exemplar": true,
"expr": "rate(proxysql_stmt_server_active_unique{namespace=~\"$namespace\",service=\"$app\"}[1m])",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -5902,7 +5903,7 @@
"exemplar": true,
"expr": "rate(proxysql_stmt_max_stmt_id{namespace=~\"$namespace\",service=\"$app\"}[1m])",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -5996,7 +5997,7 @@
"exemplar": true,
"expr": "rate(proxysql_stmt_cached{namespace=~\"$namespace\",service=\"$app\"}[1m])",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -6090,7 +6091,7 @@
"exemplar": true,
"expr": "sum(rate(proxysql_com_backend_stmt_total{namespace=~\"$namespace\",service=\"$app\"}[1m])) by(op)",
"interval": "",
- "legendFormat": "{{op}}",
+ "legendFormat": {{ `"{{op}}"` }},
"refId": "A"
}
],
@@ -6184,7 +6185,7 @@
"exemplar": true,
"expr": "sum(rate(proxysql_com_frontend_stmt_total{namespace=~\"$namespace\",service=\"$app\"}[1m])) by(op)",
"interval": "",
- "legendFormat": "{{op}}",
+ "legendFormat": {{ `"{{op}}"` }},
"refId": "A"
}
],
@@ -6293,7 +6294,7 @@
"exemplar": true,
"expr": "rate(proxysql_mysql_firewall_users_table_bytes{namespace=~\"$namespace\",service=\"$app\"}[1m])",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -6387,7 +6388,7 @@
"exemplar": true,
"expr": "rate(proxysql_mysql_firewall_users_config_bytes{namespace=~\"$namespace\",service=\"$app\"}[1m])",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -6481,7 +6482,7 @@
"exemplar": true,
"expr": "rate(proxysql_mysql_firewall_rules_table_bytes{namespace=~\"$namespace\",service=\"$app\"}[1m])",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -6575,7 +6576,7 @@
"exemplar": true,
"expr": "rate(proxysql_mysql_firewall_rules_config_bytes{namespace=~\"$namespace\",service=\"$app\"}[1m])",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -6726,7 +6727,7 @@
"instant": false,
"interval": "",
"intervalFactor": 1,
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -6863,7 +6864,7 @@
"instant": false,
"interval": "",
"intervalFactor": 1,
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -6987,7 +6988,7 @@
"format": "time_series",
"instant": false,
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -7111,7 +7112,7 @@
"format": "time_series",
"instant": false,
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -7267,7 +7268,7 @@
"format": "time_series",
"instant": false,
"interval": "",
- "legendFormat": "{{pod}} ",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -7423,7 +7424,7 @@
"format": "time_series",
"instant": false,
"interval": "",
- "legendFormat": "{{pod}} ",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -7522,7 +7523,7 @@
"format": "time_series",
"instant": false,
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -7658,7 +7659,7 @@
"format": "time_series",
"instant": false,
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -7744,7 +7745,6 @@
"value": "demo"
},
"datasource": "${datasource}",
- "definition": "label_values(kube_namespace_labels,namespace)",
"description": null,
"error": null,
"hide": 0,
@@ -7753,10 +7753,16 @@
"multi": false,
"name": "namespace",
"options": [],
+ {{- if $shared }}
"query": {
"query": "label_values(kube_namespace_labels,namespace)",
"refId": "StandardVariableQuery"
},
+ "type": "query",
+ {{- else }}
+ "query": {{ $.Values.app.namespace | quote }},
+ "type": "constant",
+ {{- end }}
"refresh": 1,
"regex": "",
"skipUrlSync": false,
@@ -7764,7 +7770,6 @@
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
- "type": "query",
"useTags": false
},
{
@@ -7775,7 +7780,6 @@
"value": "proxy-server-stats"
},
"datasource": "${datasource}",
- "definition": "label_values(proxysql_uptime_seconds_total{namespace=~\"$namespace\"}, service)",
"description": null,
"error": null,
"hide": 0,
@@ -7784,10 +7788,16 @@
"multi": false,
"name": "app",
"options": [],
+ {{- if $shared }}
"query": {
"query": "label_values(proxysql_uptime_seconds_total{namespace=~\"$namespace\"}, service)",
"refId": "StandardVariableQuery"
},
+ "type": "query",
+ {{- else }}
+ "query": {{ $.Values.app.name | quote }},
+ "type": "constant",
+ {{- end }}
"refresh": 1,
"regex": "",
"skipUrlSync": false,
@@ -7795,7 +7805,6 @@
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
- "type": "query",
"useTags": false
}
]
@@ -7806,7 +7815,11 @@
},
"timepicker": {},
"timezone": "",
+ {{- if $shared }}
"title": "KubeDB / ProxySQL / Database",
+ {{- else }}
+ "title": {{ printf "KubeDB / ProxySQL / Database / %s / %s" $.Values.app.namespace $.Values.app.name | quote }},
+ {{- end }}
"uid": "ohrahgv7T",
"version": 10
}
diff --git a/charts/kubedb-grafana-dashboards/dashboards/proxysql/proxysql-pod.json b/charts/kubedb-grafana-dashboards/dashboards/proxysql/proxysql-pod.json
index 9906a0411..beb383fdc 100644
--- a/charts/kubedb-grafana-dashboards/dashboards/proxysql/proxysql-pod.json
+++ b/charts/kubedb-grafana-dashboards/dashboards/proxysql/proxysql-pod.json
@@ -1,3 +1,4 @@
+{{- $shared := and (eq .Values.app.name "") (eq .Values.app.namespace "") -}}
{
"annotations": {
"list": [
@@ -82,7 +83,7 @@
"exemplar": true,
"expr": "proxysql_uptime_seconds_total{namespace=~\"$namespace\",service=~\"$app\",pod=~\"$pod\"}",
"interval": "",
- "legendFormat": "{{pod}} ",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -157,7 +158,7 @@
"format": "time_series",
"instant": false,
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -230,7 +231,7 @@
"exemplar": true,
"expr": "sum(rate(container_cpu_usage_seconds_total{namespace=~\"$namespace\", pod=~\"$pod\", container!=\"\", image!=\"\"}[5m])) by (pod)",
"interval": "",
- "legendFormat": "{{container}}",
+ "legendFormat": {{ `"{{container}}"` }},
"refId": "A"
}
],
@@ -327,7 +328,7 @@
"exemplar": true,
"expr": "sum(container_memory_working_set_bytes{namespace=~\"$namespace\", pod=~\"$pod\", container!=\"\", image!=\"\"}) by (pod)",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -437,7 +438,7 @@
"exemplar": true,
"expr": "proxysql_connpool_conns{status=\"used\",namespace=~\"$namespace\",service=~\"$app\",pod=~\"$pod\"}",
"interval": "",
- "legendFormat": "Used Connects - {{pod}}",
+ "legendFormat": {{ `"Used Connects - {{pod}}"` }},
"refId": "A"
},
{
@@ -445,7 +446,7 @@
"expr": "proxysql_connpool_conns{status=\"free\",namespace=~\"$namespace\",service=~\"$app\",pod=~\"$pod\"}",
"hide": false,
"interval": "",
- "legendFormat": "Free Connects - {{pod}}",
+ "legendFormat": {{ `"Free Connects - {{pod}}"` }},
"refId": "B"
}
],
@@ -542,7 +543,7 @@
"exemplar": true,
"expr": "proxysql_server_connections_total{ status=\"aborted\",namespace=~\"$namespace\",service=~\"$app\",pod=~\"$pod\"}",
"interval": "",
- "legendFormat": "Aborted Connects - {{pod}}",
+ "legendFormat": {{ `"Aborted Connects - {{pod}}"` }},
"refId": "A"
}
],
@@ -654,7 +655,7 @@
"exemplar": true,
"expr": "proxysql_slow_queries_total{namespace=~\"$namespace\",service=~\"$app\",pod=~\"$pod\"}",
"interval": "",
- "legendFormat": "Slow Queries - {{pod}}",
+ "legendFormat": {{ `"Slow Queries - {{pod}}"` }},
"refId": "A"
}
],
@@ -765,7 +766,7 @@
"exemplar": true,
"expr": "rate(proxysql_questions_total{namespace=~\"$namespace\",service=~\"$app\",pod=~\"$pod\"}[5m])",
"interval": "",
- "legendFormat": "Questions - {{pod}}",
+ "legendFormat": {{ `"Questions - {{pod}}"` }},
"refId": "A"
}
],
@@ -893,7 +894,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 1,
- "legendFormat": "Inbound - {{pod}} from {{endpoint}}",
+ "legendFormat": {{ `"Inbound - {{pod}} from {{endpoint}}"` }},
"metric": "",
"refId": "A",
"step": 20
@@ -907,7 +908,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 1,
- "legendFormat": "Outbound - {{pod}} to {{endpoint}}",
+ "legendFormat": {{ `"Outbound - {{pod}} to {{endpoint}}"` }},
"metric": "",
"refId": "B",
"step": 20
@@ -1023,7 +1024,7 @@
"exemplar": true,
"expr": "rate(proxysql_query_cache_memory_bytes{namespace=~\"$namespace\",service=~\"$app\",pod=~\"$pod\"}[5m])",
"interval": "",
- "legendFormat": "Query Cache Size - {{pod}}",
+ "legendFormat": {{ `"Query Cache Size - {{pod}}"` }},
"refId": "A"
}
],
@@ -1123,7 +1124,7 @@
"exemplar": true,
"expr": "rate(proxysql_query_cache_count_get_total{namespace=~\"$namespace\",service=~\"$app\",pod=~\"$pod\"}[5m])",
"interval": "",
- "legendFormat": "Get-Total - {{pod}}",
+ "legendFormat": {{ `"Get-Total - {{pod}}"` }},
"refId": "A"
},
{
@@ -1131,7 +1132,7 @@
"expr": "rate(proxysql_query_cache_count_set_total{namespace=~\"$namespace\",service=~\"$app\",pod=~\"$pod\"}[5m])",
"hide": false,
"interval": "",
- "legendFormat": "Set-Total - {{pod}}",
+ "legendFormat": {{ `"Set-Total - {{pod}}"` }},
"refId": "B"
},
{
@@ -1139,7 +1140,7 @@
"expr": "rate(proxysql_query_cache_bytes_total{op=\"read\",namespace=~\"$namespace\",service=~\"$app\",pod=~\"$pod\"}[5m])",
"hide": false,
"interval": "",
- "legendFormat": "Read - {{pod}}",
+ "legendFormat": {{ `"Read - {{pod}}"` }},
"refId": "D"
},
{
@@ -1147,7 +1148,7 @@
"expr": "rate(proxysql_query_cache_bytes_total{op=\"written\",namespace=~\"$namespace\",service=~\"$app\",pod=~\"$pod\"}[5m])",
"hide": false,
"interval": "",
- "legendFormat": "Write - {{pod}}",
+ "legendFormat": {{ `"Write - {{pod}}"` }},
"refId": "E"
},
{
@@ -1155,7 +1156,7 @@
"expr": "rate(proxysql_query_cache_purged_total{namespace=~\"$namespace\",service=~\"$app\",pod=~\"$pod\"}[5m])",
"hide": false,
"interval": "",
- "legendFormat": "Purged - {{pod}}",
+ "legendFormat": {{ `"Purged - {{pod}}"` }},
"refId": "C"
}
],
@@ -1238,7 +1239,6 @@
"value": "demo"
},
"datasource": "${datasource}",
- "definition": "label_values(kube_namespace_labels,namespace)",
"description": null,
"error": null,
"hide": 0,
@@ -1247,10 +1247,16 @@
"multi": false,
"name": "namespace",
"options": [],
+ {{- if $shared }}
"query": {
"query": "label_values(kube_namespace_labels,namespace)",
"refId": "Prometheus-namespace-Variable-Query"
},
+ "type": "query",
+ {{- else }}
+ "query": {{ $.Values.app.namespace | quote }},
+ "type": "constant",
+ {{- end }}
"refresh": 1,
"regex": "",
"skipUrlSync": false,
@@ -1258,7 +1264,6 @@
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
- "type": "query",
"useTags": false
},
{
@@ -1269,7 +1274,6 @@
"value": "proxy-mysql-stats"
},
"datasource": "${datasource}",
- "definition": "label_values(proxysql_uptime_seconds_total{namespace=~\"$namespace\"}, service)",
"description": "",
"error": null,
"hide": 0,
@@ -1278,10 +1282,16 @@
"multi": false,
"name": "app",
"options": [],
+ {{- if $shared }}
"query": {
"query": "label_values(proxysql_uptime_seconds_total{namespace=~\"$namespace\"}, service)",
"refId": "StandardVariableQuery"
},
+ "type": "query",
+ {{- else }}
+ "query": {{ $.Values.app.name | quote }},
+ "type": "constant",
+ {{- end }}
"refresh": 1,
"regex": "",
"skipUrlSync": false,
@@ -1289,7 +1299,6 @@
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
- "type": "query",
"useTags": false
},
{
@@ -1336,7 +1345,11 @@
},
"timepicker": {},
"timezone": "",
+ {{- if $shared }}
"title": "KubeDB / ProxySQL / Pod",
+ {{- else }}
+ "title": {{ printf "KubeDB / ProxySQL / Pod / %s / %s" $.Values.app.namespace $.Values.app.name | quote }},
+ {{- end }}
"uid": "FktZiiOnz",
"version": 9
}
diff --git a/charts/kubedb-grafana-dashboards/dashboards/proxysql/proxysql-summary.json b/charts/kubedb-grafana-dashboards/dashboards/proxysql/proxysql-summary.json
index 9c2151872..beb4817de 100644
--- a/charts/kubedb-grafana-dashboards/dashboards/proxysql/proxysql-summary.json
+++ b/charts/kubedb-grafana-dashboards/dashboards/proxysql/proxysql-summary.json
@@ -1,3 +1,4 @@
+{{- $shared := and (eq .Values.app.name "") (eq .Values.app.namespace "") -}}
{
"annotations": {
"list": [
@@ -121,7 +122,7 @@
"format": "table",
"instant": true,
"interval": "",
- "legendFormat": "{{phase}}",
+ "legendFormat": {{ `"{{phase}}"` }},
"refId": "A"
}
],
@@ -204,7 +205,7 @@
"instant": true,
"interval": "",
"intervalFactor": 1,
- "legendFormat": "{{ version }}",
+ "legendFormat": {{ `"{{version}}"` }},
"refId": "A"
}
],
@@ -268,7 +269,7 @@
"expr": "kubedb_com_proxysql_info{namespace=\"$namespace\", app=\"$app\"}",
"instant": true,
"interval": "",
- "legendFormat": "{{ backend }}",
+ "legendFormat": {{ `"{{ backend }}"` }},
"refId": "A"
}
],
@@ -348,7 +349,7 @@
"expr": "kubedb_com_proxysql_info{namespace=\"$namespace\", app=\"$app\", ssl!~\"^$\"}",
"instant": true,
"interval": "",
- "legendFormat": "{{ssl}}",
+ "legendFormat": {{ `"{{ssl}}"` }},
"refId": "A"
}
],
@@ -727,7 +728,7 @@
"format": "table",
"instant": true,
"interval": "",
- "legendFormat": "{{terminationPolicy}}",
+ "legendFormat": {{ `"{{terminationPolicy}}"` }},
"refId": "A"
}
],
@@ -798,7 +799,7 @@
"exemplar": true,
"expr": "sum(node_namespace_pod_container:container_cpu_usage_seconds_total:sum_irate{namespace=\"$namespace\", pod=~\"$app-\\\\d+$\"}) by (pod)",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -1201,7 +1202,7 @@
"exemplar": true,
"expr": "sum(node_namespace_pod_container:container_memory_working_set_bytes{namespace=\"$namespace\", pod=~\"$app-\\\\d+$\",container!=\"\"}) by (pod)",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -1708,7 +1709,7 @@
"exemplar": true,
"expr": "avg(container_blkio_device_usage_total{namespace=\"$namespace\", pod=~\"$app-\\\\d+$\"}) by (pod)",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -1807,7 +1808,7 @@
"instant": false,
"interval": "",
"intervalFactor": 1,
- "legendFormat": "{{pod}}-disk-write",
+ "legendFormat": {{ `"{{pod}}-disk-write"` }},
"refId": "A"
},
{
@@ -1816,7 +1817,7 @@
"hide": false,
"instant": false,
"interval": "",
- "legendFormat": "{{pod}}-disk-read",
+ "legendFormat": {{ `"{{pod}}-disk-read"` }},
"refId": "B"
}
],
@@ -1915,7 +1916,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"legendLink": null,
"refId": "A",
"step": 10
@@ -2016,7 +2017,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"legendLink": null,
"refId": "A",
"step": 10
@@ -2129,7 +2130,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"legendLink": null,
"refId": "A",
"step": 10
@@ -2230,7 +2231,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"legendLink": null,
"refId": "A",
"step": 10
@@ -2318,7 +2319,6 @@
"value": "demo"
},
"datasource": "${datasource}",
- "definition": "label_values(kube_namespace_labels,namespace)",
"description": null,
"error": null,
"hide": 0,
@@ -2327,10 +2327,16 @@
"multi": false,
"name": "namespace",
"options": [],
+ {{- if $shared }}
"query": {
"query": "label_values(kube_namespace_labels,namespace)",
"refId": "Prometheus-namespace-Variable-Query"
},
+ "type": "query",
+ {{- else }}
+ "query": {{ $.Values.app.namespace | quote }},
+ "type": "constant",
+ {{- end }}
"refresh": 1,
"regex": "",
"skipUrlSync": false,
@@ -2338,7 +2344,6 @@
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
- "type": "query",
"useTags": false
},
{
@@ -2349,7 +2354,6 @@
"value": "proxy-server"
},
"datasource": "${datasource}",
- "definition": "label_values(kubedb_com_proxysql_status_phase{namespace=~\"$namespace\"},app)",
"description": null,
"error": null,
"hide": 0,
@@ -2358,10 +2362,16 @@
"multi": false,
"name": "app",
"options": [],
+ {{- if $shared }}
"query": {
"query": "label_values(kubedb_com_proxysql_status_phase{namespace=~\"$namespace\"},app)",
"refId": "StandardVariableQuery"
},
+ "type": "query",
+ {{- else }}
+ "query": {{ $.Values.app.name | quote }},
+ "type": "constant",
+ {{- end }}
"refresh": 1,
"regex": "",
"skipUrlSync": false,
@@ -2369,7 +2379,6 @@
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
- "type": "query",
"useTags": false
}
]
@@ -2404,7 +2413,11 @@
]
},
"timezone": "",
+ {{- if $shared }}
"title": "KubeDB / ProxySQL / Summary",
+ {{- else }}
+ "title": {{ printf "KubeDB / ProxySQL / Summary / %s / %s" $.Values.app.namespace $.Values.app.name | quote }},
+ {{- end }}
"uid": "VsnOgk2Hnk",
"version": 9
}
diff --git a/charts/kubedb-grafana-dashboards/dashboards/redis/redis_pod_dashboard.json b/charts/kubedb-grafana-dashboards/dashboards/redis/redis_pod_dashboard.json
index 219a8171f..184dd0f86 100644
--- a/charts/kubedb-grafana-dashboards/dashboards/redis/redis_pod_dashboard.json
+++ b/charts/kubedb-grafana-dashboards/dashboards/redis/redis_pod_dashboard.json
@@ -1,3 +1,4 @@
+{{- $shared := and (eq .Values.app.name "") (eq .Values.app.namespace "") -}}
{
"annotations": {
"list": [
@@ -222,7 +223,7 @@
"instant": false,
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{role}}",
+ "legendFormat": {{ `"{{role}}"` }},
"metric": "",
"refId": "A",
"step": 2
@@ -306,7 +307,7 @@
"instant": true,
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{master_host}}",
+ "legendFormat": {{ `"{{master_host}}"` }},
"metric": "",
"refId": "A",
"step": 2
@@ -1008,7 +1009,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{ input }}",
+ "legendFormat": {{ `"{{input}}"` }},
"refId": "A",
"step": 240
},
@@ -1018,7 +1019,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{ output }}",
+ "legendFormat": {{ `"{{output}}"` }},
"refId": "B",
"step": 240
}
@@ -1123,7 +1124,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{ cmd }}",
+ "legendFormat": {{ `"{{cmd}}"` }},
"metric": "redis_command_calls_total",
"refId": "A",
"step": 240
@@ -1667,7 +1668,6 @@
"value": "demo"
},
"datasource": "Prometheus",
- "definition": "label_values(redis_up, namespace)",
"description": null,
"error": null,
"hide": 0,
@@ -1676,7 +1676,13 @@
"multi": false,
"name": "namespace",
"options": [],
+ {{- if $shared }}
"query": "label_values(redis_up, namespace)",
+ "type": "query",
+ {{- else }}
+ "query": {{ $.Values.app.namespace | quote }},
+ "type": "constant",
+ {{- end }}
"refresh": 2,
"regex": "",
"skipUrlSync": false,
@@ -1684,7 +1690,6 @@
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
- "type": "query",
"useTags": false
},
{
@@ -1695,7 +1700,6 @@
"value": "demo-rd"
},
"datasource": null,
- "definition": "query_result(kubedb_com_redis_created{namespace=\"$namespace\"})",
"description": null,
"error": null,
"hide": 0,
@@ -1704,7 +1708,13 @@
"multi": false,
"name": "app",
"options": [],
+ {{- if $shared }}
"query": "query_result(kubedb_com_redis_created{namespace=\"$namespace\"})",
+ "type": "query",
+ {{- else }}
+ "query": {{ $.Values.app.name | quote }},
+ "type": "constant",
+ {{- end }}
"refresh": 1,
"regex": "/.*app=\"([^\"]+).*/",
"skipUrlSync": false,
@@ -1712,7 +1722,6 @@
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
- "type": "query",
"useTags": false
},
{
@@ -1775,7 +1784,11 @@
]
},
"timezone": "",
+ {{- if $shared }}
"title": "KubeDB / Redis / Pod",
+ {{- else }}
+ "title": {{ printf "KubeDB / Redis / Pod / %s / %s" $.Values.app.namespace $.Values.app.name | quote }},
+ {{- end }}
"uid": "fF-N4cH7k",
"version": 13
}
\ No newline at end of file
diff --git a/charts/kubedb-grafana-dashboards/dashboards/redis/redis_senitnel_dashboard.json b/charts/kubedb-grafana-dashboards/dashboards/redis/redis_senitnel_dashboard.json
index c88e40cb5..507276fb5 100644
--- a/charts/kubedb-grafana-dashboards/dashboards/redis/redis_senitnel_dashboard.json
+++ b/charts/kubedb-grafana-dashboards/dashboards/redis/redis_senitnel_dashboard.json
@@ -1,3 +1,4 @@
+{{- $shared := and (eq .Values.app.name "") (eq .Values.app.namespace "") -}}
{
"annotations": {
"list": [
@@ -530,7 +531,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{ input }}",
+ "legendFormat": {{ `"{{input}}"` }},
"refId": "A",
"step": 240
},
@@ -540,7 +541,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{ output }}",
+ "legendFormat": {{ `"{{output}}"` }},
"refId": "B",
"step": 240
}
@@ -761,7 +762,7 @@
"exemplar": true,
"expr": "sum(node_namespace_pod_container:container_cpu_usage_seconds_total:sum_irate{namespace=\"$namespace\", pod=~\"$app-\\\\d+$|$app-shard\\\\d+-\\\\d+$\"}) by (pod)",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -1175,7 +1176,7 @@
"exemplar": true,
"expr": "sum(node_namespace_pod_container:container_memory_working_set_bytes{namespace=\"$namespace\", pod=~\"$app-\\\\d+$|$app-shard\\\\d+-\\\\d+$\",container!=\"\"}) by (pod)",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -1881,7 +1882,6 @@
"value": "demo"
},
"datasource": "Prometheus",
- "definition": "label_values(redis_up, namespace)",
"description": null,
"error": null,
"hide": 0,
@@ -1890,10 +1890,16 @@
"multi": false,
"name": "namespace",
"options": [],
+ {{- if $shared }}
"query": {
"query": "label_values(redis_up, namespace)",
"refId": "Prometheus-namespace-Variable-Query"
},
+ "type": "query",
+ {{- else }}
+ "query": {{ $.Values.app.namespace | quote }},
+ "type": "constant",
+ {{- end }}
"refresh": 2,
"regex": "",
"skipUrlSync": false,
@@ -1901,7 +1907,6 @@
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
- "type": "query",
"useTags": false
},
{
@@ -1912,7 +1917,6 @@
"value": "sentinel"
},
"datasource": null,
- "definition": "query_result(kubedb_com_redissentinel_created{namespace=\"$namespace\"})",
"description": null,
"error": null,
"hide": 0,
@@ -1921,10 +1925,16 @@
"multi": false,
"name": "app",
"options": [],
+ {{- if $shared }}
"query": {
"query": "query_result(kubedb_com_redissentinel_created{namespace=\"$namespace\"})",
"refId": "StandardVariableQuery"
},
+ "type": "query",
+ {{- else }}
+ "query": {{ $.Values.app.name | quote }},
+ "type": "constant",
+ {{- end }}
"refresh": 1,
"regex": "/.*name=\"([^\"]+).*/",
"skipUrlSync": false,
@@ -1932,7 +1942,6 @@
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
- "type": "query",
"useTags": false
},
{
@@ -1998,7 +2007,11 @@
]
},
"timezone": "utc",
+ {{- if $shared }}
"title": "KubeDB / RedisSentinel / Pod",
+ {{- else }}
+ "title": {{ printf "KubeDB / RedisSentinel / Pod / %s / %s" $.Values.app.namespace $.Values.app.name | quote }},
+ {{- end }}
"uid": "fF-N4cH7k",
"version": 4
}
\ No newline at end of file
diff --git a/charts/kubedb-grafana-dashboards/dashboards/redis/redis_shards_dashboard.json b/charts/kubedb-grafana-dashboards/dashboards/redis/redis_shards_dashboard.json
index 6ca3128a9..6d466147a 100644
--- a/charts/kubedb-grafana-dashboards/dashboards/redis/redis_shards_dashboard.json
+++ b/charts/kubedb-grafana-dashboards/dashboards/redis/redis_shards_dashboard.json
@@ -1,3 +1,4 @@
+{{- $shared := and (eq .Values.app.name "") (eq .Values.app.namespace "") -}}
{
"annotations": {
"list": [
@@ -568,7 +569,7 @@
"instant": false,
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{redis_mode}}",
+ "legendFormat": {{ `"{{redis_mode}}"` }},
"metric": "",
"refId": "A",
"step": 2
@@ -684,7 +685,6 @@
"value": "demo"
},
"datasource": "Prometheus",
- "definition": "label_values(redis_up, namespace)",
"description": null,
"error": null,
"hide": 0,
@@ -693,7 +693,13 @@
"multi": false,
"name": "namespace",
"options": [],
+ {{- if $shared }}
"query": "label_values(redis_up, namespace)",
+ "type": "query",
+ {{- else }}
+ "query": {{ $.Values.app.namespace | quote }},
+ "type": "constant",
+ {{- end }}
"refresh": 2,
"regex": "",
"skipUrlSync": false,
@@ -701,7 +707,6 @@
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
- "type": "query",
"useTags": false
},
{
@@ -712,7 +717,6 @@
"value": "demo-rd"
},
"datasource": null,
- "definition": "query_result(kubedb_com_redis_created{namespace=\"$namespace\"})",
"description": null,
"error": null,
"hide": 0,
@@ -721,7 +725,13 @@
"multi": false,
"name": "app",
"options": [],
+ {{- if $shared }}
"query": "query_result(kubedb_com_redis_created{namespace=\"$namespace\"})",
+ "type": "query",
+ {{- else }}
+ "query": {{ $.Values.app.name | quote }},
+ "type": "constant",
+ {{- end }}
"refresh": 1,
"regex": "/.*app=\"([^\"]+).*/",
"skipUrlSync": false,
@@ -729,7 +739,6 @@
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
- "type": "query",
"useTags": false
},
{
@@ -803,7 +812,11 @@
]
},
"timezone": "",
+ {{- if $shared }}
"title": "KubeDB / Redis / Shard",
+ {{- else }}
+ "title": {{ printf "KubeDB / Redis / Shard / %s / %s" $.Values.app.namespace $.Values.app.name | quote }},
+ {{- end }}
"uid": "fF-N4cHsh",
"version": 7
}
\ No newline at end of file
diff --git a/charts/kubedb-grafana-dashboards/dashboards/redis/redis_summary_dashboard.json b/charts/kubedb-grafana-dashboards/dashboards/redis/redis_summary_dashboard.json
index 081167d87..6f79ba56c 100644
--- a/charts/kubedb-grafana-dashboards/dashboards/redis/redis_summary_dashboard.json
+++ b/charts/kubedb-grafana-dashboards/dashboards/redis/redis_summary_dashboard.json
@@ -1,3 +1,4 @@
+{{- $shared := and (eq .Values.app.name "") (eq .Values.app.namespace "") -}}
{
"annotations": {
"list": [
@@ -121,7 +122,7 @@
"format": "table",
"instant": true,
"interval": "",
- "legendFormat": "{{phase}}",
+ "legendFormat": {{ `"{{phase}}"` }},
"refId": "A"
}
],
@@ -202,7 +203,7 @@
"instant": true,
"interval": "",
"intervalFactor": 1,
- "legendFormat": "{{version}}",
+ "legendFormat": {{ `"{{version}}"` }},
"refId": "A"
}
],
@@ -350,7 +351,7 @@
"instant": true,
"interval": "",
"intervalFactor": 1,
- "legendFormat": "{{mode}}",
+ "legendFormat": {{ `"{{mode}}"` }},
"refId": "A"
}
],
@@ -430,7 +431,7 @@
"format": "table",
"instant": true,
"interval": "",
- "legendFormat": "{{terminationPolicy}}",
+ "legendFormat": {{ `"{{terminationPolicy}}"` }},
"refId": "A"
}
],
@@ -868,7 +869,7 @@
"exemplar": true,
"expr": "sum(node_namespace_pod_container:container_cpu_usage_seconds_total:sum_irate{namespace=\"$namespace\", pod=~\"$app-\\\\d+$|$app-shard\\\\d+-\\\\d+$\"}) by (pod)",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -1282,7 +1283,7 @@
"exemplar": true,
"expr": "sum(node_namespace_pod_container:container_memory_working_set_bytes{namespace=\"$namespace\", pod=~\"$app-\\\\d+$|$app-shard\\\\d+-\\\\d+$\",container!=\"\"}) by (pod)",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -1800,7 +1801,7 @@
"exemplar": true,
"expr": "avg(container_blkio_device_usage_total{namespace=\"$namespace\", pod=~\"$app-\\\\d+$|$app-shard\\\\d+-\\\\d+$\"}) by (pod)",
"interval": "",
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
@@ -1910,7 +1911,7 @@
"instant": false,
"interval": "",
"intervalFactor": 1,
- "legendFormat": "{{pod}}-disk-write",
+ "legendFormat": {{ `"{{pod}}-disk-write"` }},
"refId": "A"
},
{
@@ -1919,7 +1920,7 @@
"hide": false,
"instant": false,
"interval": "",
- "legendFormat": "{{pod}}-disk-read",
+ "legendFormat": {{ `"{{pod}}-disk-read"` }},
"refId": "B"
}
],
@@ -2029,7 +2030,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"legendLink": null,
"refId": "A",
"step": 10
@@ -2141,7 +2142,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"legendLink": null,
"refId": "A",
"step": 10
@@ -2650,7 +2651,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"
}
],
@@ -2734,7 +2735,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"
}
],
@@ -2820,7 +2821,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"legendLink": null,
"refId": "A",
"step": 10
@@ -2932,7 +2933,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{pod}}",
+ "legendFormat": {{ `"{{pod}}"` }},
"legendLink": null,
"refId": "A",
"step": 10
@@ -3048,7 +3049,7 @@
"instant": false,
"interval": "",
"intervalFactor": 2,
- "legendFormat": "{{ db }}",
+ "legendFormat": {{ `"{{db}}"` }},
"refId": "A"
}
],
@@ -3352,7 +3353,6 @@
"value": "demo"
},
"datasource": "${datasource}",
- "definition": "label_values(kube_namespace_labels,namespace)",
"description": null,
"error": null,
"hide": 0,
@@ -3361,10 +3361,16 @@
"multi": false,
"name": "namespace",
"options": [],
+ {{- if $shared }}
"query": {
"query": "label_values(kube_namespace_labels,namespace)",
"refId": "Prometheus-namespace-Variable-Query"
},
+ "type": "query",
+ {{- else }}
+ "query": {{ $.Values.app.namespace | quote }},
+ "type": "constant",
+ {{- end }}
"refresh": 1,
"regex": "",
"skipUrlSync": false,
@@ -3372,7 +3378,6 @@
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
- "type": "query",
"useTags": false
},
{
@@ -3383,7 +3388,6 @@
"value": "redis-sentinel"
},
"datasource": "${datasource}",
- "definition": "label_values(kubedb_com_redis_status_phase{namespace=~\"$namespace\"},app)",
"description": null,
"error": null,
"hide": 0,
@@ -3392,10 +3396,16 @@
"multi": false,
"name": "app",
"options": [],
+ {{- if $shared }}
"query": {
"query": "label_values(kubedb_com_redis_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,
@@ -3403,7 +3413,6 @@
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
- "type": "query",
"useTags": false
}
]
@@ -3438,7 +3447,11 @@
]
},
"timezone": "",
+ {{- if $shared }}
"title": "KubeDB / Redis / Summary",
+ {{- else }}
+ "title": {{ printf "KubeDB / Redis / Summary / %s / %s" $.Values.app.namespace $.Values.app.name | quote }},
+ {{- end }}
"uid": "wzK8X8Nrd",
"version": 9
}
\ No newline at end of file
diff --git a/charts/kubedb-grafana-dashboards/data/resources.yaml b/charts/kubedb-grafana-dashboards/data/resources.yaml
index 8744ce702..20ff77cb7 100644
--- a/charts/kubedb-grafana-dashboards/data/resources.yaml
+++ b/charts/kubedb-grafana-dashboards/data/resources.yaml
@@ -13,12 +13,15 @@ mongodb:
mysql:
kind: MySQL
resource: mysqls
+perconaxtradb:
+ kind: PerconaXtraDB
+ resource: perconaxtradbs
postgres:
kind: Postgres
resource: postgreses
-redis:
- kind: Redis
- resource: redises
proxysql:
kind: ProxySQL
resource: proxysqls
+redis:
+ kind: Redis
+ resource: redises
diff --git a/charts/kubedb-grafana-dashboards/templates/configmap.yaml b/charts/kubedb-grafana-dashboards/templates/configmap.yaml
new file mode 100644
index 000000000..c604c8014
--- /dev/null
+++ b/charts/kubedb-grafana-dashboards/templates/configmap.yaml
@@ -0,0 +1,31 @@
+{{ $shared := and (eq .Values.app.name "") (eq .Values.app.namespace "") }}
+{{ if not $shared }}
+
+{{- if not (eq (len .Values.resources) 1) }}
+{{- fail "Only one .Values.resources can be used when app name or namespace is set!" }}
+{{- end }}
+
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: {{ include "kubedb-grafana-dashboards.fullname" . }}-config
+ namespace: {{ $.Release.Namespace }}
+ labels:
+ {{- include "kubedb-grafana-dashboards.labels" $ | nindent 4 }}
+data:
+{{- range $r := .Values.resources }}
+{{- range $path, $_ := $.Files.Glob (printf "dashboards/%s/**.json" $r) }}
+ {{- $dashtpl := $.Files.Get $path }}
+ {{- range $k, $v := $.Values.dashboard.replacements }}
+ {{- $dashtpl = $dashtpl | replace $k $v }}
+ {{- end }}
+ {{- $dashboard := omit (tpl $dashtpl $ | mustFromJson) "id" "uid" -}}
+ {{ $path | replace "/" "-" | nindent 2 }}: |
+ {{- dict
+ "dashboard" $dashboard
+ "folderId" $.Values.dashboard.folderID
+ "overwrite" $.Values.dashboard.overwrite | toJson | nindent 4 -}}
+{{- end }}
+{{- end }}
+
+{{ end }}
\ No newline at end of file
diff --git a/charts/kubedb-grafana-dashboards/templates/dashboard.yaml b/charts/kubedb-grafana-dashboards/templates/dashboard.yaml
index 8bb74d50e..a6e5bda43 100644
--- a/charts/kubedb-grafana-dashboards/templates/dashboard.yaml
+++ b/charts/kubedb-grafana-dashboards/templates/dashboard.yaml
@@ -1,10 +1,20 @@
+{{ $shared := and (eq .Values.app.name "") (eq .Values.app.namespace "") }}
+{{ if $shared }}
+
{{- $gkr := .Files.Get "data/resources.yaml" | fromYaml -}}
{{ range $r := .Values.resources }}
{{ range $path, $_ := $.Files.Glob (printf "dashboards/%s/**.json" $r) }}
+
+{{- $dashtpl := $.Files.Get $path }}
+{{- range $k, $v := $.Values.dashboard.replacements }}
+ {{- $dashtpl = $dashtpl | replace $k $v }}
+{{- end }}
+{{- $dashboard := omit (tpl $dashtpl $ | mustFromJson) "id" "uid" -}}
+
apiVersion: openviz.dev/v1alpha1
kind: GrafanaDashboard
metadata:
- name: {{ prepend ((get ($.Files.Get $path | mustFromJson) "title") | lower | nospace | splitList "/" ) $.Values.grafana.name | compact | join "-" | trunc 63 | trimSuffix "-" }}
+ name: {{ prepend ((get $dashboard "title") | lower | nospace | splitList "/" ) $.Values.grafana.name | compact | join "-" | trunc 63 | trimSuffix "-" }}
namespace: {{ $.Release.Namespace }}
labels:
k8s.io/group: kubedb.com
@@ -22,7 +32,7 @@ spec:
{{- end }}
{{- end }}
model:
- {{- omit ($.Files.Get $path | mustFromJson) "id" "uid" | toYaml | nindent 4 }}
+ {{- $dashboard | toYaml | nindent 4 }}
{{- with $.Values.dashboard.folderID }}
folderID: {{ . }}
{{- end }}
@@ -33,3 +43,4 @@ spec:
---
{{ end }}
{{ end }}
+{{ end }}
diff --git a/charts/kubedb-grafana-dashboards/templates/job.yaml b/charts/kubedb-grafana-dashboards/templates/job.yaml
new file mode 100644
index 000000000..070f9a5f1
--- /dev/null
+++ b/charts/kubedb-grafana-dashboards/templates/job.yaml
@@ -0,0 +1,43 @@
+{{ $shared := and (eq .Values.app.name "") (eq .Values.app.namespace "") }}
+{{ if not $shared }}
+
+apiVersion: batch/v1
+kind: Job
+metadata:
+ name: {{ include "kubedb-grafana-dashboards.fullname" . }}-installer
+ labels:
+ {{- include "kubedb-grafana-dashboards.labels" . | nindent 4 }}
+spec:
+ # ttlSecondsAfterFinished: 0
+ backoffLimit: 3
+ template:
+ spec:
+ automountServiceAccountToken: false
+ volumes:
+ - name: grafana-dashboards
+ configMap:
+ name: {{ include "kubedb-grafana-dashboards.fullname" . }}-config
+ containers:
+ - name: post-json-container
+ image: curlimages/curl:latest
+ command:
+ - sh
+ - -c
+ - |
+ sleep 2; \
+ FILES="/grafana/dashboards/*.json"; \
+ for f in $FILES; \
+ do \
+ echo "Processing dashboard file $f ..."; \
+ curl \
+ -X POST \
+ -H "Content-Type: application/json" \
+ -H "Authorization: Bearer {{ .Values.grafana.apikey }}" \
+ --data-binary @/etc/grafana-json/grafana-json.json \
+ {{ .Values.grafana.url }}/api/dashboards/import; \
+ done
+ volumeMounts:
+ - mountPath: /grafana/dashboards
+ name: grafana-dashboards
+ restartPolicy: Never
+{{ end }}
\ No newline at end of file
diff --git a/charts/kubedb-grafana-dashboards/values.yaml b/charts/kubedb-grafana-dashboards/values.yaml
index 9e9c73043..bc6329806 100644
--- a/charts/kubedb-grafana-dashboards/values.yaml
+++ b/charts/kubedb-grafana-dashboards/values.yaml
@@ -10,12 +10,14 @@ fullnameOverride: ""
# List of resources for which dashboards will be applied
resources: # +doc-gen:break
- elasticsearch
+ - kafka
- mariadb
- mongodb
- mysql
+ - perconaxtradb
- postgres
- - redis
- proxysql
+ - redis
dashboard:
# ID of Grafana folder where these dashboards will be applied
@@ -27,9 +29,22 @@ dashboard:
title: false
# If true, datasource will be hardcoded in the dashboard
datasource: false
+ alerts: false
+ replacements: {}
+ # job=\"kube-state-metrics\": job=\"kubernetes-service-endpoints\"
+ # job=\"kubelet\": job=\"kubernetes-nodes-cadvisor\"
+ # job=\"repl-stats\": job=\"kubedb-databases\"
grafana:
# Name of Grafana Appbinding where these dashboards are applied
name: ""
# Namespace of Grafana Appbinding where these dashboards are applied
namespace: ""
+ version: 8.2.3
+ jobName: kubedb-databases
+ url: ""
+ apikey: ""
+
+app:
+ name: ""
+ namespace: ""