当前位置:网站首页>Grafana Getting Started tutorial
Grafana Getting Started tutorial
2022-06-29 03:20:00 【Endwas】
Recently, companies need to use Grafana Make a chart to show , Monitor the indicators on the first line , Just took the time to learn , It's very powerful , I've stepped on a lot of holes , Dynamic configuration in many places is also poorly understood , So write an introductory tutorial , Let's explain it with Mysql As a data source grafana Chart display .
Grafana Introductory tutorial
1. install 、 download
1. Windows Installation and downloading
https://grafana.com/grafana/download?platform=windows
2.Mac Installation and downloading
1. Download package
curl -O https://dl.grafana.com/enterprise/release/grafana-enterprise-9.0.0.darwin-amd64.tar.gz
tar -zxvf grafana-enterprise-9.0.0.darwin-amd64.tar.gz
2.Brew Download start
brew install grafana
brew services start grafana
Grafana Introductory tutorial
1. install 、 download
1. Windows Installation and downloading
https://grafana.com/grafana/download?platform=windows
2.Mac Installation and downloading
1. Download package
curl -O https://dl.grafana.com/enterprise/release/grafana-enterprise-9.0.0.darwin-amd64.tar.gz
tar -zxvf grafana-enterprise-9.0.0.darwin-amd64.tar.gz
2.Brew Download start
brew install grafana
brew services start grafana
2. Import and export
1. Select a Dashboad

2. export json file

3. Select the import page


Just import .
3. Access control
Localhost:3000
1. Configure data sources Data source



2. To configure Dashboard
1. Select the table you want to export , To configure Query Parameters

2. Handwriting sql sentence

3. To configure variable
Enter a Dashboard



e.g

4. Query editor
1.Select table, time column and metric column (FROM)
When you first enter edit mode or add a new query ,Grafana You will try to pre populate the query builder with the first table with timestamp columns and numeric Columns .
stay FROM Field ,Grafana It will be recommended to configure the tables in the database .
Select... In another database that database users have access to Table or view , You can manually enter the fully qualified name (database.table), Such as otherDb.metrics.
The time column field is the name of the column that holds your time value . by Metric Selecting a value in the column field is optional . If you select a value ,Metric The column field will be used as the series name .
The metric column recommendations will only contain data with text data types (text、tinytext、mediumtext、longtext、varchar、char) The column of .
If you want to use columns with different data types as measurement Columns , You can enter a column name with a cast :CAST(numericColumn as CHAR).
You can also enter any... In the measure column field SQL expression , These expressions evaluate to text data types , Such as CONCAT(column1, “ “, CAST(numericColumn as CHAR)).
2.Columns and Aggregation functions (SELECT)
stay SELECT In line , You can specify which columns and functions to use .
In the column field , You can write any expression , Not like it column1 * column2 / column3 Such column names .
If you use aggregate functions , You need to group the result set .
If you add an aggregate function , The editor will automatically add GROUP BY Time .
You can add more value columns by clicking the plus button and selecting columns from the menu .
Multiple value columns are drawn as separate series in the graphics panel .
3.Filter data (WHERE)
To add a filter , Please click on the WHERE The plus icon to the right of the condition .
You can remove the filter by clicking filter and selecting remove .
The filter for the currently selected time range is automatically added to the new query .
4.Gap Filling
When you group by time ,Grafana Missing values can be populated .
time The function takes two arguments .
The first parameter is the time window you want to group , The second parameter is what you want Grafana Fill in the value of the missing item .
5.Text Editor Mode (RAW)
You can switch the editor mode by clicking the icon and selecting it, or click Edit... Under query SQL To switch to the original query editor mode .
If you use the original query editor , Please ensure that your query has at least ORDER BY Filters for time and return time ranges .
5.Panel Option
explain :
- Tooltip mode That is, move the mouse over the graph to display all the indicators , It is also an indicator of mouse position . Used for multiple broken line indicators .
- Legend Logo mode , Display type of indicator , Table or list, etc .
- Standard options Configuration properties , Such as unit value , Unit range, etc .
- Thresholds Display threshold line , Such as alarm line , Warning line, etc .
- Graph styles The style of the chart , Straight and curved lines .
6.Q&S
- The time interval 8 Hours
Change the time zone ,Configuration - 》 preferences -》 Timezone -》 choice UTC Time -> save
Or go into a Dashboard -》 settings -》 General -》Time options
- Grafana Time stamp to specific time
Grafana Direct conversion , Just confirm the time zone .
- How to dynamically transfer parameters
Get into dashboard settings, choice variable To configure , Select a data source or a fixed value , If you want to pass in other variable, use $value Pass in .
- How to group
Adding add panel When There's a... On the right add a new row Add separator .
- Grafana Dynamically connect data sources
In some cases , Possible database connections / perhaps es Under the index It changes over time , At this time, we can configure dynamic data . If you still can't connect to es, Determine the permission of the account .
[log_abc_]YYYY_MM_DD Include parameters in brackets YYYY_MM_DD Represent wildcard
- Grafana How to dynamically modify according to the time selector sql sentence
Official website passed $_from , $_to To get properties
https://grafana.com/docs/grafana/latest/variables/variable-types/global-variables/
summary
Grafana Is a very powerful visual monitoring software , Support complete data sources , It also includes very powerful dynamic data sources 、 Dynamic parameter function , It also contains a variety of chart software , I think than superset、metabase And so on .
边栏推荐
- Tortoise 没有显示绿色图标
- 2022-2028 global pneumatic test probe industry survey and trend analysis report
- 2022-2028 global UAV detection radar industry research and trend analysis report
- Synchronous movement state of Jerry's watch [chapter]
- 2022-2028 global sound insulation coating industry research and trend analysis report
- 逆序对对数计算,顺序对对数计算——归并排序
- Stm32l4 Series MCU ADC accurately calculates input voltage through internal reference voltage
- Setting alarm mode of Jerry's watch [chapter]
- 【一起上水硕系列】Day 6-强肝学术论文!最细解释!
- Movement state change of monitoring device of Jerry's watch [chapter]
猜你喜欢
![[together with Shangshui Shuo series] day 6-strong liver academic paper! The most detailed explanation!](/img/70/595a94ba19d29a56a4f0bb5964a199.png)
[together with Shangshui Shuo series] day 6-strong liver academic paper! The most detailed explanation!

