Hands-on task
Load average as a metric
Write /usr/local/bin/loadmetric — a mini load average exporter. It reads /proc/loadavg and prints three metrics, one line each: node_load1, node_load5 and node_load15 — the values over 1, 5 and 15 minutes. Like the real node_exporter (the --path.procfs flag), the procfs directory can be substituted: if the PROCFS environment variable is set, the script reads $PROCFS/loadavg, otherwise /proc/loadavg. Save the output to /root/load.prom.
- prometheus
- /proc/loadavg
- metrics
- awk
- parsing