From c4e65c7c16475503bd41e673e2596d7d3d5a2a72 Mon Sep 17 00:00:00 2001 From: Roman Kulayev Date: Thu, 19 Jan 2023 18:33:15 +0400 Subject: [PATCH 1/2] Fix cpu and memory stats Fixes https://github.com/prometheus-community/ecs_exporter/issues/40 Signed-off-by: Roman Kulayev --- ecsmetadata/client.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ecsmetadata/client.go b/ecsmetadata/client.go index 191ec15..8e0342d 100644 --- a/ecsmetadata/client.go +++ b/ecsmetadata/client.go @@ -94,9 +94,9 @@ type ContainerStats struct { ID string `json:"id"` NumProcs float64 `json:"num_procs"` - CPUStats dockertypes.CPUStats - PreCPUStats dockertypes.CPUStats - MemoryStats dockertypes.MemoryStats + CPUStats dockertypes.CPUStats `json:"cpu_stats"` + PreCPUStats dockertypes.CPUStats `json:"precpu_stats"` + MemoryStats dockertypes.MemoryStats `json:"memory_stats"` Networks map[string]struct { RxBytes float64 `json:"rx_bytes"` From 664f5de3fd9dc74751d67188caa6c4fba3b9ff57 Mon Sep 17 00:00:00 2001 From: Roman Kulayev Date: Tue, 24 Jan 2023 10:31:29 +0400 Subject: [PATCH 2/2] fix: go fmt Co-authored-by: Ben Kochie Signed-off-by: Roman Kulayev --- ecsmetadata/client.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ecsmetadata/client.go b/ecsmetadata/client.go index 8e0342d..dac922c 100644 --- a/ecsmetadata/client.go +++ b/ecsmetadata/client.go @@ -94,8 +94,8 @@ type ContainerStats struct { ID string `json:"id"` NumProcs float64 `json:"num_procs"` - CPUStats dockertypes.CPUStats `json:"cpu_stats"` - PreCPUStats dockertypes.CPUStats `json:"precpu_stats"` + CPUStats dockertypes.CPUStats `json:"cpu_stats"` + PreCPUStats dockertypes.CPUStats `json:"precpu_stats"` MemoryStats dockertypes.MemoryStats `json:"memory_stats"` Networks map[string]struct {