mirror of
https://github.com/openwrt/packages.git
synced 2026-01-10 11:44:48 +00:00
prometheus-node-exporter-lua: handle empty lines in all_sta output correctly
An empty line has a name and value that is nil and setting a table index to nil breaks metrics for every vif after the first one. Signed-off-by: Martin Weinelt <hexa@darmstadt.ccc.de>
This commit is contained in:
committed by
Etienne Champetier
parent
6d85547f24
commit
0a9d2b818d
@@ -129,7 +129,9 @@ local function scrape()
|
||||
current_station_values = {}
|
||||
else
|
||||
local name, value = string.match(line, "(.+)=(.+)")
|
||||
current_station_values[name] = value
|
||||
if name ~= nil then
|
||||
current_station_values[name] = value
|
||||
end
|
||||
end
|
||||
end
|
||||
labels.station = current_station
|
||||
|
||||
Reference in New Issue
Block a user