当前位置:网站首页>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
边栏推荐
- MySQL lock
- Steps to build a deep learning environment GPU
- What is a message queue
- 深度分析数据恢复原理——那些数据可以恢复那些不可以数据恢复软件
- Project training of Software College of Shandong University - Innovation Training - network security shooting range experimental platform (VII)
- 精简CUDA教程——CUDA Driver API
- 山东大学软件学院项目实训-创新实训-网络安全靶场实验平台(五)
- 命令-sudo
- Web Security
- 点云数据集常用处理
猜你喜欢
MySQL syntax collation (5) -- functions, stored procedures and triggers
Application of DCT transform
Decompile and get the source code of any wechat applet - just read this (latest)
【webrtc】Add x264 encoder for CEF/Chromium
Garbage collector and memory allocation strategy
基于pytorch搭建GoogleNet神经网络用于花类识别
Intuitive understanding of the essence of two-dimensional rotation
antd dropdown + modal + textarea导致的textarea光标不可被键盘控制问题
JVM的类加载过程
Unity创建超写实三维场景的一般步骤
随机推荐
Thoughts on the optimization of examination papers in the examination system
Project training of Software College of Shandong University - Innovation Training - network security shooting range experimental platform (6)
Easy mock local deployment (you need to experience three times in a crowded time. Li Zao will do the same as me. Love is like a festival mock)
Is meituan, a profit-making company with zero foundation, hungry? Coupon CPS applet (with source code)
Using oes texture + glsurfaceview + JNI to realize player picture processing based on OpenGL es
Decompile and get the source code of any wechat applet - just read this (latest)
php参考手册String(7.2千字)
MySQL syntax collation (4)
OpenHarmony开源开发者成长计划,寻找改变世界的开源新生力!
ESP8266-入门第一篇
Zero cost, zero foundation, build profitable film and television applet
How to select the third-party package of golang
MFC obtains local IP (used more in network communication)
Some speculation about the decline of adults' language learning ability
MySQL practical skills
山大网安靶场实验平台项目-个人记录(五)
什么是消息队列
No, some people can't do the National Day avatar applet (you can open the traffic master and earn pocket money)
机器学习目录
如何在BNB链上创建BEP-20通证