Prometheus-node-exporter-lua-textfile - disk metrics

How can I populate /var/prometheus/*.prom file(s) to graph out disk metrics? Is there some documentation I can review?

  • Storage Used
  • blks in/out
  • IO Wait
  • ...

Maybe I have not understood well, but you're using your hardware/router also as/for a Prometheus database?

Anyway you need to install the exporters/collectors via opkg, edit/configure the node exporter

root@R4S:/etc/config# cat prometheus-node-exporter-lua
config prometheus-node-exporter-lua 'main'
	option listen_interface '*'
	option listen_port '9100'
	option listen_ipv6 '0'

The collectors are here:

root@R4S:~# ls /usr/lib/lua/prometheus-collectors/
conntrack.lua      filefd.lua         nat_traffic.lua    netstat.lua        uname.lua
cpu.lua            loadavg.lua        netclass.lua       time.lua           wireguard.lua
entropy.lua        meminfo.lua        netdev.lua         uci_dhcp_host.lua

And after you will find the DB in your location

And remember to specify in prometheus.yml the correct targets/IP of the router.

Giuliomagnifico, thank you for replying.. I have the packages you specify installed, sending data to prometheus and dashboards created in Grafana.

My dashboards are missing disk/storage metrics. How can I use prometheus-*-textfile to collect disk data? I want to create a bash script to generate metrics and dump them into a text file, but I'm not sure how to begin..

Oh okay, only these are missing, unfortunately (as you can see from my folder above) they aren't availabe on opkg, you have to write them, or... I use collectd for those metrics, you can build exactly the same graphs in Grafana, the packages are

collectd-mod-disk
collectd-mod-df


(I'm not using the mod-df collector).

I'm using collect for almost all metrics

@giuliomagnifico, may I ask what your data flow looks like? collectd -> influxDB -> grafana?

No I'm using only Prometheus DB, sorry I forgot to mention the Collectd Exporter fo Prometheus, my mistake. I wrote some time ago how to achieve it, here.

Download the Collectd Exporter fo Prometheus package for your architecture, place the collect_exporter where you want, then enable it in your server/router/whatever. (I'm doing it in a non optimal way in crontab)

@reboot cd /home/dietpi/prometheus && ./collectd_exporter --collectd.listen-address=":25827"

And you have also to specify to the collectd network plugin on OpenWrt, where to write the metrics:

(never have a crash or anything in about one year).