Redu.us took the initiative to transform, and the operation leader of China's charging pile emerged

问题——adb shellerror: insufficient permissions for device: verify udev rules.

Bluebridge cup 2022 preliminaries - minesweeping
![[test theory] quality analysis ability](/img/4b/d011e16c7b2be52fe12c123214779e.jpg)
[test theory] quality analysis ability
![相同的树[从部分到整体]](/img/2d/997b9cb9cd4f8ea8620f5a66fcf00a.png)
相同的树[从部分到整体]

Connect error: no route to host (errno:113)
![[線性代數] 1.1 二階與三階行列式](/img/ea/70b59c64d3287a887e371a9181fe45.png)
[線性代數] 1.1 二階與三階行列式

2022-2028 global long wave infrared camera and camera core industry research and trend analysis report
![Jerry's watch begins to move [chapter]](/img/85/232da1c1f8dddb3af1e564e4a0fc53.jpg)
Jerry's watch begins to move [chapter]
随机推荐
Ten commands commonly used in SVN
均贫富
Laravel, execute PHP artist migrate and report an error alter table `users`add unique `users_ email_ unique`(`email`))
Gartner's "voice of customers" has the highest score, and the user experience has become a major breakthrough for China's database
Data discretization
Vscode plug-in used now
Web APIs 高阶函数 丨黑马程序员
恢复二叉搜索树[根据题意模拟->发现问题->分析问题->见招拆招]
Movement state change of monitoring device of Jerry's watch [chapter]
vim配置与使用
99 multiplication table
FPGA (VII) RTL code III (complex circuit design 2)
今日直播|Apache Pulsar x KubeSphere 在线 Meetup 火热来袭
What is the gold content of the equipment supervisor certificate? Is it worth it?
使用gdb添加断点的几种方式
How to keep source code secret in embedded development
层次分析法(AHP)
Matlab exercises - image drawing exercises
二叉树的锯齿形层序遍历[分层遍历方式之一 -> 前序遍历+level]
How to skip time when closing a socket connection_ Wait status of wait