Prometheus node exporter getting 500 error

Hi all,

I've been trying to export some metrics to my prometheus installation to get some monitoring of my router into Grafana dashboards. I came across this tutorial and installed the following packages:

  • prometheus-node-exporter-lua
  • prometheus-node-exporter-lua-netstat
  • prometheus-node-exporter-lua-openwrt
  • prometheus-node-exporter-lua-nat_traffic

(I didn't install the wifi related packages as I've disabled the wireless radio on my pi as this function is being handled on my LAN by other equipment - Unifi APs).

It would seem that everything is installed correctly but when I try to validate the metrics I see error 500 message returned from http://ROUTER_IP:9100/metrics as per below...

❯ curl http://ROUTER_IP:9100/metrics
# TYPE node_scrape_collector_duration_seconds gauge
# TYPE node_scrape_collector_success gauge
# TYPE node_nf_conntrack_entries gauge
node_nf_conntrack_entries 409
# TYPE node_nf_conntrack_entries_limit gauge
node_nf_conntrack_entries_limit 65536
node_scrape_collector_duration_seconds{collector="conntrack"} 0.00063896179199219
node_scrape_collector_success{collector="conntrack"} 1
# TYPE node_boot_time_seconds gauge
node_boot_time_seconds 1745322816
# TYPE node_context_switches_total counter
node_context_switches_total 78983
# TYPE node_cpu_seconds_total counter
node_cpu_seconds_total{cpu="cpu0",mode="user"} 1.14
node_cpu_seconds_total{cpu="cpu0",mode="nice"} 0
node_cpu_seconds_total{cpu="cpu0",mode="system"} 1.79
node_cpu_seconds_total{cpu="cpu0",mode="idle"} 543
node_cpu_seconds_total{cpu="cpu0",mode="iowait"} 0.16
node_cpu_seconds_total{cpu="cpu0",mode="irq"} 0
node_cpu_seconds_total{cpu="cpu0",mode="softirq"} 0.13
node_cpu_seconds_total{cpu="cpu0",mode="steal"} 0
node_cpu_seconds_total{cpu="cpu0",mode="guest"} 0
node_cpu_seconds_total{cpu="cpu0",mode="guest_nice"} 0
node_cpu_seconds_total{cpu="cpu1",mode="user"} 0.99
node_cpu_seconds_total{cpu="cpu1",mode="nice"} 0
node_cpu_seconds_total{cpu="cpu1",mode="system"} 2.15
node_cpu_seconds_total{cpu="cpu1",mode="idle"} 543.14
node_cpu_seconds_total{cpu="cpu1",mode="iowait"} 0.07
node_cpu_seconds_total{cpu="cpu1",mode="irq"} 0
node_cpu_seconds_total{cpu="cpu1",mode="softirq"} 0.13
node_cpu_seconds_total{cpu="cpu1",mode="steal"} 0
node_cpu_seconds_total{cpu="cpu1",mode="guest"} 0
node_cpu_seconds_total{cpu="cpu1",mode="guest_nice"} 0
node_cpu_seconds_total{cpu="cpu2",mode="user"} 0.85
node_cpu_seconds_total{cpu="cpu2",mode="nice"} 0
node_cpu_seconds_total{cpu="cpu2",mode="system"} 0.9
node_cpu_seconds_total{cpu="cpu2",mode="idle"} 545.57
node_cpu_seconds_total{cpu="cpu2",mode="iowait"} 0.08
node_cpu_seconds_total{cpu="cpu2",mode="irq"} 0
node_cpu_seconds_total{cpu="cpu2",mode="softirq"} 0.03
node_cpu_seconds_total{cpu="cpu2",mode="steal"} 0
node_cpu_seconds_total{cpu="cpu2",mode="guest"} 0
node_cpu_seconds_total{cpu="cpu2",mode="guest_nice"} 0
node_cpu_seconds_total{cpu="cpu3",mode="user"} 1.16
node_cpu_seconds_total{cpu="cpu3",mode="nice"} 0
node_cpu_seconds_total{cpu="cpu3",mode="system"} 1.03
node_cpu_seconds_total{cpu="cpu3",mode="idle"} 544.94
node_cpu_seconds_total{cpu="cpu3",mode="iowait"} 0.11
node_cpu_seconds_total{cpu="cpu3",mode="irq"} 0
node_cpu_seconds_total{cpu="cpu3",mode="softirq"} 0.07
node_cpu_seconds_total{cpu="cpu3",mode="steal"} 0
node_cpu_seconds_total{cpu="cpu3",mode="guest"} 0
node_cpu_seconds_total{cpu="cpu3",mode="guest_nice"} 0
# TYPE node_intr_total counter
node_intr_total 204171
# TYPE node_forks_total counter
node_forks_total 3195
# TYPE node_procs_running_total gauge
node_procs_running_total 1
# TYPE node_procs_blocked_total gauge
node_procs_blocked_total 0
node_scrape_collector_duration_seconds{collector="cpu"} 0.0023951530456543
node_scrape_collector_success{collector="cpu"} 1
Status: 500 Internal Server Error

Unable to launch the requested Lua program:
  /usr/bin/prometheus-node-exporter-lua: /usr/bin/prometheus-node-exporter-lua:59: attempt to index local 'collector' (a boolean value)

Does anyone have any idea why this might be?

ubus call system board
{
	"kernel": "5.15.162",
	"hostname": "XXX",
	"system": "ARMv8 Processor rev 3",
	"model": "Raspberry Pi 4 Model B Rev 1.2",
	"board_name": "raspberrypi,4-model-b",
	"rootfs_type": "ext4",
	"release": {
		"distribution": "OpenWrt",
		"version": "23.05.4",
		"revision": "r24012-d8dd03c46f",
		"target": "bcm27xx/bcm2711",
		"description": "OpenWrt 23.05.4 r24012-d8dd03c46f"
	}
}