This error keeps repeating in the logs. I think it began after upgrading OpenWRT from 23 to 24.10.1:
/lua/prometheus-collectors/netclass.lua:36: attempt to compare number with nil/usr/lib/lua/prometheus-collectors/netclass.lua:36: attempt to compare number with nil
This is emitted once a minute (the timestamps in the logs are 12 minutes apart, and the message appears 12 times on each line, so I assume it's buffered once a minute until the line becomes too long for the buffer and is sent). The scraper's interval is set to the default of 1 minute, so that could be related.
As far as I can tell, the metrics are exported fine (I track them using an external Prometheus scraper which pushes the results to Grafana Cloud, I implemented the steps described in How I monitor my OpenWrt router with Grafana Cloud and Prometheus)
This is on a system with the following os-release
info:
NAME="OpenWrt"
VERSION="24.10.1"
ID="openwrt"
ID_LIKE="lede openwrt"
PRETTY_NAME="OpenWrt 24.10.1"
VERSION_ID="24.10.1"
HOME_URL="https://openwrt.org/"
BUG_URL="https://bugs.openwrt.org/"
SUPPORT_URL="https://forum.openwrt.org/"
BUILD_ID="r28597-0425664679"
OPENWRT_BOARD="bcm53xx/generic"
OPENWRT_ARCH="arm_cortex-a9"
OPENWRT_TAINTS=""
OPENWRT_DEVICE_MANUFACTURER="OpenWrt"
OPENWRT_DEVICE_MANUFACTURER_URL="https://openwrt.org/"
OPENWRT_DEVICE_PRODUCT="Generic"
OPENWRT_DEVICE_REVISION="v0"
OPENWRT_RELEASE="OpenWrt 24.10.1 r28597-0425664679"
OPENWRT_BUILD_DATE="1744562312"
The only other recent question mentioning the prometheus-node-exporter-lua
package family is here: Prometheus node exporter getting 500 error, but there are no replies on it, and I'm not sure it's related (I don't get HTTP 500
from the exporter).
I tried to dig into the source code and think that I found it here: https://github.com/openwrt/packages/blob/master/utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/netclass.lua#L36 is this the correct place to look at?
Thanks.