prometheus-node-exporter-lua: Change node_time_seconds type to "gauge"
authorForest Crossman <redacted>
Sun, 3 May 2020 08:01:08 +0000 (03:01 -0500)
committerForest Crossman <redacted>
Sun, 3 May 2020 20:16:14 +0000 (15:16 -0500)
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 <redacted>
utils/prometheus-node-exporter-lua/Makefile
utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/time.lua

index 3d676c385e564a4db09f23323d81cfbd40beba95..598b079b769b1725eaa1d6c73bb367488cad645a 100644 (file)
@@ -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 <champetier.etienne@gmail.com>
 PKG_LICENSE:=Apache-2.0
index 83c05290d864656b225b39317b95ffd6f0e38043..2cd68c02f1a45e415b542ba19e91e5d0b05840a9 100644 (file)
@@ -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 }
git clone https://git.99rst.org/PROJECT