Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.

Commit 885d532

Browse files
authored
Merge pull request #229 from grafana/fix-memory-panels
Fixed workingset memory panel while rolling out a StatefulSet
2 parents 10cda97 + 19f29fd commit 885d532

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
- Cortex / Queries: added "Lazy loaded index-headers" and "Index-header lazy load duration"
1515
- Cortex / Compactor: added "Tenants compaction progress"
1616
- Alerts: added "CortexMemoryMapAreasTooHigh"
17+
* [BUGFIX] Fixed workingset memory panel while rolling out a StatefulSet. #229
1718

1819
## 1.5.0 / 2020-11-12
1920

cortex-mixin/dashboards/dashboard-utils.libsonnet

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,9 @@ local utils = import 'mixin-utils/utils.libsonnet';
136136
containerMemoryWorkingSetPanel(title, containerName)::
137137
$.panel(title) +
138138
$.queryPanel([
139-
'sum by(pod) (container_memory_working_set_bytes{%s,container="%s"})' % [$.namespaceMatcher(), containerName],
139+
// We use "max" instead of "sum" otherwise during a rolling update of a statefulset we will end up
140+
// summing the memory of the old pod (whose metric will be stale for 5m) to the new pod.
141+
'max by(pod) (container_memory_working_set_bytes{%s,container="%s"})' % [$.namespaceMatcher(), containerName],
140142
'min(container_spec_memory_limit_bytes{%s,container="%s"} > 0)' % [$.namespaceMatcher(), containerName],
141143
], ['{{pod}}', 'limit']) +
142144
{

0 commit comments

Comments
 (0)