Prometheus Docker server monitoring and visualization Granfanna
cAdvisor (Container Advisor) for resource usage and performance information collection container is running.
Use Prometheus monitoring cAdvisor
cAdvisor container statistics are published as Prometheus indicators.
By default, these indicators provide at / metrics HTTP endpoint.
You can customize this endpoint by setting -prometheus_endpoint command-line flags.
To use the monitor cAdvisor Prometheus, only need to configure one or more jobs in Prometheus, these jobs will be scraped related cAdvisor process in the index at the end.
- Use the document: https: //github.com/google/cadvisor
- Chart template: https: //grafana.com/dashboards/193
Running a single cAdvisor to monitor the entire Docker host
1, after completion of the installation Docker monitoring terminal, container Enabler cAdvisor
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 \ google/cadvisor:latest
2, modify Promethus monitoring client configuration file: vim prometheus.yml
scrape_configs: # add operation, custom name - job_name: ' Docker ' # static add static_configs: # designated monitor Example - Targets: [ ' 47.98.138.176:8080 ' ]
3. Check and reload the configuration file
./promtool check config prometheus.yml
kill -hup PID
4, access to data is captured cAdvisor monitoring client: http: //47.98.138.176: 8080 / metrics
5, Prometheus monitoring client to see if intervention
6, Prometheus monitoring terminal search data docker
View average load cpu10 seconds: container_cpu_load_average_10s
7, Granfana introduced Docker monitoring chart
- Recommended icons ID: https: //grafana.com/dashboards/193
8, the input introduced into the pop-up icon ID wait 3 seconds follows, the modified storage
9, look at the icon monitoring dashboard