title: give node_exporter container access to network statistics from the host
body: <p>I would like to use prometheus's node_exporter in a container, but also have access to the host network's statistics.
  As I'm using prometheus and the other modules such as alertmanager or mysql-exporter also in containers, I don't want to simply use the host network, because then I wouldn't be able to easily connect prometheus to the node-exporter in a consistent way, given that prometheus is also deployed as a container. I'd like to use the docker logic (identifying services by names).
  This is the relevant part of the docker-compose:</p>
  
  <pre><code>             node_exporter:
                  build: "/root/prometheus-stack/node_exporter"
                  image: node_exporter:v0.18.1
                  volumes:
                    - /proc:/host/proc:ro
                    - /sys:/host/sys:ro
                    - /:/rootfs:ro
                  command:
                      - '--log.level=debug'
                      - '--path.procfs=/host/proc'
                      - '--path.sysfs=/host/sys'
                      - '--collector.filesystem.ignored-mount-points'
                      - '^/(sys|proc|dev|host|etc|rootfs/var/lib/docker/containers|rootfs/var/lib/docker/overlay2|rootfs/run/docker/netns|rootfs/var/lib/docker/aufs)($$|/)'
                  networks:
                    - back-tier
                  restart: always
  </code></pre>
  
  <p>As you can see I'm mounting the /proc pseudo file system, but unfortunately the statistics that I see are confined to the ones of the container, not the ones of the host. So I'll always going to see eth0, for instance, which is the interface of the container as seen from inside.
  Is there any way I could get around this so that I have a fully containerised prometheus stack?
  The other solution is cadvisor, which uses docker's socket, and I through that I can get network statistics for the server's main network interface, for instance. But that's not really nice.</p>
  
  <p>On the server I also have containerised reverse-proxies, so it would make it even harder to install prometheus and its modules directly on the host.</p>
  
  <p>So any ideas how I can smoothly give access to node-exporter to the host's network statistics?</p>
  
  <p>Thank you!</p>