Dashboard: Seeing network traffic per container

Problem/Question

I would like to see the Rx/Tx stats (both totals and current per-second) per container
Currently, I can see metrics for CPU, storage ..etc but not network traffic
I can’t find any details in the docs

I see many network interfaces (veth) but I don’t see the output per container

Environment/Browser/Agent’s version etc

Agent version: v2.3.2
Setup:

  • Running on MacOS Sequoia Mac Mini M4 chip
  • Running as a docker container managed by portioner

Docker compose:

services:
  netdata:
    image: netdata/netdata:stable
    container_name: netdata
    restart: unless-stopped
    ports:
      - 19999:19999
    cap_add:
      - SYS_PTRACE
      - SYS_ADMIN
    security_opt:
      - apparmor:unconfined
    volumes:
      - netdataconfig:/etc/netdata
      - netdatalib:/var/lib/netdata
      - netdatacache:/var/cache/netdata
      - /:/host/root:ro
      - /etc/passwd:/host/etc/passwd:ro
      - /etc/group:/host/etc/group:ro
      - /etc/localtime:/etc/localtime:ro
      - /proc:/host/proc:ro
      - /sys:/host/sys:ro
      - /etc/os-release:/host/etc/os-release:ro
      - /var/log:/host/var/log:ro
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - /run/dbus:/run/dbus:ro
    environment:
      - NETDATA_CLAIM_TOKEN=[redacted]
      - NETDATA_CLAIM_URL=https://app.netdata.cloud
      - NETDATA_CLAIM_ROOMS=[redacted]
volumes:
  netdataconfig:
  netdatalib:
  netdatacache:

Visuals


(interfaces)


(no network options under containers)

I would appreciate any help in achieving this :folded_hands::man_bowing:

Hi, @anonymous. Consider using Recommended Way. If you remove some privileges and mounts, you lose some functionality.

Hi ilyam8!!

Thank you for your prompt response :slight_smile:

Unless I’m mistaken, docker for Mac runs the daemon within a virtual machine so it can’t run host pid mode

So I’m stock with having to remove it otherwise I can’t run netdata in a container in docker on Mac

Are there any alternative solutions I could use to see the per-container traffic? ^^

Ah, it is macOS. I missed this detail, sorry. It is not possible then.

Correction: This is actually possible by using network=host. However, this configuration means the local UI won’t be directly accessible (I haven’t found a way to access it with this option). You’ll need to use app.netdata.cloud instead for monitoring.

  • Add network=host and pid=host.
  • Add this env var DOCKER_USR=root. This is needed for Netdata to be able to query the docker.sock. I see it is srw-rw---- 1 root root. Netdata needs to run as root to query it.

Thank you ilyam8!

Setting the network and pid to host, and giving root indeed shows the data through the cloud dashboard

I’m attempting to figure out a way to make it accessible locally since I want to forward the dashboard through my own tunnel :smile: