• Home
  • LLMs
  • Python
  • Docker
  • Kubernetes
  • Java
  • Maven
  • All
  • About
Docker | cAdvisor (Container Advisor)
  1. Notes
  2. Start cAdvisor
  3. Verify cAdvisor
  4. Use cAdvisor

  1. Notes
    See this page for more information: https://github.com/google/cadvisor

    cAdvisor (Container Advisor) provides information about containers (resource usage and performance characteristics).
  2. Start cAdvisor
    $ VERSION=v0.49.2
    $ sudo docker container 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 container ls
    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
  3. 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
          }
        }
      }
    }
  4. Use cAdvisor
    Open a browser and navigate to: http://localhost:8080/
    cAdvisor - Home Page

    cAdvisor - CPU
© 2025  mtitek