prometheus-node-exporter-lua: Fix broken textfile collector

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 <rob@hoelz.ro>
This commit is contained in:
Rob Hoelz
2025-07-14 21:23:35 -05:00
committed by Etienne Champetier
parent 81e9bbd6a5
commit 86e20d37a8
2 changed files with 3 additions and 2 deletions

View 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 <champetier.etienne@gmail.com>

View 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)