google / cadvisor

Analyzes resource usage and performance characteristics of running containers.
Other
16.85k stars 2.31k forks source link

cadvisor not work as expected #3402

Open zengyijian916 opened 11 months ago

zengyijian916 commented 11 months ago

I'm trying to deploy a exporter container image which including node_exporter/mysqld_exporter/redis_exporter, cadvisor and so on. the base image is rockylinux 9.1. if this setup is work, I can upload the images to any nodes which I need monitor.

All this exporter I use "yum install xxx -y " to install it.

Now, all the other exporter is working as expected but cadvisor not. I think it's due to there is no docker pid and other neccessary docker info for cadvisor to collect. from the doc the following directory was needed by cadvisor. --volume=/:/rootfs:ro \ --volume=/var/run:/var/run:ro \ --volume=/sys:/sys:ro \ --volume=/var/lib/docker/:/var/lib/docker:ro \ --volume=/dev/disk/:/dev/disk:ro \ but as you know, the /var/run,/sys/ and /dev/disk three directories are already there in container base image. so can not mapping them from host. I can only mapping / and /var/lib/docker.

my question is: does cadvisor has a "--path.rootfs" option like node_exporter, node_exporter can running as "/usr/bin/node_exporter --path.rootfs=/rootfs" , it means ask the exporter to find everying in /rootfs. if cadvisor can do this. I think every information it need can find there.

or in this scenario. how can I make cadvisor work as expected. many thanks.

omega-tree commented 3 months ago

I too am experiencing this problem on a rocky 9 OS host , docker setup. NAME="Rocky Linux" VERSION="9.3 (Blue Onyx)"

Any help on getting this to run would be appreciated.