prometheus-node-exporter-lua: Fix broken textfile collector
authorRob Hoelz <[email protected]>
Tue, 15 Jul 2025 02:23:35 +0000 (21:23 -0500)
committerEtienne Champetier <[email protected]>
Wed, 16 Jul 2025 15:11:22 +0000 (17:11 +0200)
A recent change (00d420e80) removed the `output` function, which textfile.lua was
using to output metrics.  So use the underlying output handle instead

Signed-off-by: Rob Hoelz <[email protected]>
utils/prometheus-node-exporter-lua/Makefile
utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/textfile.lua

index 725922602e283c6f099152cb466e71388ef94e4a..f043212156bf155079b83fc494d5f7b9c5ef7318 100644 (file)
@@ -4,7 +4,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=prometheus-node-exporter-lua
-PKG_VERSION:=2025.06.29
+PKG_VERSION:=2025.07.15
 PKG_RELEASE:=1
 
 PKG_MAINTAINER:=Etienne CHAMPETIER <[email protected]>
index 69c010fae09009e14f344d37c954fed3923bff37..81a1f6412b24e0253c9aee5cdef5ecdf095a8f3e 100644 (file)
@@ -4,7 +4,8 @@ local function scrape()
   local mtime_metric = metric("node_textfile_mtime_seconds", "gauge")
 
   for metrics in fs.glob("/var/prometheus/*.prom") do
-    output(get_contents(metrics), '\n')
+    out:write(get_contents(metrics))
+    out:write('\n')
     local stat = fs.stat(metrics)
     if stat then
       mtime_metric({ file = metrics }, stat.mtime)