Skip to content

Commit bc0bc83

Browse files
committed
new pod count dashboard per workload
1 parent 9ceec88 commit bc0bc83

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

dashboards/resources/workload.libsonnet

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,45 @@ local var = g.dashboard.variable;
163163
];
164164

165165
local panels = [
166+
tsPanel.new('Pod Count per Workload')
167+
+ tsPanel.gridPos.withW(24)
168+
+ tsPanel.queryOptions.withTargets([
169+
prometheus.new(
170+
'${datasource}',
171+
'sum by (cluster, namespace, deployment) (kube_deployment_spec_replicas{%(clusterLabel)s="$cluster", namespace="$namespace", deployment="$workload"})' % $._config
172+
) + prometheus.withLegendFormat('{{deployment}} desired')
173+
+ prometheus.withRefId('D'),
174+
175+
prometheus.new(
176+
'${datasource}',
177+
'sum by (cluster, namespace, deployment) (kube_deployment_status_replicas_available{%(clusterLabel)s="$cluster", namespace="$namespace", deployment="$workload"})' % $._config
178+
) + prometheus.withLegendFormat('{{deployment}} available')
179+
+ prometheus.withRefId('E'),
180+
181+
prometheus.new(
182+
'${datasource}',
183+
'sum by (cluster, namespace, statefulset) (kube_statefulset_replicas{%(clusterLabel)s="$cluster", namespace="$namespace", statefulset="$workload"})' % $._config
184+
) + prometheus.withLegendFormat('{{statefulset}} desired')
185+
+ prometheus.withRefId('F'),
186+
187+
prometheus.new(
188+
'${datasource}',
189+
'sum by (cluster, namespace, statefulset) (kube_statefulset_status_replicas_ready{%(clusterLabel)s="$cluster", namespace="$namespace", statefulset="$workload"})' % $._config
190+
) + prometheus.withLegendFormat('{{statefulset}} available')
191+
+ prometheus.withRefId('G'),
192+
193+
prometheus.new(
194+
'${datasource}',
195+
'sum by (cluster, namespace, daemonset) (kube_daemonset_status_desired_number_scheduled{%(clusterLabel)s="$cluster", namespace="$namespace", daemonset="$workload"})' % $._config
196+
) + prometheus.withLegendFormat('{{daemonset}} desired')
197+
+ prometheus.withRefId('H'),
198+
199+
prometheus.new(
200+
'${datasource}',
201+
'sum by (cluster, namespace, daemonset) (kube_daemonset_status_number_available{%(clusterLabel)s="$cluster", namespace="$namespace", daemonset="$workload"})' % $._config
202+
) + prometheus.withLegendFormat('{{daemonset}} available')
203+
+ prometheus.withRefId('I'),
204+
]),
166205
tsPanel.new('CPU Usage')
167206
+ tsPanel.gridPos.withW(24)
168207
+ tsPanel.queryOptions.withTargets([

0 commit comments

Comments
 (0)