mirror of
https://github.com/openwrt/packages.git
synced 2026-01-11 00:50:23 +04:00
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:
committed by
Etienne Champetier
parent
81e9bbd6a5
commit
86e20d37a8
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user