From 850c8dc1418a8677c4b8f53e2fa56db6df446ac7 Mon Sep 17 00:00:00 2001 From: Forest Crossman Date: Sun, 3 May 2020 03:01:08 -0500 Subject: [PATCH] prometheus-node-exporter-lua: Change node_time_seconds type to "gauge" The official node_exporter reports node_time_seconds as a gauge, but prometheus-node-exporter-lua reports it as a counter. To be consistent with the official implementation, and because "gauge" is more correct than "counter" for this metric (system time can decrease, but the Prometheus documentation states, "A counter is a cumulative metric that represents a single monotonically increasing counter whose value can only increase or be reset to zero on restart."), change the type for node_time_seconds to "gauge". Signed-off-by: Forest Crossman --- utils/prometheus-node-exporter-lua/Makefile | 2 +- .../files/usr/lib/lua/prometheus-collectors/time.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/prometheus-node-exporter-lua/Makefile b/utils/prometheus-node-exporter-lua/Makefile index 3d676c385e..598b079b76 100644 --- a/utils/prometheus-node-exporter-lua/Makefile +++ b/utils/prometheus-node-exporter-lua/Makefile @@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=prometheus-node-exporter-lua PKG_VERSION:=2020.02.03 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_MAINTAINER:=Etienne CHAMPETIER PKG_LICENSE:=Apache-2.0 diff --git a/utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/time.lua b/utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/time.lua index 83c05290d8..2cd68c02f1 100644 --- a/utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/time.lua +++ b/utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/time.lua @@ -1,6 +1,6 @@ local function scrape() -- current time - metric("node_time_seconds", "counter", nil, os.time()) + metric("node_time_seconds", "gauge", nil, os.time()) end return { scrape = scrape } -- 2.30.2