Skip to content

Commit

Permalink
fix(dashboards): Graph mem usage w and w/o cache (#1001)
Browse files Browse the repository at this point in the history
  • Loading branch information
skl authored Dec 17, 2024
1 parent 95b9ce0 commit 13a06e4
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion dashboards/resources/node.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ local var = g.dashboard.variable;
},
]),

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

tsPanel.new('Memory Usage (w/o cache)')
+ tsPanel.standardOptions.withUnit('bytes')
+ tsPanel.queryOptions.withTargets([
prometheus.new(
'${datasource}',
'sum(kube_node_status_capacity{%(clusterLabel)s="$cluster", %(kubeStateMetricsSelector)s, node=~"$node", resource="memory"})' % $._config,
)
+ prometheus.withLegendFormat('max capacity'),

prometheus.new(
'${datasource}',
'sum(node_namespace_pod_container:container_memory_rss{%(clusterLabel)s="$cluster", node=~"$node", container!=""}) by (pod)' % $._config,
)
+ prometheus.withLegendFormat('{{pod}}'),
])
+ tsPanel.fieldConfig.defaults.custom.withStacking({ mode: 'normal' })
+ tsPanel.standardOptions.withOverrides([
fieldOverride.byName.new('max capacity')
+ fieldOverride.byName.withPropertiesFromOptions(
timeSeries.standardOptions.color.withMode('fixed')
+ timeSeries.standardOptions.color.withFixedColor('red')
)
+ fieldOverride.byName.withProperty('custom.stacking', { mode: 'none' })
+ fieldOverride.byName.withProperty('custom.hideFrom', { tooltip: true, viz: false, legend: false })
+ fieldOverride.byName.withProperty('custom.lineStyle', { fill: 'dash', dash: [10, 10] }),
]),

table.new('Memory Quota')
+ table.standardOptions.withUnit('bytes')
+ table.queryOptions.withTargets([
Expand Down

0 comments on commit 13a06e4

Please sign in to comment.