日常开发中用Grafana来渲染数据的时候,需要以一些中文别名来展示在图标下方,便于看图时理解。很简单,为每个图标设置别名模板即可。
官方给出的解释如下:
Alias patterns
replaced with measurement name
$measurement = replaced with measurement name
$1 – $9 = replaced with part of measurement name (if you separate your measurement name with dots)
$col = replaced with column name
$tag_exampletag = replaced with the value of the <i>exampletag</i> tag
You can also use [[tag_exampletag]] pattern replacement syntax
其实很简单,只要在query框中的alias by后面根据相应规则填写模板即可
如:$measurement即可展示表名
[[tag_exampletag]]即可获取tag域中exampletag字段的值,最终实现效果如下图。
» 订阅本站:https://www.kgraph.cn
» 转载请注明来源:九五青年博客 » 《Grafana alias by 配置别名 naming pattern》
写得不错哦!
写得不错哦!
写得不错哦!
写得不错哦!