From a5c9b4aa0d855eac515020a4c1ae09ac64534ebf Mon Sep 17 00:00:00 2001 From: Brett Snyder Date: Thu, 6 May 2021 11:24:41 -0400 Subject: [PATCH] IN-3502: collect node memory available (#247) --- Dockerfile | 2 +- Makefile | 2 +- pkg/collector/node.go | 1 + pkg/decorate/compat/names.go | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 374f2246..18e38369 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.16.2 as build +FROM golang:1.16.3 as build ENV DOCKER_BUILD=1 ADD . /home/do-agent WORKDIR /home/do-agent diff --git a/Makefile b/Makefile index 145686fd..bc991bc0 100644 --- a/Makefile +++ b/Makefile @@ -47,7 +47,7 @@ go = docker run --rm -i \ -e "GOCACHE=$(docker_dir)/target/.cache/go" \ -v "$(CURDIR):$(docker_dir)" \ -w "$(docker_dir)" \ - golang:1.16.2 \ + golang:1.16.3 \ go else go = GOOS=$(GOOS) \ diff --git a/pkg/collector/node.go b/pkg/collector/node.go index 86b2a86a..d45b27b2 100644 --- a/pkg/collector/node.go +++ b/pkg/collector/node.go @@ -19,6 +19,7 @@ var metricWhitelist = []string{ "node_network_transmit_bytes_total", "node_memory_memtotal_bytes", + "node_memory_memavailable_bytes", "node_memory_memfree_bytes", "node_memory_cached_bytes", "node_memory_swapcached_bytes", diff --git a/pkg/decorate/compat/names.go b/pkg/decorate/compat/names.go index 09b69d8f..c9bfe98e 100644 --- a/pkg/decorate/compat/names.go +++ b/pkg/decorate/compat/names.go @@ -14,6 +14,7 @@ var nameConversions = map[string]string{ "node_memory_memtotal_bytes": "sonar_memory_total", "node_memory_memfree_bytes": "sonar_memory_free", "node_memory_cached_bytes": "sonar_memory_cached", + "node_memory_memavailable_bytes": "sonar_memory_available", "node_memory_swapcached_bytes": "sonar_memory_swap_cached", "node_memory_swapfree_bytes": "sonar_memory_swap_free", "node_memory_swaptotal_bytes": "sonar_memory_swap_total",