当前位置:网站首页>Grafana shares links with variable parameters
Grafana shares links with variable parameters
2022-04-23 19:42:00 【Yang Linwei】
List of articles
Preface
There is a need recently , Is to put grafana Share the page on to the front end , As long as the front end gets the link, it can refresh the page by passing parameters .
So how do you do that ? From the description , We can know that there are several problems to be solved :
- How the front end can see the page without logging in and opening the link ?
- How to share links ?
- How to make sharing links with parameters ?
- How to get only the page you want ?
The following article focuses on these issues .
step1: Set login free
If you want to open it directly grafana Link without logging in , Need modification defaults.ini
.
Get into grafana Installation directory , Editors can access anonymously :
vi vi /opt/prometheus_env/grafana-8.4.7/conf/defaults.ini
The modification is as follows :
#################################### Anonymous Auth ######################
[auth.anonymous]
# enable anonymous access
enabled = true
And then restart grafana that will do .
step2: Share links
Sharing links is simple , Just click on the interface as shown in the figure below to share :
Share | Select the style and copy the link |
---|---|
The link we copied is like this :http:// Server address :3000/d/pcip2Ow7z/shi-shi-cai-ji-jian-kong-zhi-biao?orgId=1&from=1650593694199&to=1650615294199&theme=light&viewPanel=5
obviously , In this link , We can't pass in parameters , How to transfer parameters ? In fact, we need to define a global parameter first .
step3: Set global parameters
Click the settings button in the upper right corner :
Click on the variable module , and new A variable :
Set a variable , The contents are as follows :
Click on update after , Click again Save dashboard, On our template page , You can see an additional query input box :
This is not the most critical , Let's go in and set up the panel , Set the variable name in the panel :
ok, Come here , We can officially share the link
step4: Share links with parameters
Open link to share , And enter the content we want to query :
Copy the browser link :
You can see that this link has a query condition :var-exported_job
, So as long as we provide this link to the front end , And let the front end pass in var-exported_job
Value , You can query for different conditions .
But there is a problem , The interface has Grafana Status bar and menu bar , How can we get rid of it ?
step5: Optimize the interface
We add... After the link kiosk
Parameters , You can get rid of , Link modified as :
The effect is as follows :
see , Can this interface be used directly from the front end .
Okay , Here we are , This article is finished , I hope I can help you !
版权声明
本文为[Yang Linwei]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231923055662.html
边栏推荐
- JVM的类加载过程
- IIS数据转换问题16bit转24bit
- Build intelligent garbage classification applet based on Zero
- OpenHarmony开源开发者成长计划,寻找改变世界的开源新生力!
- 2021-2022-2 ACM training team weekly Programming Competition (8) problem solution
- C语言的十六进制printf为何输出有时候输出带0xFF有时没有
- The textarea cursor cannot be controlled by the keyboard due to antd dropdown + modal + textarea
- Class loading mechanism
- Software College of Shandong University Project Training - Innovation Training - network security shooting range experimental platform (8)
- No, some people can't do the National Day avatar applet (you can open the traffic master and earn pocket money)
猜你喜欢
Intuitive understanding of the essence of two-dimensional rotation
MySQL syntax collation (5) -- functions, stored procedures and triggers
Scrum Patterns之理解各种团队模式
Project training of Software College of Shandong University - Innovation Training - network security shooting range experimental platform (VII)
Project training of Software College of Shandong University - Innovation Training - network security shooting range experimental platform (V)
Building googlenet neural network based on pytorch for flower recognition
[报告] Microsoft :Application of deep learning methods in speech enhancement
深度学习——特征工程小总结
Build intelligent garbage classification applet based on Zero
Is meituan, a profit-making company with zero foundation, hungry? Coupon CPS applet (with source code)
随机推荐
【webrtc】Add x264 encoder for CEF/Chromium
RuntimeError: Providing a bool or integral fill value without setting the optional `dtype` or `out`
NiO related Basics
The usage of slice and the difference between slice and array
An algorithm problem was encountered during the interview_ Find the mirrored word pairs in the dictionary
Zero cost, zero foundation, build profitable film and television applet
山大网安靶场实验平台项目—个人记录(四)
No, some people can't do the National Day avatar applet (you can open the traffic master and earn pocket money)
How about Bohai futures. Is it safe to open futures accounts?
[报告] Microsoft :Application of deep learning methods in speech enhancement
VeraCrypt文件硬盘加密使用教程
Speculation on the way to realize the smooth drag preview of video editing software
MySQL数据库 - 单表查询(一)
How to select the third-party package of golang
IIS数据转换问题16bit转24bit
Lpc1768 optimization comparison of delay time and different levels
MySQL数据库 - 连接查询
2021-2022-2 ACM training team weekly Programming Competition (8) problem solution
Physical meaning of FFT: 1024 point FFT is 1024 real numbers. The actual input to FFT is 1024 complex numbers (imaginary part is 0), and the output is also 1024 complex numbers. The effective data is
LPC1768 关于延时Delay时间与不同等级的优化对比