Prometheus exporter missing wifi data

Hi!

I am trying to follow this tutorial on how to setup prometheus monitoring on OpenWRT, so I installed the packages:

opkg install prometheus-node-exporter-lua prometheus-node-exporter-lua-netstat prometheus-node-exporter-lua-openwrt prometheus-node-exporter-lua-wifi prometheus-node-exporter-lua-wifi_stations

and did the little dance to change the listening interface:

sed -i.bak 's#loopback#lan#g' /etc/config/prometheus-node-exporter-lua
/etc/init.d/prometheus-node-exporter-lua restart

and it … works, somewhat? At least Prometheus is scraping metrics, but I’m not seeing what I expected. The wifi stats, namely, are sorely missing.

It looks like the only wifi metrics exporter are the number of clients;

root@octavia:~# curl -s localhost:9100/metrics | grep wifi
# TYPE wifi_client gauge
wifi_client{iface="wlan0"} 1
wifi_client{iface="wlan1"} 2
node_exporter_scrape_duration_seconds{collector="wifi_clients",result="success"} 0.014352083206177
node_exporter_scrape_duration_seconds_sum{collector="wifi_clients",result="success"} 0.78434109687805
node_exporter_scrape_duration_seconds_count{collector="wifi_clients",result="success"} 62

This is odd! That metric is not available on another OpenWRT device, and that device has much more data:

$ curl -s 192.168.0.11:9100/metrics  | grep -c wifi_client
0
$ curl -s 192.168.0.11:9100/metrics  | grep -c wifi
73

I have also tried the prometheus-node-exporter-lua-hostapd_stations and prometheus-node-exporter-lua-hostapd_ubus_stations packages, neither of which show station stats.

Ideas?

Hi @anarcat,

If you just care about stats not particulary about using prometheus then you could use NetData shipped with Turris and feed that into InfluxDB or standard OpenWRT luci_statistics using collectd and also feeding InfluxDB (my preffered choice).

I do particularly care about using Prometheus, actually. :slight_smile:

That said, Netdata does support Prometheus metrics. Except it doesn’t look like it features access point metrics either. Plus the metrics names are rather bespoke things that are specific to netdata, and not easily reusable in dashboards and alerts. For example, here’s how netdata tracks uptime:

netdata_system_uptime_seconds_average{chart="system.uptime",family="uptime",dimension="uptime"} 3067340.0000000 1735936356000

while Prometheus’s node exporter tracks the time of the last boot (which, i think, is much more reasonable):

node_boot_time 1732869011

I will also point out that NetData is not anymore “shipped with Turris” than the Prometheus stuff is: it’s not installed by default and requires a opkg install, just like the other stuff I pasted above.

Yeah, that’s not an option.

Did you actually get wifi metrics going with that setup anyways? Because it sure doesn’t look like it works for netdata…