docker monitor — grafana+cAdvisor+prometheus

sudo docker run \
--volume=/:/rootfs:ro \
--volume=/var/run:/var/run:ro \
--volume=/sys:/sys:ro \
--volume=/home/docker/:/home/docker:ro \
--volume=/dev/disk/:/dev/disk:ro \
--publish=8080:8080 \
--detach=true \
--name=cadvisor \
gcr.io/google-containers/cadvisor:latest
# global config
global:
scrape_interval: 15s
evaluation_interval: 15s
rule_files:
# - "first_rules.yml"
# - "second_rules.yml"
# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
- job_name: 'prometheus'
static_configs:
- targets: ['localhost:9090']
- job_name: 'cadvisor'
scrape_interval: 10s
metrics_path: '/metrics'
static_configs:
- targets: ['localhost:8080']
labels:
group: 'cadvisor'
docker run -d -p 9090:9090  -v /etc/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml     prom/prometheus --name=prometheus
$ docker run -d -p 3000:3000 grafana/grafana

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store