Skip to content

Commit c72ba0f

Browse files
[CAP-3826] Improve Kubernetes Pods dashboard widgets (#24625)
1 parent 061fc1a commit c72ba0f

1 file changed

Lines changed: 73 additions & 11 deletions

File tree

kubernetes/assets/dashboards/kubernetes_pods.json

Lines changed: 73 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,13 @@
8585
],
8686
"queries": [
8787
{
88-
"query": "sum:kubernetes_state.pod.status_phase{$scope AND $cluster AND $namespace AND $deployment AND $statefulset AND $daemonset AND $job AND $cronjob AND (pod_phase:succeeded OR pod_phase:running)} by {pod_phase}",
88+
"query": "sum:kubernetes_state.pod.status_phase{$scope AND $cluster AND $namespace AND $deployment AND $statefulset AND $daemonset AND $job AND $cronjob AND (pod_phase:succeeded OR pod_phase:running)} by {pod_phase}.weighted()",
8989
"data_source": "metrics",
9090
"name": "query1",
9191
"semantic_mode": "combined"
9292
},
9393
{
94-
"query": "sum:kubernetes_state.pod.status_phase{$scope,$cluster,$namespace,$deployment,$statefulset,$daemonset,$job,$cronjob,!pod_phase:succeeded,!pod_phase:running} by {pod_phase}",
94+
"query": "sum:kubernetes_state.pod.status_phase{$scope,$cluster,$namespace,$deployment,$statefulset,$daemonset,$job,$cronjob,!pod_phase:succeeded,!pod_phase:running} by {pod_phase}.weighted()",
9595
"data_source": "metrics",
9696
"name": "query2",
9797
"semantic_mode": "combined"
@@ -138,14 +138,14 @@
138138
],
139139
"queries": [
140140
{
141-
"query": "sum:kubernetes_state.pod.ready{$scope,$cluster,$namespace,$deployment,$statefulset,$daemonset,$job,$cronjob,condition:true,!pod_phase:succeeded,!pod_phase:failed}",
141+
"query": "sum:kubernetes_state.pod.ready{$scope,$cluster,$namespace,$deployment,$statefulset,$daemonset,$job,$cronjob,condition:true,!pod_phase:succeeded,!pod_phase:failed}.weighted()",
142142
"data_source": "metrics",
143143
"name": "query1",
144144
"semantic_mode": "combined",
145145
"aggregator": "last"
146146
},
147147
{
148-
"query": "sum:kubernetes_state.pod.ready{$scope,$cluster,$namespace,$deployment,$statefulset,$daemonset,$job,$cronjob,!pod_phase:succeeded,!pod_phase:failed}",
148+
"query": "sum:kubernetes_state.pod.ready{$scope,$cluster,$namespace,$deployment,$statefulset,$daemonset,$job,$cronjob,!pod_phase:succeeded,!pod_phase:failed}.weighted()",
149149
"data_source": "metrics",
150150
"name": "query2",
151151
"semantic_mode": "combined",
@@ -174,6 +174,11 @@
174174
"title": "Issues by Namespace (changed weekly)",
175175
"title_size": "16",
176176
"title_align": "left",
177+
"time": {
178+
"type": "live",
179+
"unit": "week",
180+
"value": 1
181+
},
177182
"type": "change",
178183
"custom_links": [],
179184
"requests": [
@@ -185,7 +190,7 @@
185190
"response_format": "scalar",
186191
"formulas": [
187192
{
188-
"formula": "week_before(query1)"
193+
"formula": "calendar_shift(query1, '-1w', 'UTC')"
189194
},
190195
{
191196
"formula": "query1"
@@ -927,8 +932,8 @@
927932
"layout": {
928933
"x": 0,
929934
"y": 6,
930-
"width": 6,
931-
"height": 3
935+
"width": 4,
936+
"height": 2
932937
}
933938
},
934939
{
@@ -998,10 +1003,67 @@
9981003
]
9991004
},
10001005
"layout": {
1001-
"x": 6,
1006+
"x": 4,
10021007
"y": 6,
1003-
"width": 6,
1004-
"height": 3
1008+
"width": 4,
1009+
"height": 2
1010+
}
1011+
},
1012+
{
1013+
"id": 5594150827125000,
1014+
"definition": {
1015+
"title": "Disk I/O",
1016+
"title_size": "16",
1017+
"title_align": "left",
1018+
"show_legend": false,
1019+
"legend_layout": "auto",
1020+
"legend_columns": [
1021+
"avg",
1022+
"min",
1023+
"max",
1024+
"value",
1025+
"sum"
1026+
],
1027+
"type": "timeseries",
1028+
"requests": [
1029+
{
1030+
"response_format": "timeseries",
1031+
"queries": [
1032+
{
1033+
"data_source": "metrics",
1034+
"name": "query1",
1035+
"query": "sum:kubernetes.io.write_bytes{$scope,$cluster,$namespace,$deployment,$statefulset,$daemonset,$job,$cronjob}"
1036+
},
1037+
{
1038+
"data_source": "metrics",
1039+
"name": "query2",
1040+
"query": "sum:kubernetes.io.read_bytes{$scope,$cluster,$namespace,$deployment,$statefulset,$daemonset,$job,$cronjob}"
1041+
}
1042+
],
1043+
"formulas": [
1044+
{
1045+
"alias": "Write Bytes",
1046+
"formula": "query1"
1047+
},
1048+
{
1049+
"alias": "Read Bytes",
1050+
"formula": "query2"
1051+
}
1052+
],
1053+
"style": {
1054+
"palette": "grey",
1055+
"line_type": "solid",
1056+
"line_width": "normal"
1057+
},
1058+
"display_type": "line"
1059+
}
1060+
]
1061+
},
1062+
"layout": {
1063+
"x": 8,
1064+
"y": 6,
1065+
"width": 4,
1066+
"height": 2
10051067
}
10061068
}
10071069
]
@@ -1010,7 +1072,7 @@
10101072
"x": 0,
10111073
"y": 13,
10121074
"width": 12,
1013-
"height": 10
1075+
"height": 9
10141076
}
10151077
}
10161078
],

0 commit comments

Comments
 (0)