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

【BUG】使用变量+文本拼接成mertic内容之后,无法获取变量的值 #51

Open
totobo opened this issue Apr 22, 2021 · 2 comments

Comments

@totobo
Copy link

totobo commented Apr 22, 2021

$type为我本人自定义的一个变量,目的是为了在一张图里面可以看到集群、标准版两种不同类型Redis对应的指标信息。
在制图的时候,我在mertic里面用了${type}CpuUsage这样的用法,实际在发起请求的url里面$type没有转换成设置的变量的值,该变量可以在pannel的title里面正常展示。
测试过程中发现如果用$type-CpuUsage(变量和CpuUsage之间加了个-字符)这样发起请求的url里面是可以正常获取到$type的值的,但是metric的完整内容实际上是不能加其他字符的。截图如下:
无法获取$type值时候情况:
image
加了-字符后可以获取$type值时候情况:
image

@kakaNo1
Copy link

kakaNo1 commented Apr 27, 2021

请问下 你上面的实例别名是怎么获取到的?,目前我只有 id ,看着不怎么友好

@totobo
Copy link
Author

totobo commented Apr 28, 2021

请问下 你上面的实例别名是怎么获取到的?,目前我只有 id ,看着不怎么友好

找了个第三方开发的功能,在显示的时候展示instancename,查询的时候使用官方数据源根据instanceid去查。
GitHub地址:https://github.com/sunny0826/cms-grafana-builder @kakaNo1

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

2 participants