Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请问一下 怎麼通过 Prometheus 创建图表 有什么文档推荐一下 #13

Closed
502647092 opened this issue May 10, 2018 · 15 comments

Comments

@502647092
Copy link

No description provided.

@cuigh
Copy link
Owner

cuigh commented May 11, 2018

其实跟 Grafana 之类的工具写法是一样的,具体可以参考 Prometheus 官方文档,另外这里也有几个示例:#7

@502647092
Copy link
Author

@cuigh 请教一下 网络流量监控的语法怎么写 研究了半天没搞懂

@cuigh
Copy link
Owner

cuigh commented Jun 27, 2018

网络流量监控服务状态页已经内置了吧,查询表达式是(依赖 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)

@502647092
Copy link
Author

@cuigh emm 我想要的是node节点的网络统计

@cuigh
Copy link
Owner

cuigh commented Jun 28, 2018

这个推荐用 node-exporter,查询表达式示例:sum(irate(node_network_receive_bytes_total[5m])) by(host_name)

@502647092
Copy link
Author

@cuigh
image
这个是怎么回事儿 百分比好多小数点
image
这个是配置

@cuigh
Copy link
Owner

cuigh commented Jun 28, 2018

把图表的单位设置为 None 吧,Gauge 类型的图表目前对单位的处理不够完善,下个版本将修复此问题。 @502647092

@502647092
Copy link
Author

@cuigh 还有就是希望可以叠加多条查询的结果 比如 入网出网同一个图标显示

@cuigh
Copy link
Owner

cuigh commented Jun 28, 2018

这个之前我也考虑过,不过在现在的版本上修改我需要先想好一个比较好的向下兼容方案

@cuigh
Copy link
Owner

cuigh commented Jul 2, 2018

@502647092 v0.8.1 已经支持单图表多指标,Gauge 图表的单位和小数点问题也已经修复

@matri
Copy link

matri commented Mar 3, 2019

hello,我添加图表的时候有一些问题,不确定哪里做错了,麻烦帮忙看一下:

Prometheus的情况是这样的:

prometheus

然后swirl的配置是这样的,也按要求重启了swirl service:

swirl

然后我在swirl后台增加图表的时候,一直报这样的错:

error

不知道还有哪里有问题,swirl也没有错误日志,谢谢!另外fork版的 Prometheus 是否有使用指引?

@cuigh
Copy link
Owner

cuigh commented Mar 4, 2019

  1. 没有录入 Metrics 吧
    Metrics

  2. Prometheus 的说明在 Docker hub 上有:Prometheus

@matri
Copy link

matri commented Mar 4, 2019

感谢回复,我不确定您说的录入 Metrics 是什么概念,因为在 Prometheus 上面我是可以搜索各种 Metrics的,swirl 我尝试增加的图表也是复制您在另外一个 issue 里面给的样例,不知道是不是我漏了什么东西?

@cuigh
Copy link
Owner

cuigh commented Mar 4, 2019

看我上面的截图,图表这一块后来有调整,之前 issue 中的示例有些过时了(不过我刚修改了)

@matri
Copy link

matri commented Mar 4, 2019

看我上面的截图,图表这一块后来有调整,之前 issue 中的示例有些过时了(不过我刚修改了)

看明白了,应该是调整了以后之前的那个示例不能用了,因为我一直用导入功能测试,还以为是我配置有问题,现在ok了,非常感谢!

@cuigh cuigh closed this as completed Apr 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants