-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmonitoring_visualization_grafana.txt
More file actions
198 lines (183 loc) · 8.03 KB
/
monitoring_visualization_grafana.txt
File metadata and controls
198 lines (183 loc) · 8.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
[[{monitoring.grafana]]
## Grafana
* <https://grafana.com/>
- OOSS analytics and interactive visualization web application.
- time series analytics.
- Integrates with Prometheus queries.
- <https://logz.io/blog/grafana-vs-kibana/> [[{doc_has.comparative,monitoring.kibana}]]
- 7.0+ includes new plugin architecture, visualizations,
transformations, native trace support, ...
<https://grafana.com/blog/2020/05/18/grafana-v7.0-released-new-plugin-architecture-visualizations-transformations-native-trace-support-and-more/>
[[}]]
## Grafana Dashboard JSON model [[{]]
* A dashboard is represented by a JSON object.
* JSON Dashboard metadata includes dashboard properties, metadata from panels,
template variables, panel queries, etc.
* To view the JSON of a dashboard:
```
Navigate to a dashboard
··> [top navigation menu] ··> click [ Dashboard settings (gear icon)]
··> Click JSON Model.
```
### JSON fields
```
| {
| "id": null, <·· unique numeric identifier for the dashboard generated by the DB.
| "uid": "cLV5GDCkz", <·· Unique ID that can be generated by anyone. string (8-40)
| "title": "New dashboard",
| "tags": [],
| "style": "dark",
| "timezone": "browser", <·· UTC or browser
| "editable": true,
| "graphTooltip": 1, <·· 0: no shared crosshair or tooltip (default),
| 1: shared crosshair
| 2 for shared crosshair AND shared tooltip
| "panels": [],
| "time": { <·· time range for dashboard, i.e. last 6 hours, last 7 days, etc
| "from": "now-6h",
| "to": "now"
| },
| "timepicker": { <·· see timepicker section for details ¹
| "time_options": [],
| "refresh_intervals": []
| },
| "templating": { <·· see templating section for details ²
| "list": [] },
| "annotations": { <·· see annotations for how to add them
| "list": [] },
| "refresh": "5s", <·· auto-refresh interval
| "schemaVersion": 17, <·· Incremented each time a Grafana update brings changes to it
| "version": 0, <·· Incremented each time the dashboard is updated
| "links": []
| }
```
## Dashboard Panels
* Panels are the building blocks of a dashboard.
* Panels "==" data source queries, type of graphs, aliases, etc.
* Panel JSON have some common schema fields plus specific fields for the panel type.
```
| "panels": [
| {
| "id": 4,
| "type": "text",
| "title": "Panel Title",
| "gridPos": {
| "x": 0, "w": 12, <·· horizontal unit: column (24 in total)
| "y": 0, "h": 9 <·· vertical unit: 30 pixel !!!
| Grid has negative gravity: panels up if there empty
| space above a panel.
| },
| "mode": "markdown",
| "content": "# title"
| }
| ]
|
| ¹
| "timepicker": {
| "collapse": false, <·· whether timepicker is collapsed or not
| "enable": true, <·· true | false
| "notice": false,
| "now": true,
| "refresh_intervals": [
| "5s", "10s", "30s",
| "1m", "5m", "15m", "30m",
| "1h", "2h",
| "1d"
| ],
| "status": "Stable",
| "type": "timepicker"
| }
|
| ² templating example
| "templating": { <·· array of template variables with their (saved) + extra metadata, for example:
| "enable": true, <···· template enabled?
| "list": [ <···· each element in the array represents one template variable
| {
| "name": "env", <·· variable name
| "type": "query" <·· := custom | query | interval
| "refresh": false,
| "allFormat": "wildcard", <·· format to use while fetching all values from data source,
| "multi": false, <·· multiple values can be selected from variable value list?
| "multiFormat": "glob", <·· format to use while fetching timeseries from data source
| "current": { <·· shows current selected variable text/value on the dashboard
| "tags": [], "text": "prod", "value": "prod" },
| "datasource": null, <·· shows data source for the variables
| "includeAll": true, <·· whether all value option is available or not
| "options": [ <·· list of variable text/value pairs available for selection on dashboard
| { "text": "All" , "selected": false, "value": "*" },
| { "text": "stage", "selected": false, "value": "stage" },
| { "text": "test" , "selected": false, "value": "test" }
| ],
| "query": "tag_values(cpu.use.average,env)", <·· data source query used to fetch values for var.
| },
| {
| "name": "app",
| "type": "query"
| "options": [
| { "text": "tomcat", "selected": true, "value": "tomcat" },
| { "text": "cassandra", "selected": false, "value": "cassandra" }
| ],
| ...
| }
| ]
| }
```
[[{PM.whatsnew]]
## What's New
### 9.5: Adds Service Accounts and Improves Debugging Experience [[{]]
* <https://www.infoq.com/news/2023/05/grafana-service-accounts/>
[[}]]
### 9.1/9.2 [[{]]
* Tighten Integration between Metrics and Tracing
<https://www.infoq.com/news/2022/10/grafana-92-metrics-tracing/>
* tightens the integration between metrics and tracing.
* "Tempo" has new beta functionality.
1. metrics queries can now be linked to traces, which lets
users QUICKLY SEE RELEVANT METRIC TRENDS IN USER JOURNEY
TRACES AND SPANS.
2. Application Performance Management (APM) data from Tempo
is now available in Grafana itself - in the form of a table
showing RED (rate, errors, duration) Metrics,
ALLOWING CLOSER CORRELATION BETWEEN TRACING AND METRICS
DATA.
* new "get help" option collects a snapshot of configuration and data
to send to the support team.
* alpha preview: public dashboards, allows to share specific
dashboards to anyone in a read-only view and with just the
dashboard's default time range - without authentication.
* use SQL-style inner and outer joins to transform data collected
from external sources before displaying it in a visualisation.
* new query editor for Loki - Grafana's log aggregation system
simplifies creation of variables used in log queries.
* Grafana's Terraform provider has been improved.
allows admins to assign roles to users and teams using a
"role_assignment" resource in Terraform.
* IT'S NOW POSSIBLE TO EMBED GRAFANA URLS IN OTHER
APPLICATIONS BY ADDING A JWT TOKEN TO THE URL.
Enterprise version add OAuth.
* RBAC for Grafana plugins.
[[}]]
### Grafana 9 Brings Big Improvements to Alerting and User Experience [[{]]
https://www.infoq.com/news/2022/07/grafana-9-released/
Changes to the alerting experience, trialed as an option in earlier
versions of Grafana, have now been made the default, leading to
several improvements:
Alerts are now streamlined and simplified across multiple data
sources and Grafana deployments.
Alerts are now available based on a single rule, regardless of
whether they are tied to a specific panel or dashboard. This removes
a limitation that was previously in place.
Alerts can now be multi-dimensional - so a single alert can
be triggered by more than one item triggering the rule.
Grouping and routing of alerts are also improved, with
notification policies allowing admins to bundle alerts together -
preventing a potential storm of notifications when multiple alerts
fire.
Granular alert muting and silencing are also now possible, allowing
admins to prevent notifications at certain times (such as weekends), and to
turn off notifications for an already existent alert temporarily.
[[}]]
### v7.4
<https://grafana.com/docs/grafana/latest/whatsnew/whats-new-in-v7-4/>
[[PM.whatsnew}]]
[[monitoring.grafana}]]