blob: 6cb68139c4d6aefd542720baa5e663e41d42475b [file] [log] [blame]
Ales Komarek4b6c8662014-02-24 21:48:29 +01001
Ales Komarek86490892015-12-04 16:43:48 +01002=======
3Grafana
4=======
Ales Komarek4b6c8662014-02-24 21:48:29 +01005
6A beautiful, easy to use and feature rich Graphite dashboard replacement and graph editor.
7
Ales Komarek7a593fa2016-10-22 17:32:35 +02008
Ales Komarek5a23b512015-12-08 11:20:02 +01009Sample pillars
10==============
Ales Komarek4b6c8662014-02-24 21:48:29 +010011
Ales Komarek7a593fa2016-10-22 17:32:35 +020012
Ales Komarek9e054912016-10-22 00:36:50 +020013Server deployments
14------------------
15
Guillaume Thouvenin54a1b742016-12-13 10:08:32 +010016Server installed from system package and listening on 1.2.3.4:3000 (the default
17is 0.0.0.0:3000)
Ales Komarek9e054912016-10-22 00:36:50 +020018
19.. code-block:: yaml
Michael Kutýa79bbdb2014-03-03 20:46:34 +010020
21 grafana:
22 server:
23 enabled: true
Guillaume Thouvenin54a1b742016-12-13 10:08:32 +010024 bind:
25 address: 1.2.3.4
26 port: 3000
Ales Komarek9e054912016-10-22 00:36:50 +020027 admin:
28 user: admin
29 password: passwd
30 database:
31 engine: sqlite
32
33Server installed with PostgreSQL database
34
35.. code-block:: yaml
36
37 grafana:
38 server:
39 enabled: true
40 admin:
41 user: admin
42 password: passwd
Ales Komarek98588222015-12-08 10:43:59 +010043 database:
44 engine: postgresql
Michael Kutýa79bbdb2014-03-03 20:46:34 +010045 host: localhost
Ales Komarek98588222015-12-08 10:43:59 +010046 port: 5432
Ales Komarek9e054912016-10-22 00:36:50 +020047 name: grafana
48 user: grafana
49 password: passwd
50
Guillaume Thouvenin377c14c2016-12-05 13:11:53 +010051Server installed with LDAP authentication and all authenticated users are
52administrators
53
54.. code-block:: yaml
55
56 grafana:
57 server:
58 enabled: true
59 admin:
60 user: admin
61 password: passwd
62 auth:
63 ldap:
64 enabled: true
65 host: '127.0.0.1'
66 port: 389
67 use_ssl: false
68 bind_dn: "cn=admin,dc=grafana,dc=org"
69 bind_password: "grafana"
70 user_search_filter: "(cn=%s)"
71 user_search_base_dns:
72 - "dc=grafana,dc=org"
73
74Server installed with LDAP and basic authentication
75
76.. code-block:: yaml
77
78 grafana:
79 server:
80 enabled: true
81 admin:
82 user: admin
83 password: passwd
84 auth:
85 basic:
86 enabled: true
87 ldap:
88 enabled: true
89 host: '127.0.0.1'
90 port: 389
91 use_ssl: false
92 bind_dn: "cn=admin,dc=grafana,dc=org"
93 bind_password: "grafana"
94 user_search_filter: "(cn=%s)"
95 user_search_base_dns:
96 - "dc=grafana,dc=org"
97
98Server installed with LDAP for authentication and authorization
99
100.. code-block:: yaml
101
102 grafana:
103 server:
104 enabled: true
105 admin:
106 user: admin
107 password: passwd
108 auth:
109 ldap:
110 enabled: true
111 host: '127.0.0.1'
112 port: 389
113 use_ssl: false
114 bind_dn: "cn=admin,dc=grafana,dc=org"
115 bind_password: "grafana"
116 user_search_filter: "(cn=%s)"
117 user_search_base_dns:
118 - "dc=grafana,dc=org"
119 group_search_filter: "(&(objectClass=posixGroup)(memberUid=%s))"
120 group_search_base_dns:
121 - "ou=groups,dc=grafana,dc=org"
122 authorization:
123 enabled: true
124 admin_group: "admins"
125 editor_group: "editors"
126 viewer_group: "viewers"
127
Guillaume Thouvenin2958bda2016-11-08 11:55:55 +0100128Server installed with default StackLight JSON dashboards. This will
129be replaced by the possibility for a service to provide its own dashboard
130using salt-mine.
Guillaume Thouvenin70ca6672016-10-26 11:25:37 +0200131
132.. code-block:: yaml
133
134 grafana:
135 server:
136 enabled: true
Guillaume Thouvenin70ca6672016-10-26 11:25:37 +0200137 dashboards:
138 enabled: true
139 path: /var/lib/grafana/dashboards
140
Ales Komarek3f044b22016-10-30 00:27:24 +0200141Server with theme overrides
142
143.. code-block:: yaml
144
145 grafana:
146 server:
147 enabled: true
148 theme:
149 light:
150 css_override:
151 source: http://path.to.theme
152 source_hash: sha256=xyz
153 build: xyz
154 dark:
155 css_override:
156 source: salt://path.to.theme
157
Ales Komarek7a593fa2016-10-22 17:32:35 +0200158
Ales Komarekae47c9f2016-10-22 12:30:30 +0200159Collector setup
160---------------
161
Ales Komarek7a593fa2016-10-22 17:32:35 +0200162Used to aggregate dashboards from monitoring node.
Ales Komarekae47c9f2016-10-22 12:30:30 +0200163
164.. code-block:: yaml
165
166 grafana:
167 collector:
168 enabled: true
169
170
Ales Komarek9e054912016-10-22 00:36:50 +0200171Client setups
172-------------
173
Ales Komarek3f044b22016-10-30 00:27:24 +0200174Client with token based auth
Ales Komarek9e054912016-10-22 00:36:50 +0200175
176.. code-block:: yaml
177
178 grafana:
179 client:
180 enabled: true
181 server:
182 protocol: https
183 host: grafana.host
184 port: 3000
185 token: token
Ales Komarek3f044b22016-10-30 00:27:24 +0200186
187Client with base auth
188
189.. code-block:: yaml
190
191 grafana:
192 client:
193 enabled: true
194 server:
195 protocol: https
196 host: grafana.host
197 port: 3000
198 user: admin
199 password: password
200
201Client enforcing graphite data source
202
203.. code-block:: yaml
204
205 grafana:
206 client:
207 enabled: true
Ales Komarek9e054912016-10-22 00:36:50 +0200208 datasource:
209 graphite:
210 type: graphite
211 host: mtr01.domain.com
212 protocol: https
Ales Komarek98588222015-12-08 10:43:59 +0100213 port: 443
Ales Komarek3f044b22016-10-30 00:27:24 +0200214
215Client enforcing elasticsearch data source
216
217.. code-block:: yaml
218
219 grafana:
220 client:
221 enabled: true
222 datasource:
Ales Komarek9e054912016-10-22 00:36:50 +0200223 elasticsearch:
224 type: elasticsearch
225 host: log01.domain.com
Ales Komarek5a23b512015-12-08 11:20:02 +0100226 port: 80
Ales Komarek5a23b512015-12-08 11:20:02 +0100227 index: grafana-dash
Ales Komarek9e054912016-10-22 00:36:50 +0200228
Ales Komarek7a593fa2016-10-22 17:32:35 +0200229Client defined and enforced dashboard
Ales Komarek9e054912016-10-22 00:36:50 +0200230
231.. code-block:: yaml
232
233 grafana:
234 client:
235 enabled: true
236 server:
237 host: grafana.host
238 port: 3000
239 token: token
240 dashboard:
241 system_metrics:
242 title: "Generic system metrics"
243 style: dark
244 editable: false
245 row:
246 top:
247 title: "First row"
248
249Client enforced dashboards defined in salt-mine
250
251.. code-block:: yaml
252
253 grafana:
254 client:
255 enabled: true
Ales Komarekae47c9f2016-10-22 12:30:30 +0200256 remote_data:
257 engine: salt_mine
Ales Komarek9e054912016-10-22 00:36:50 +0200258 server:
259 host: grafana.host
260 port: 3000
261 token: token
262
Ales Komarek7a593fa2016-10-22 17:32:35 +0200263
Ales Komarekae47c9f2016-10-22 12:30:30 +0200264Usage
265=====
266
Ales Komarekd125d512016-10-24 11:00:40 +0200267There's a difference between JSON dashboard representation and models we us.
268The lists used in JSON format [for rows, panels and target] were replaced by
269dictionaries. This form of serialization allows better merging and overrides
270of hierarchical data structures that dashboard models are.
Ales Komarekae47c9f2016-10-22 12:30:30 +0200271
Ales Komarek7a593fa2016-10-22 17:32:35 +0200272The default format of Grafana dashboards with lists for rows, panels and targets.
Ales Komarekae47c9f2016-10-22 12:30:30 +0200273
274.. code-block:: yaml
275
276 system_metrics:
277 title: graph
278 editable: true
279 hideControls: false
280 rows:
281 - title: Usage
282 height: 250px
283 panels:
284 - title: Panel Title
285 span: 6
286 editable: false
287 type: graph
Guillaume Thouvenin2958bda2016-11-08 11:55:55 +0100288 targets:
Ales Komarekae47c9f2016-10-22 12:30:30 +0200289 - refId: A
290 target: "support_prd.cfg01_iot_tcpcloud_eu.cpu.0.idle"
291 datasource: graphite01
292 renderer: flot
293 showTitle: true
294
Ales Komarekd125d512016-10-24 11:00:40 +0200295The modified version of Grafana dashboard format with dictionary declarations.
296Please note that dictionary keys are only for logical separation and are not
297displayed in generated dashboards.
Ales Komarek7a593fa2016-10-22 17:32:35 +0200298
Ales Komarekae47c9f2016-10-22 12:30:30 +0200299.. code-block:: yaml
300
301 system_metrics:
Ales Komarek7a593fa2016-10-22 17:32:35 +0200302 system_metrics2:
303 title: graph
304 editable: true
305 hideControls: false
306 row:
307 usage:
308 title: Usage
309 height: 250px
310 panel:
311 usage-panel:
312 title: Panel Title
313 span: 6
314 editable: false
315 type: graph
316 target:
317 A:
318 refId: A
319 target: "support_prd.cfg01_iot_tcpcloud_eu.cpu.0.idle"
320 datasource: graphite01
321 renderer: flot
322 showTitle: true
Ales Komarekae47c9f2016-10-22 12:30:30 +0200323
Ales Komarek9e054912016-10-22 00:36:50 +0200324
Ales Komarek86490892015-12-04 16:43:48 +0100325Read more
326=========
Ales Komarek4b6c8662014-02-24 21:48:29 +0100327
328* http://grafana.org/
Ales Komarek5a23b512015-12-08 11:20:02 +0100329* http://docs.grafana.org/reference/export_import/