@@ -36,6 +36,10 @@ local numbersinglestat = promgrafonnet.numbersinglestat;
3636 'sum by(container) (kube_pod_container_resource_limits{%(kubeStateMetricsSelector)s, %(clusterLabel)s="$cluster", namespace="$namespace", resource="memory", pod="$pod", container=~"$container"})' % $._config,
3737 legendFormat='Limit: {{ container }}' ,
3838 ))
39+ .addTarget(prometheus.target(
40+ 'sum by(container_name) (container_memory_cache{%(cadvisorSelector)s, namespace="$namespace", pod_name=~"$pod", container_name=~"$container", container_name!="POD"})' % $._config,
41+ legendFormat='Cache: {{ container_name }}' ,
42+ ))
3943 );
4044
4145 local cpuRow = row.new()
@@ -79,7 +83,30 @@ local numbersinglestat = promgrafonnet.numbersinglestat;
7983 )
8084 .addTarget(prometheus.target(
8185 'sort_desc(sum by (pod_name) (rate(container_network_receive_bytes_total{%(cadvisorSelector)s, %(clusterLabel)s="$cluster", namespace="$namespace", pod_name="$pod"}[1m])))' % $._config,
82- legendFormat='{{ pod_name }}' ,
86+ legendFormat='RX: pod = {{ pod_name }}' ,
87+ ))
88+ .addTarget(prometheus.target(
89+ 'sort_desc(sum by (pod_name) (rate(container_network_transmit_bytes_total{%(cadvisorSelector)s, %(clusterLabel)s="$cluster", namespace="$namespace", pod_name="$pod"}[1m])))' % $._config,
90+ legendFormat='TX: pod = {{ pod_name }}' ,
91+ ))
92+ );
93+
94+ local restartsRow = row.new()
95+ .addPanel(
96+ graphPanel.new(
97+ 'Total Restarts Per Container' ,
98+ datasource='$datasource' ,
99+ format='bytes' ,
100+ min=0 ,
101+ span=12 ,
102+ legend_rightSide=true ,
103+ legend_alignAsTable=true ,
104+ legend_current=true ,
105+ legend_avg=true ,
106+ )
107+ .addTarget(prometheus.target(
108+ 'max by (container) (kube_pod_container_status_restarts_total{%(kubeStateMetricsSelector)s, %(clusterLabel)s="$cluster", namespace="$namespace", pod="$pod", container=~"$container"})' % $._config,
109+ legendFormat='Restarts {{ container }}' ,
83110 ))
84111 );
85112
@@ -144,6 +171,7 @@ local numbersinglestat = promgrafonnet.numbersinglestat;
144171 )
145172 .addRow(memoryRow)
146173 .addRow(cpuRow)
147- .addRow(networkRow),
174+ .addRow(networkRow)
175+ .addRow(restartsRow),
148176 },
149177}
0 commit comments