这是本系列的第二篇文章, 这个系列记录了折腾 Grafana 过程中遇到的各种问题, 有兴趣可以看看( ̄︶ ̄)↗
书接上回, 实际上这个仪表盘去年年底就做出来了, 没想到因为全家都阳了加上太懒各种杂七杂八的事情直接拖到了正月十五ヾ(•ω•`)o
废话不多说,先上图:

相关链接
Grafana 官网链接:
食用方法
- 确保安装好 prometheus-podman-exporter, 可以参考上期文章:
- 确保运行参数包含
--collector.image, 开启收集镜像信息 (如果是按照上面的文章安装的话, 在/etc/default/prometheus-podman-exporter的ARGS="xxx"中加上即可) - 将 podman-exporter 添加到 Prometheus 配置文件中(一般位于
/etc/prometheus/prometheus.yml):
...
scrape_configs:
...
- job_name: podman
static_configs:
- targets:
- 'exporter1.com:9101' # 改成你的exporter的IP/端口
- 'exporter2.net:9101' # 可以添加多个
relabel_configs: # 添加label "instance", 值为target去掉端口
- target_label: instance
source_labels: [__address__]
regex: "(.*):([0-9]*)"
replacement: $1- 重启 Prometheus:
systemctl reload prometheus导入仪表盘, 推荐通过 Dashboard ID 导入, 输入后点击右边的
Load- 中文版:
17638 - 英文版:
17639

- 中文版:
选择第二步中包含有 podman-exporter 数据的 Prometheus:

导入完成, 此时
容器总览中应该会出现所有的容器的列表
使用提示
- 同时又多个实例上报数据时, 通过选项
宿主机可以选择不同的服务器查看详情
最后
喜欢的话麻烦在 GitHub 上点个Star, 或者去 grafana.com 上给个 review 让更多人看到吧ヾ(≧▽≦*)o