如何更改Graphite/Grafana中的x轴(按天绘制)?

编程入门 行业动态 更新时间:2024-10-08 06:27:07
本文介绍了如何更改Graphite/Grafana中的x轴(按天绘制)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想在石墨/格拉纳那上制作一个条形图,一周内每天有一条条形图.理想情况下,我们将在x轴标签上显示星期几(星期一,星期二...等),然后在图表中显示七个条形图,一周中的每一天一个.我似乎根本无法更改X轴.

I would like to have a bar graph in graphite/grafana that has a single bar per day, over the week. Ideally we would have the days of the week (Monday,Tuesday...etc) on the x axis labels, and then seven bars in the graph, one for each day of the week. I can't seem to change the X axis at all though.

思路: 我可以烹饪时间数据,并从纪元值开始将其发送固定时间,但这会导致grafana页面上的条形非常细.我可以编写一个脚本,以从代表整个一天的纪元值开始,以秒为单位发送大量指标,以使日常条形看起来很像,但这仍然无济于事,我无法更改x轴标签,而且看起来很可怕使用此工具的方式.

Thoughts: I could cook the time data, and send it a fixed time since epoch value, but this results in a very thin bar on the grafana page. I could write a script to send a huge amount of metrics with seconds since epoch values representing the entire day in order to make the semblance of a daily bar, but that still doesn't help me change x-axis labels and seems like a horrible way to use this tool.

这甚至可以用石墨来完成,还是严格关注实时图?

Can this even be done with graphite, or is it strictly focused on real time graphs?

推荐答案

尝试使用Graphite summarize()函数.在Grafana中,添加Graphite指标时,可以在转换"功能下找到它.使用"1d"按天进行汇总.

Try using the Graphite summarize() function. In Grafana you can find it under the "transform" functions when adding a Graphite metric. Use "1d" for aggregating by day.

然后转到显示样式",然后仅选中条形"复选框以获取条形图.

Then go to "Display Styles" and check only the "Bars" checkbox to get the bar plot.

但这不会在X轴上为您提供漂亮的Mo-Su标签.

This won't give you nice Mo-Su labels in the X axis though.

更多推荐

如何更改Graphite/Grafana中的x轴(按天绘制)?

本文发布于:2023-11-25 21:39:22,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1631444.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何更改   Graphite   Grafana

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!