请问一下 怎麼通过 Prometheus 创建图表 有什么文档推荐一下
502647092 opened this issue · 15 comments
502647092 commented
请问一下 怎麼通过 Prometheus 创建图表 有什么文档推荐一下
cuigh commented
其实跟 Grafana 之类的工具写法是一样的,具体可以参考 Prometheus 官方文档,另外这里也有几个示例:#7
cuigh commented
网络流量监控服务状态页已经内置了吧,查询表达式是(依赖 cadvisor 数据):
- Receive:
sum(irate(container_network_receive_bytes_total{container_label_com_docker_swarm_service_name="${service}"}[5m])) by(name)
- Send:
sum(irate(container_network_transmit_bytes_total{container_label_com_docker_swarm_service_name="${service}"}[5m])) by(name)
cuigh commented
这个推荐用 node-exporter,查询表达式示例:sum(irate(node_network_receive_bytes_total[5m])) by(host_name)
cuigh commented
把图表的单位设置为 None 吧,Gauge 类型的图表目前对单位的处理不够完善,下个版本将修复此问题。 @502647092
cuigh commented
这个之前我也考虑过,不过在现在的版本上修改我需要先想好一个比较好的向下兼容方案
cuigh commented
@502647092 v0.8.1 已经支持单图表多指标,Gauge 图表的单位和小数点问题也已经修复
matri commented
cuigh commented
-
Prometheus 的说明在 Docker hub 上有:Prometheus
matri commented
感谢回复,我不确定您说的录入 Metrics 是什么概念,因为在 Prometheus 上面我是可以搜索各种 Metrics的,swirl 我尝试增加的图表也是复制您在另外一个 issue 里面给的样例,不知道是不是我漏了什么东西?
cuigh commented
看我上面的截图,图表这一块后来有调整,之前 issue 中的示例有些过时了(不过我刚修改了)
matri commented
看我上面的截图,图表这一块后来有调整,之前 issue 中的示例有些过时了(不过我刚修改了)
看明白了,应该是调整了以后之前的那个示例不能用了,因为我一直用导入功能测试,还以为是我配置有问题,现在ok了,非常感谢!