prometheus-node-exporter-lua: handle fancy release 6306/head
authorPaul Spooren <mail@aparcar.org>
Sun, 17 Jun 2018 08:01:57 +0000 (17:01 +0900)
committerPaul Spooren <mail@aparcar.org>
Sun, 17 Jun 2018 08:07:36 +0000 (17:07 +0900)
Some releases may have non letters in it's name currently resulting in
an empty ("") output which is then discarded, resulting in *missing*
labels in the metric.

Now it uses `.-` to catch as little as possible, but anything.

Signed-off-by: Paul Spooren <mail@aparcar.org>
utils/prometheus-node-exporter-lua/Makefile
utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/openwrt.lua

index 0c2fa8485e87247d59f8b9427050e75d0df7326e..5aa4cf8a20e1341b1b9c662157b98a6e28d159d9 100644 (file)
@@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=prometheus-node-exporter-lua
 PKG_VERSION:=2017.12.08
-PKG_RELEASE:=4
+PKG_RELEASE:=5
 
 PKG_MAINTAINER:=Christian Simon <simon@swine.de>
 PKG_LICENSE:=Apache-2.0
index 2f5030d7ad0fbd5d3ec405d6a499e43d6e80237e..8b9785a27dc0c4136fcab90d00c462ffa25f91de 100644 (file)
@@ -6,7 +6,7 @@ local labels = {
     board_name = string.sub(get_contents("/tmp/sysinfo/board_name"), 1, -2)
 }
 
-for k, v in string.gmatch(get_contents("/etc/openwrt_release"), "(DISTRIB_%w+)='(%w+)'\n") do
+for k, v in string.gmatch(get_contents("/etc/openwrt_release"), "(DISTRIB_%w+)='(.-)'\n") do
     if k == "DISTRIB_ID" then
         labels["id"] = v
     elseif k == "DISTRIB_RELEASE" then