grafana / alloy

OpenTelemetry Collector distribution with programmable pipelines
https://grafana.com/oss/alloy
Apache License 2.0
1.47k stars 221 forks source link

Alloy running in docker does not see network interface metrics from the host #1933

Open maitmandel opened 1 month ago

maitmandel commented 1 month ago

What's wrong?

Alloy running in docker does not see counters for all interfaces. It does see that the interfaces exist, but most counters are empty:

Image

Notice how _node_networkinfo also lists devices like enx0 etc but _node_network_receive_bytestotal only has metrics from eth0 and lo

Steps to reproduce

Run Alloy in docker container, mounting the devices etc from host

System information

Ubuntu 24.04 LTS

Software version

Grafana Alloy v1.4.1

Configuration

compose.yaml:

services:
  alloy :
    image: grafana/alloy:v1.4.1
    volumes:
      - ./config.alloy:/etc/alloy/config.alloy
      - /var/log:/host-var-log
      - /proc:/host-proc
      - /sys:/host-sys
      - /:/host-root
      - /run/udev/data:/host-udev
    env_file:
      - .env
    cap_add:
      - SYS_PTRACE
    privileged: true
    command: run --storage.path=/var/lib/alloy/data /etc/alloy/config.alloy

config.alloy:

...
prometheus.exporter.unix "default" {
 procfs_path = "/host-proc/"
 sysfs_path = "/host-sys/"
 rootfs_path = "/host-root/"
 udev_data_path = "/host-udev/"
}
...

Logs

No response

github-actions[bot] commented 4 days ago

This issue has not had any activity in the past 30 days, so the needs-attention label has been added to it. If the opened issue is a bug, check to see if a newer release fixed your issue. If it is no longer relevant, please feel free to close this issue. The needs-attention label signals to maintainers that something has fallen through the cracks. No action is needed by you; your issue will be kept open and you do not have to respond to this comment. The label will be removed the next time this job runs if there is new activity. Thank you for your contributions!