Java OpenResty Spring Spring Boot MySQL Redis MongoDB PostgreSQL Linux Android Nginx 面试 小程序 Arthas JVM AQS juc Kubernetes Docker DevOps


Prometheus+Grafana+cAdvisor 监控 Docker 容器

Prometheus Grafana DevOps 大约 945 字

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

阅读 646 · 发布于 2022-03-01

————        END        ————

Give me a Star, Thanks:)

https://github.com/fendoudebb

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

扫描二维码关注我
昵称:
随便看看 换一批