Missing wlan1 metrics in Grafana Alloy setup

Hi everyone,

I’m using Grafana Alloy to collect system metrics from an Ubuntu host, with Prometheus as the backend. I followed the official tutorial here: Monitor Linux servers with Grafana Alloy | Grafana Alloy documentation, making a few adjustments for my environment.

Both Grafana Alloy and Prometheus are running in Docker containers. I can see metrics like:

  • node_network_transmit_bytes_total{device="eth0"}

  • node_network_transmit_bytes_total{device="lo"}

However, I’m not seeing metrics for node_network_transmit_bytes_total{device="wlan1"}.

Here’s a snippet of my setup:

Docker Compose:

grafana-alloy:
  image: grafana/alloy:latest
  ports:
    - "12345:12345"
    - "3101:3101"
  volumes:
    - ./config.alloy:/etc/alloy/config.alloy
    - alloy_data:/var/lib/alloy/data
    - /:/rootfs:ro
    - /sys:/sys:ro
  command: run --server.http.listen-addr=0.0.0.0:12345 --storage.path=/var/lib/alloy/data /etc/alloy/config.alloy

prometheus:
  image: prom/prometheus:latest
  ports:
    - "9090:9090"
  volumes:
    - ./prometheus.yml:/etc/prometheus/prometheus.yml

Alloy Config (config.alloy):

prometheus.exporter.unix "metrics" {
  disable_collectors = ["ipvs", "btrfs", "infiniband", "xfs", "zfs"]
  enable_collectors = ["meminfo"]

  netclass {
    ignored_devices = "^(veth.*|cali.*|[a-f0-9]{15})$"
  }

  netdev {
    device_exclude = "^(veth.*|cali.*|[a-f0-9]{15})$"
  }
}

Prometheus Config (prometheus.yml):


scrape_configs:
  - job_name: 'alloy'
    static_configs:
      - targets: ['grafana-alloy:12345']

Is there something I’m missing that would prevent wlan1 from being included in the metrics? Any advice or pointers would be greatly appreciated!

Thanks in advance!

If you want to monitor a server it’s easier to just install alloy directly. If you want to run Alloy in a container but gather metrics from the host, you must mount several host directories into the container (otherwise you’d be monitoring the container instead). This is why you are missing the NIC, because it’s not available inside the container.

I don’t remember what those directories are off the top of my head, but you should be able to find them with a search, it’s pretty similar to running node-exporter in a container.

Thanks for the reply! I’m currently mounting host directories and using the host network in my Docker Compose setup. It seems to be working well, and I’m able to collect the metrics I need.