Implementation method of Prometheus Monitoring docker Service
Procedure:
Sudo docker run\-- restart=always\-- 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:v0.33.0echo 'global: scrape_ Interval: 15s scrape_timeout: 10s evaluation_interval: 15salerting: alertmanagers:-static_configs:-targets: [] scheme: http timeout: 10sultrapeeled configs job_name-job_name: prometheus scrape_interval: 15s scrape_timeout: 10s metrics_path: / metrics scheme: http static_configs:-targets: [localhost:9090 Tx.20has.win:8080] #-localhost:9090#-tx.20has.win:8080' > / data/docker/prometheus/prometheus.ymldocker run-d\-- name prometheus\-- restart=always\-p9090 tx.20has.win:8080' 9090\-v / data/docker/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml\-v / prometheus\ prom/prometheusdocker run-d-restart=always-- name=grafana-p 3000 grafana/grafana
Summary:
Recommend the template number of a monitoring container that is easy to use with garafan: 3125
Architecture: cadvisor collects container information-> prometheus (supports the cadvisor plug-in as the collection side)-> grafana shows
Prometheus is not a real-time monitoring solution, and the default is to display data every 15s.
The display results are as follows: