Kratos

A responsible theme for WordPress

Grafana alias by 配置别名 naming pattern

日常开发中用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字段的值,最终实现效果如下图。

《Grafana alias by 配置别名 naming pattern》

点赞
  1. 顾 念说道:

    写得不错哦!

  2. 顾 念说道:

    写得不错哦!

  3. 顾 念说道:

    写得不错哦!

  4. 顾 念说道:

    写得不错哦!

发表评论

电子邮件地址不会被公开。 必填项已用*标注