From 7b081646bc6e215bf5072c76733818c4087a28c7 Mon Sep 17 00:00:00 2001 From: Andrew Kroh Date: Wed, 10 Jan 2018 06:08:37 -0500 Subject: [PATCH] Fix process cgroup memory values (#6034) The mem values were being reported for the memsw, kmem, and kmem_tcp values. Fixes #6033 (cherry picked from commit 49f6a194d146e79736d0c779162ad01d04972a76) --- CHANGELOG.asciidoc | 2 ++ metricbeat/module/system/process/cgroup.go | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 20116ff7e1b..5d8e2d94752 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -41,6 +41,8 @@ https://github.com/elastic/beats/compare/v6.1.1...6.1[Check the HEAD diff] *Metricbeat* +- Fix process cgroup memory metrics for memsw, kmem, and kmem_tcp. {issue}6033[6033] + *Packetbeat* *Winlogbeat* diff --git a/metricbeat/module/system/process/cgroup.go b/metricbeat/module/system/process/cgroup.go index a05de91069a..1ac7d676840 100644 --- a/metricbeat/module/system/process/cgroup.go +++ b/metricbeat/module/system/process/cgroup.go @@ -117,14 +117,14 @@ func cgroupMemoryToMapStr(memory *cgroup.MemorySubsystem) common.MapStr { addMemData := func(key string, m common.MapStr, data cgroup.MemoryData) { m[key] = common.MapStr{ - "failures": memory.Mem.FailCount, + "failures": data.FailCount, "limit": common.MapStr{ - "bytes": memory.Mem.Limit, + "bytes": data.Limit, }, "usage": common.MapStr{ - "bytes": memory.Mem.Usage, + "bytes": data.Usage, "max": common.MapStr{ - "bytes": memory.Mem.MaxUsage, + "bytes": data.MaxUsage, }, }, }