Skip to content

Commit 13a06e4

Browse files
authored
fix(dashboards): Graph mem usage w and w/o cache (#1001)
1 parent 95b9ce0 commit 13a06e4

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

dashboards/resources/node.libsonnet

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ local var = g.dashboard.variable;
175175
},
176176
]),
177177

178-
tsPanel.new('Memory Usage (w/o cache)')
178+
tsPanel.new('Memory Usage (w/cache)')
179179
+ tsPanel.standardOptions.withUnit('bytes')
180180
+ tsPanel.queryOptions.withTargets([
181181
prometheus.new(
@@ -202,6 +202,33 @@ local var = g.dashboard.variable;
202202
+ fieldOverride.byName.withProperty('custom.lineStyle', { fill: 'dash', dash: [10, 10] }),
203203
]),
204204

205+
tsPanel.new('Memory Usage (w/o cache)')
206+
+ tsPanel.standardOptions.withUnit('bytes')
207+
+ tsPanel.queryOptions.withTargets([
208+
prometheus.new(
209+
'${datasource}',
210+
'sum(kube_node_status_capacity{%(clusterLabel)s="$cluster", %(kubeStateMetricsSelector)s, node=~"$node", resource="memory"})' % $._config,
211+
)
212+
+ prometheus.withLegendFormat('max capacity'),
213+
214+
prometheus.new(
215+
'${datasource}',
216+
'sum(node_namespace_pod_container:container_memory_rss{%(clusterLabel)s="$cluster", node=~"$node", container!=""}) by (pod)' % $._config,
217+
)
218+
+ prometheus.withLegendFormat('{{pod}}'),
219+
])
220+
+ tsPanel.fieldConfig.defaults.custom.withStacking({ mode: 'normal' })
221+
+ tsPanel.standardOptions.withOverrides([
222+
fieldOverride.byName.new('max capacity')
223+
+ fieldOverride.byName.withPropertiesFromOptions(
224+
timeSeries.standardOptions.color.withMode('fixed')
225+
+ timeSeries.standardOptions.color.withFixedColor('red')
226+
)
227+
+ fieldOverride.byName.withProperty('custom.stacking', { mode: 'none' })
228+
+ fieldOverride.byName.withProperty('custom.hideFrom', { tooltip: true, viz: false, legend: false })
229+
+ fieldOverride.byName.withProperty('custom.lineStyle', { fill: 'dash', dash: [10, 10] }),
230+
]),
231+
205232
table.new('Memory Quota')
206233
+ table.standardOptions.withUnit('bytes')
207234
+ table.queryOptions.withTargets([

0 commit comments

Comments
 (0)