Prometheus+Grafana+cAdvisor 监控 Docker 容器

Prometheus Grafana DevOps About 945 words

cAdvisor 下载地址

https://github.com/google/cadvisor/releases

添加可执行权限

chmod u+x cadvisor

后台启动

nohup /root/exporter/cadvisor -port=8080 > cadvisor.out 2>&1 &

可能出现的错误

解决办法:需要升级glibc版本

/root/exporter/cadvisor: /lib64/libc.so.6: version `GLIBC_2.32' not found (required by /root/exporter/cadvisor)

cadvisor 默认端口

http://localhost:8080

修改 Prometheus 配置

scrape_configs下新增job_namecadvisor(名称随意)

  - job_name: 'cadvisor'
    static_configs:
      - targets: ['192.168.0.100:8080']

完整的scrape_configs如下

scrape_configs:
  - job_name: "prometheus"
    static_configs:
      - targets: ["localhost:9090"]
  - job_name: 'cadvisor'
    static_configs:
      - targets: ['192.168.0.100:8080']

重启 Prometheus

重启后可查看cAdvisor是否上线。

http://localhost:9090/targets

Grafana Dashboard

Docker and system monitoring: https://grafana.com/grafana/dashboards/893

Docker Container: https://grafana.com/grafana/dashboards/11600

开源地址

https://github.com/google/cadvisor

Views: 2,489 · Posted: 2022-03-01

————        END        ————

Give me a Star, Thanks:)

https://github.com/fendoudebb/LiteNote

扫描下方二维码关注公众号和小程序↓↓↓

扫描下方二维码关注公众号和小程序↓↓↓


Today On History
Browsing Refresh