prometheus-node-exporter-lua: wifi packets should be a counter
authorAlex Tomlins <alex@tomlins.org.uk>
Sun, 7 Apr 2019 13:08:31 +0000 (14:08 +0100)
committerAlex Tomlins <alex@tomlins.org.uk>
Mon, 8 Apr 2019 18:39:34 +0000 (19:39 +0100)
These output a count of the number of packets transmitted/received, so
should be tracked as a counter. As it stands, promtool is warning that
these shouldn't be named ending _total if they're a gauge.

Signed-off-by: Alex Tomlins <alex@tomlins.org.uk>
utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/wifi_stations.lua

index 19b5b1eab2a614437088d6d9b0e892d836202b49..d9095a96995cb20855d4da74aaae3a448f242332 100644 (file)
@@ -3,8 +3,8 @@ local iwinfo = require "iwinfo"
 
 local function scrape()
   local metric_wifi_station_signal = metric("wifi_station_signal_dbm","gauge")
-  local metric_wifi_station_tx_packets = metric("wifi_station_tx_packets_total","gauge")
-  local metric_wifi_station_rx_packets = metric("wifi_station_rx_packets_total","gauge")
+  local metric_wifi_station_tx_packets = metric("wifi_station_tx_packets_total","counter")
+  local metric_wifi_station_rx_packets = metric("wifi_station_rx_packets_total","counter")
 
   local u = ubus.connect()
   local status = u:call("network.wireless", "status", {})