What Is cAdvisor?
cAdvisor, short for Container Advisor, is Google's per-host daemon for container resource usage. It measures CPU, memory, disk and network for every container on the machine.
One process covers one host, and it watches the machine itself alongside the containers.
Docker needs no setup at all. Most other runtimes work as they are too, and Podman connects over its own socket flag.
The Advisor half of the name is optimistic. Advising on container performance still sits on the roadmap, so what you'll get today is measurement.
That narrow job is why it turns up almost everywhere. Underneath most container monitoring stacks there are cAdvisor numbers, collected directly or passed along by something else.
How Does cAdvisor Collect Container Metrics?
The numbers come from cgroups, which is the accounting the Linux kernel already keeps for every container.
Nothing gets installed inside your containers. The numbers exist whether anyone reads them or not, so cAdvisor doesn't have to do much beyond publishing what the kernel already tracks.
cAdvisor gathers stats on a timer it calls housekeeping. The per-container timer defaults to one second.
A global pass runs every minute as well, and it catches whatever the kernel events missed (which isn't usually much).
Containers nest the way the cgroup tree does. A pod and the containers inside it appear as separate levels.
That split is why a pod's figure and its containers' figures never get counted twice. Any container orchestration platform leans on it.
What Metrics Does cAdvisor Collect?
Four families come out of the box: CPU, memory, disk and network. The table gives each family and one metric name you will query.
Metric family | What it covers | A metric you will query |
CPU | Cumulative CPU time, throttled periods and throttled seconds | container_cpu_usage_seconds_total |
Memory | Working set, total usage, and the limit the container was given | container_memory_working_set_bytes |
Disk | Filesystem bytes consumed by the container | container_fs_usage_bytes |
Network | Bytes, packets, errors and drops per interface | container_network_receive_bytes_total |
CPU and network values are counters, so they only climb while the container lives. A rate function turns them into CPU utilization or throughput.
The memory and disk metrics are gauges, so they read straight off.
Watch working set rather than total usage. It's close to the memory the kernel can't reclaim, and crossing the limit on that figure is what gets a container killed.
Plenty more is there and switched off. Eleven metric groups stay disabled until you pass --enable_metrics, such as process, tcp, udp, sched and cpuset (the ones people usually go hunting for once a dashboard comes up short).
How Do You Run cAdvisor?
cAdvisor runs three ways, and one machine versus a whole cluster decides which.
How you run it | What it suits | What it takes |
Docker container | One host, and the quickest way to try it | A docker run with /, /var/run, /sys and /var/lib/docker mounted read only, and port 8080 published |
Standalone binary | Hosts without Docker, or tighter control over flags | A release binary run as a system service |
Kubernetes DaemonSet | One copy per node across a cluster | The manifests in the project's deploy directory |
The image moved registries at v0.53.0. Anything newer lives at ghcr.io/google/cadvisor, and the older gcr.io/cadvisor/cadvisor path covers only releases before that.
Port 8080 is the default however it starts, and the root of that port serves a web UI (plain, though it's fine for a quick look).
Is cAdvisor Already Running in Your Kubernetes Cluster?
In most clusters it already is. Every kubelet ships with cAdvisor built in and uses it for node summary metrics.
/metrics/cadvisor on the kubelet is where those numbers come out, and that is the endpoint to scrape in a cluster.
A separate DaemonSet therefore repeats much of what you already collect. Check the kubelet endpoint first, because you probably don't need one.
One cluster setting changes this. The PodAndContainerStatsFromCRI feature gate moves pod and container stats to the Container Runtime Interface.
Your container runtime has to support stats over CRI for that to work. Where cAdvisor was the source, CRI takes over, and that's a cluster-level choice rather than a cAdvisor one.
That matters if you build the same dashboards across Kubernetes clusters. A metric name on its own will not tell you which source filled it, so check the gate.
How Do cAdvisor, Prometheus and Grafana Fit Together?
The output is already in Prometheus format, served at /metrics. Prometheus scrapes it directly, with no exporter in between.
That path is the default, and --prometheus_endpoint moves it. Port 8080 carries the metrics and the web UI together.
Prometheus keeps the history that cAdvisor drops after two minutes. Grafana then reads from Prometheus to draw the dashboards.
Each piece does one job. cAdvisor only measures, which is why the other two have to exist.
Larger estates add a collector between the two. A telemetry pipeline can drop metric groups nobody queries before they reach storage.
Where Does cAdvisor Fall Short?
cAdvisor measures one machine and remembers two minutes. That suits live debugging and little else.
Limit | What it means in practice |
Two minutes of history, set by --storage_duration | Yesterday's spike has already gone, so a time-series database has to sit behind it |
One host per process | No cluster-wide or fleet-wide view without a layer that aggregates the hosts |
No alerting | Nothing fires when a container reaches its memory limit |
Eleven metric groups off by default | process, tcp, udp, sched, cpuset and others need --enable_metrics |
Containers only | No application traces, no logs, no network device data |
Broad host access | The quick start runs privileged and mounts the host filesystem, which needs review before production |
cAdvisor was built as a collector, and these limits mark that scope rather than any failing. They're also what decides when you need something behind it.
Why cAdvisor Metrics Need a Monitoring Backend
cAdvisor answers what a container is doing right now. Capacity planning, incident review and alerting all need the history it drops.
So most teams keep cAdvisor for collection and put a lasting store behind it for history, alerting and correlation.
Our own infrastructure monitoring covers Docker, Kubernetes and OpenShift in the same view as the servers, storage and network underneath them.
Application detail can come from the same place. eBPF instrumentation collects it on Docker hosts with no code changes and no restart.
Docker application monitoring then ties that detail back to the container the code ran in.
Container metrics on their own rarely explain an incident. Knowing a container hit its memory limit matters less than knowing which service slowed down for users.
Getting that second answer takes the container data and the rest of the stack in one place.
Explore More IT Terms
Browse our comprehensive IT glossary to learn more about technology terminology.