3

I cannot find any disk usage traces in Prometheus of the containers I'm monitoring with cadvior. All of them have a value of 0. The only ones that have values are the ones with id="/".

enter image description here

All the non-root entries are 0. I checked with the query

changes(container_fs_usage_bytes{id!="/"}[60m] offset 215h)

There are no changes, it's always 0. I'm running my containers on CentOS 7.3 and they are managed by a DCOS cluster. I launch the cadvisor instances with the command:

sudo docker run --volume=/:/rootfs:ro --volume=/var/run:/var/run:rw --volume=/sys:/sys:ro --volume=/var/lib/docker/:/var/lib/docker:ro --volume=/dev/disk/:/dev/disk:ro --volume=/cgroup:/cgroup:ro --publish=8082:8080 --privileged=true --detach=true --name=cadvisor google/cadvisor:latest

So I can make sure that the proper permissions are set. Why can I see some kind of aggregated metric with the id="/" tag but I cannot see stats per container?

Brandon
  • 440
  • 3
  • 19

2 Answers2

0

You're only bind-mounting "/dev/disk" while you seem to be using the device mapper Docker storage driver, which relies on other locations under "dev" (such as "/dev/mapper" where virtual devices are exposed). Bind-mounting the whole "/dev" filesystem should fix your issue.

bamarni
  • 1
  • 1
0

Use below query:

sum(container_fs_writes_bytes_total{container_label_com_docker_swarm_node_id=~".+", id=~"/docker/.*"}) by (container_label_com_docker_swarm_service_name)
Aziz Zoaib
  • 477
  • 4
  • 17