Skip to content

Commit

Permalink
Make db dashboard ready for builtin prometheus
Browse files Browse the repository at this point in the history
Signed-off-by: Neaj Morshad <neaj@appscode.com>
  • Loading branch information
Neaj-Morshad-101 committed Sep 25, 2024
1 parent 6984716 commit b160dca
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 27 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{{- $shared := and (eq .Values.app.name "") (eq .Values.app.namespace "") -}}
{{- $alerts := (eq $.Values.dashboard.alerts true) -}}
{
"annotations": {
"list": [
Expand Down Expand Up @@ -138,7 +140,7 @@
"instant": true,
"interval": "",
"intervalFactor": 1,
"legendFormat": "{{ pod }}",
"legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
Expand Down Expand Up @@ -242,7 +244,7 @@
"format": "table",
"instant": true,
"interval": "",
"legendFormat": "{{ pod }}",
"legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
Expand Down Expand Up @@ -400,7 +402,7 @@
"expr": "mssql_pod_role{namespace=~\"$namespace\",service=~\"$app+-stats\"}",
"instant": true,
"interval": "",
"legendFormat": "{{pod}}",
"legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
Expand Down Expand Up @@ -492,7 +494,7 @@
"expr": "mssql_pod_role{namespace=~\"$namespace\", service=~\"$app+-stats\"}",
"instant": true,
"interval": "",
"legendFormat": "{{pod}}",
"legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
Expand Down Expand Up @@ -659,7 +661,7 @@
"expr": "mssql_pod_role{namespace=~\"$namespace\",service=~\"$app+-stats\"}",
"instant": true,
"interval": "",
"legendFormat": "{{role}}",
"legendFormat": {{ `"{{role}}"` }},
"refId": "A"
}
],
Expand Down Expand Up @@ -728,7 +730,7 @@
"exemplar": true,
"expr": "rate(sqlserver_compilations_per_sec{namespace=~\"$namespace\",service=~\"$app+-stats\"}[5m])",
"interval": "",
"legendFormat": "{{pod}}",
"legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
Expand Down Expand Up @@ -825,7 +827,7 @@
"exemplar": true,
"expr": "rate(mssql_batch_requests{namespace=~\"$namespace\",service=~\"$app+-stats\"}[5m])",
"interval": "",
"legendFormat": "{{pod}}",
"legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
Expand Down Expand Up @@ -929,7 +931,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 1,
"legendFormat": "{{db}}",
"legendFormat": {{ `"{{db}}"` }},
"refId": "A"
}
],
Expand Down Expand Up @@ -1029,7 +1031,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 1,
"legendFormat": "{{db}}",
"legendFormat": {{ `"{{db}}"` }},
"refId": "B"
}
],
Expand Down Expand Up @@ -1079,7 +1081,7 @@
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "Prometheus",
"datasource": "${datasource}",
"fieldConfig": {
"defaults": {},
"overrides": []
Expand Down Expand Up @@ -1125,7 +1127,7 @@
"exemplar": true,
"expr": "mssql_io_stall_total_seconds{}",
"interval": "",
"legendFormat": "{{db}}",
"legendFormat": {{ `"{{db}}"` }},
"refId": "A"
}
],
Expand Down Expand Up @@ -1186,7 +1188,7 @@
"text": "Prometheus",
"value": "Prometheus"
},
"description": null,
"description": "MSSQLServer Overview",
"error": null,
"hide": 0,
"includeAll": false,
Expand All @@ -1210,18 +1212,24 @@
},
"datasource": "${datasource}",
"definition": "label_values(kube_namespace_created,namespace)",
"description": null,
"description": "MSSQLServer Overview",
"error": null,
"hide": 0,
"includeAll": false,
"label": "Namespace",
"multi": false,
"name": "namespace",
"options": [],
{{- if $shared }}
"query": {
"query": "label_values(kube_namespace_created,namespace)",
"refId": "Prometheus-namespace-Variable-Query"
},
"type": "query",
{{- else }}
"query": {{ $.Values.app.namespace | quote }},
"type": "constant",
{{- end }}
"refresh": 1,
"regex": "",
"skipUrlSync": false,
Expand Down Expand Up @@ -1249,10 +1257,16 @@
"multi": false,
"name": "app",
"options": [],
{{- if $shared }}
"query": {
"query": "label_values(kubedb_com_mysql_status_phase{namespace=~\"$namespace\"},app)",
"refId": "Prometheus-app-Variable-Query"
},
"type": "query",
{{- else }}
"query": {{ $.Values.app.name | quote }},
"type": "constant",
{{- end }}
"refresh": 1,
"regex": "",
"skipUrlSync": false,
Expand All @@ -1263,6 +1277,7 @@
"type": "query",
"useTags": false
}
{{- end }}
]
},
"time": {
Expand All @@ -1271,7 +1286,11 @@
},
"timepicker": {},
"timezone": "",
{{- if $shared }}
"title": "KubeDB / MSSQLServer / Database",
{{- else }}
"title": {{ printf "KubeDB / MSSQLServer / Database / %s / %s" $.Values.app.namespace $.Values.app.name | quote }},
{{- end }}
"uid": "ohrahgv7T",
"version": 37
}
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
"format": "table",
"instant": true,
"interval": "",
"legendFormat": "{{phase}}",
"legendFormat": {{ `"{{phase}}"` }},
"refId": "A"
}
],
Expand Down Expand Up @@ -284,7 +284,7 @@
"format": "time_series",
"instant": true,
"interval": "",
"legendFormat": "{{clientTLS}}",
"legendFormat": {{ `"{{clientTLS}}"` }},
"refId": "A"
}
],
Expand Down Expand Up @@ -366,7 +366,7 @@
"format": "table",
"instant": true,
"interval": "",
"legendFormat": "{{deletionPolicy}}",
"legendFormat": {{ `"{{deletionPolicy}}"` }},
"refId": "A"
}
],
Expand Down Expand Up @@ -795,7 +795,7 @@
"exemplar": true,
"expr": "sum(sum by(namespace,pod,container)(irate(container_cpu_usage_seconds_total{image!=\"\",job=\"kubelet\",metrics_path=\"/metrics/cadvisor\",namespace=\"$namespace\", pod=~\"$app-aggregator-\\\\d+$|$app-leaf-\\\\d+$|$app-\\\\d+$\"}[5m]))* on (namespace, pod) group_left (node) topk by (namespace, pod) (1, max by (namespace, pod, node) (kube_pod_info{node!=\"\",namespace=\"$namespace\", pod=~\"$app-aggregator-\\\\d+$|$app-leaf-\\\\d+$|$app-\\\\d+$\"}))) by (pod)",
"interval": "",
"legendFormat": "{{pod}}",
"legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
Expand Down Expand Up @@ -1198,7 +1198,7 @@
"exemplar": true,
"expr": "sum(node_namespace_pod_container:container_memory_working_set_bytes{namespace=\"$namespace\", pod=~\"$app-leaf-\\\\d+$|$app-aggregator-\\\\d+$|$app-\\\\d+$\",container!=\"\"}) by (pod)",
"interval": "",
"legendFormat": "{{pod}}",
"legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
Expand Down Expand Up @@ -1705,7 +1705,7 @@
"exemplar": true,
"expr": "avg(container_blkio_device_usage_total{namespace=\"$namespace\", pod=~\"$app-aggregator-\\\\d+$|$app-leaf-\\\\d+$|$app-\\\\d+\"}) by (pod)",
"interval": "",
"legendFormat": "{{pod}}",
"legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
Expand Down Expand Up @@ -1804,7 +1804,7 @@
"instant": false,
"interval": "",
"intervalFactor": 1,
"legendFormat": "{{pod}}-disk-write",
"legendFormat": {{ `"{{pod}}-disk-write"` }},
"refId": "A"
},
{
Expand All @@ -1813,7 +1813,7 @@
"hide": false,
"instant": false,
"interval": "",
"legendFormat": "{{pod}}-disk-read",
"legendFormat": {{ `"{{pod}}-disk-read"` }},
"refId": "B"
}
],
Expand Down Expand Up @@ -1912,7 +1912,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
"legendFormat": "{{pod}}",
"legendFormat": {{ `"{{pod}}"` }},
"legendLink": null,
"refId": "A",
"step": 10
Expand Down Expand Up @@ -2013,7 +2013,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
"legendFormat": "{{pod}}",
"legendFormat": {{ `"{{pod}}"` }},
"legendLink": null,
"refId": "A",
"step": 10
Expand Down Expand Up @@ -2522,7 +2522,7 @@
"expr": "(kubelet_volume_stats_used_bytes / on(persistentvolumeclaim) group_left(pod) (kubelet_volume_stats_capacity_bytes + on(persistentvolumeclaim) group_left(pod) kube_pod_spec_volumes_persistentvolumeclaims_info{pod=~\"^$app.*\",namespace=~\"$namespace\"}) )* 100",
"instant": true,
"interval": "",
"legendFormat": "{{pod}}",
"legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
Expand Down Expand Up @@ -2606,7 +2606,7 @@
"expr": "(kubelet_volume_stats_used_bytes + on(persistentvolumeclaim) group_left(pod) kube_pod_spec_volumes_persistentvolumeclaims_info{pod=~\"^$app.*\",namespace=~\"$namespace\"}) ",
"interval": "",
"intervalFactor": 1,
"legendFormat": "{{pod}}",
"legendFormat": {{ `"{{pod}}"` }},
"refId": "A"
}
],
Expand Down Expand Up @@ -2679,7 +2679,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
"legendFormat": "{{pod}}",
"legendFormat": {{ `"{{pod}}"` }},
"legendLink": null,
"refId": "A",
"step": 10
Expand Down Expand Up @@ -2780,7 +2780,7 @@
"format": "time_series",
"interval": "",
"intervalFactor": 2,
"legendFormat": "{{pod}}",
"legendFormat": {{ `"{{pod}}"` }},
"legendLink": null,
"refId": "A",
"step": 10
Expand Down

0 comments on commit b160dca

Please sign in to comment.