Docker and Container Stats
3,539

Created 12/29/2017
Updated 12/29/2017
Revision 1
Categories
Docker
Grafana Version >=4.5.2
Datasources
Prometheus

需要对模板就行修改,在设置---templating 点击,修改label_values(up{job="container"}, instance),其中注意修改container,它是在prometheus里面的标签,cadvisor端口为8090 docker run
--volume=/:/rootfs:ro
--volume=/var/run:/var/run:rw
--volume=/sys:/sys:ro
--volume=/var/lib/docker/:/data/docker:ro
-p 8090:8080
--detach=true
--name=cadvisor
google/cadvisor:latest
-storage_driver=influxdb
-storage_driver_db=cadvisor

在prometheus.yml文件文件添加;根据实际情况修改ip

  • job_name: 'container' static_configs:
    • targets: ['182.20.14.2:8090','182.20.15.3:8090','182.20.15.4:8090','182.20.15.5:8090']
Get Dashboard
Download
Copy to Clipboard
Source Grafana.com