An OpenTelemetry Collector receiver that collects WiFi interface metrics using the netlink API on Linux systems.
This receiver collects WiFi statistics from wireless network interfaces, including:
- Interface metrics: Operating frequency
- BSS (Basic Service Set) information: SSID, BSSID, connection mode
- Station statistics: Signal strength, bitrates, packet/byte counts, connection duration, and error metrics
The receiver supports the following configuration:
receivers:
wifi:
collection_interval: 1m # How often to scrape WiFi metrics (default: 1m)The receiver emits the following metrics:
wifi.interface.frequency(MHz): The current frequency a WiFi interface is operating at, in megahertzwifi.station.info(1): Labeled WiFi interface station information (with attributes: device, bssid, ssid, mode)wifi.station.inactive(s): Seconds since any wireless activity has occurredwifi.station.receive.bitrate(bps): Current WiFi receive bitratewifi.station.transmit.bitrate(bps): Current WiFi transmit bitratewifi.station.signal(dBm): Current WiFi signal strength
wifi.station.connected.total(s): Total seconds a station has been connectedwifi.station.receive.bytes(By): Total bytes receivedwifi.station.transmit.bytes(By): Total bytes transmittedwifi.station.transmit.retries(1): Total packet transmission retrieswifi.station.transmit.failed(1): Total failed packet transmissionswifi.station.beacon.loss(1): Total beacon losses detectedwifi.station.transmitted.packets(1): Total packets transmittedwifi.station.received.packets(1): Total packets received
wifi.survey.noise(dBm): The noise level in decibel-milliwattswifi.survey.in_use(1): Indicates if the channel is currently in use (1 for in use, 0 for not in use)
wifi.survey.channel.time(s): Total time the radio spent on the channelwifi.survey.channel.time.active(s): Total time the radio spent on the channel while it was activewifi.survey.channel.time.busy(s): Total time the radio spent on the channel while it was busywifi.survey.channel.time.ext_busy(s): Total time the radio spent on the channel while it was busy with external trafficwifi.survey.channel.time.bss_rx(s): Total time the radio spent on the channel receiving data from a BSSwifi.survey.channel.time.rx(s): Total time the radio spent on the channel receiving datawifi.survey.channel.time.tx(s): Total time the radio spent on the channel transmitting datawifi.survey.channel.time.scan(s): Total time the radio spent on the channel while it was scanning
device: The network interface name (e.g.,wlan0)
device: The network interface name (e.g.,wlan0)mac_address: The MAC address of the station
device: The network interface name (e.g.,wlan0)bssid: The BSSID of the access pointssid: The SSID of the networkmode: Connection mode -client,ad-hoc, orunknown
device: The network interface name (e.g.,wlan0)frequency_mhz: The frequency in megahertz
- Linux operating system
- Access to netlink (usually requires running as root or with
CAP_NET_ADMINcapability) - WiFi network interface
This receiver requires elevated permissions to access the netlink API. The collector process needs to either:
- Run as root, or
- Have the
CAP_NET_ADMINcapability
receivers:
wifi:
collection_interval: 30s
exporters:
otlp:
endpoint: localhost:4317
service:
pipelines:
metrics:
receivers: [wifi]
exporters: [otlp]This receiver is inspired by the Prometheus node_exporter WiFi collector and uses the mdlayher/wifi package to interact with the Linux netlink API.