Home
Docker
Kubernetes
Java
Ubuntu
Maven
Big Data
CI
Install
Samples
Archived
Docker
|
cAdvisor (Container Advisor)
Notes
Start cAdvisor
Verify cAdvisor
Use cAdvisor
Notes
Please see this page for more information:
https://github.com/google/cadvisor
cAdvisor (Container Advisor) provides information about containers (resource usage and performance characteristics).
Start cAdvisor
$ VERSION=v0.49.2
$ sudo docker run \ --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 \ --publish=8080:8080 \ --detach=true \ --name=cadvisor \ --privileged \ --device=/dev/kmsg \ gcr.io/cadvisor/cadvisor:$VERSION
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 6d6660a89ea4 gcr.io/google-containers/cadvisor:latest "/usr/bin/cadvisor -…" 47 seconds ago Up 45 seconds (healthy) 0.0.0.0:8080->8080/tcp cadvisor
Verify cAdvisor
Get supported API versions:
$ curl http://localhost:8080/api/
Supported API versions: v1.0,v1.1,v1.2,v1.3,v2.0,v2.1
Get supported request types:
$ curl http://localhost:8080/api/v2.1
Supported request types: "appmetrics,attributes,events,machine,machinestats,ps,spec,stats,storage,summary,version"
Get "
summary
" endpoint info:
$ curl http://localhost:8080/api/v2.1/summary | jq '.'
{ "/": { "timestamp": "YYYY-MM-DDTHH:MM:SS.111Z", "latest_usage": { "cpu": 111, "memory": 111 }, "minute_usage": { "percent_complete": 111, "cpu": { "present": true, "mean": 111, "max": 111, "fifty": 111, "ninety": 111, "ninetyfive": 111 }, "memory": { "present": true, "mean": 111, "max": 111, "fifty": 111, "ninety": 111, "ninetyfive": 111 } }, "hour_usage": { "percent_complete": 111, "cpu": { "present": true, "mean": 111, "max": 111, "fifty": 111, "ninety": 111, "ninetyfive": 111 }, "memory": { "present": true, "mean": 111, "max": 111, "fifty": 111, "ninety": 111, "ninetyfive": 111 } }, "day_usage": { "percent_complete": 111, "cpu": { "present": true, "mean": 111, "max": 111, "fifty": 111, "ninety": 111, "ninetyfive": 111 }, "memory": { "present": true, "mean": 111, "max": 111, "fifty": 111, "ninety": 111, "ninetyfive": 111 } } } }
Use cAdvisor
Open a browser and navigate to:
http://localhost:8080/
© 2025
mti
tek