blob: 369b262103bff8e2ae6bd10fc95475a52ff0b8ee [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
16Server installed from system package
17
18.. code-block:: yaml
Michael Kutýa79bbdb2014-03-03 20:46:34 +010019
20 grafana:
21 server:
22 enabled: true
Ales Komarek9e054912016-10-22 00:36:50 +020023 admin:
24 user: admin
25 password: passwd
26 database:
27 engine: sqlite
28
29Server installed with PostgreSQL database
30
31.. code-block:: yaml
32
33 grafana:
34 server:
35 enabled: true
36 admin:
37 user: admin
38 password: passwd
Ales Komarek98588222015-12-08 10:43:59 +010039 database:
40 engine: postgresql
Michael Kutýa79bbdb2014-03-03 20:46:34 +010041 host: localhost
Ales Komarek98588222015-12-08 10:43:59 +010042 port: 5432
Ales Komarek9e054912016-10-22 00:36:50 +020043 name: grafana
44 user: grafana
45 password: passwd
46
Guillaume Thouvenin377c14c2016-12-05 13:11:53 +010047Server installed with LDAP authentication and all authenticated users are
48administrators
49
50.. code-block:: yaml
51
52 grafana:
53 server:
54 enabled: true
55 admin:
56 user: admin
57 password: passwd
58 auth:
59 ldap:
60 enabled: true
61 host: '127.0.0.1'
62 port: 389
63 use_ssl: false
64 bind_dn: "cn=admin,dc=grafana,dc=org"
65 bind_password: "grafana"
66 user_search_filter: "(cn=%s)"
67 user_search_base_dns:
68 - "dc=grafana,dc=org"
69
70Server installed with LDAP and basic authentication
71
72.. code-block:: yaml
73
74 grafana:
75 server:
76 enabled: true
77 admin:
78 user: admin
79 password: passwd
80 auth:
81 basic:
82 enabled: true
83 ldap:
84 enabled: true
85 host: '127.0.0.1'
86 port: 389
87 use_ssl: false
88 bind_dn: "cn=admin,dc=grafana,dc=org"
89 bind_password: "grafana"
90 user_search_filter: "(cn=%s)"
91 user_search_base_dns:
92 - "dc=grafana,dc=org"
93
94Server installed with LDAP for authentication and authorization
95
96.. code-block:: yaml
97
98 grafana:
99 server:
100 enabled: true
101 admin:
102 user: admin
103 password: passwd
104 auth:
105 ldap:
106 enabled: true
107 host: '127.0.0.1'
108 port: 389
109 use_ssl: false
110 bind_dn: "cn=admin,dc=grafana,dc=org"
111 bind_password: "grafana"
112 user_search_filter: "(cn=%s)"
113 user_search_base_dns:
114 - "dc=grafana,dc=org"
115 group_search_filter: "(&(objectClass=posixGroup)(memberUid=%s))"
116 group_search_base_dns:
117 - "ou=groups,dc=grafana,dc=org"
118 authorization:
119 enabled: true
120 admin_group: "admins"
121 editor_group: "editors"
122 viewer_group: "viewers"
123
Guillaume Thouvenin2958bda2016-11-08 11:55:55 +0100124Server installed with default StackLight JSON dashboards. This will
125be replaced by the possibility for a service to provide its own dashboard
126using salt-mine.
Guillaume Thouvenin70ca6672016-10-26 11:25:37 +0200127
128.. code-block:: yaml
129
130 grafana:
131 server:
132 enabled: true
Guillaume Thouvenin70ca6672016-10-26 11:25:37 +0200133 dashboards:
134 enabled: true
135 path: /var/lib/grafana/dashboards
136
Ales Komarek3f044b22016-10-30 00:27:24 +0200137Server with theme overrides
138
139.. code-block:: yaml
140
141 grafana:
142 server:
143 enabled: true
144 theme:
145 light:
146 css_override:
147 source: http://path.to.theme
148 source_hash: sha256=xyz
149 build: xyz
150 dark:
151 css_override:
152 source: salt://path.to.theme
153
Ales Komarek7a593fa2016-10-22 17:32:35 +0200154
Ales Komarekae47c9f2016-10-22 12:30:30 +0200155Collector setup
156---------------
157
Ales Komarek7a593fa2016-10-22 17:32:35 +0200158Used to aggregate dashboards from monitoring node.
Ales Komarekae47c9f2016-10-22 12:30:30 +0200159
160.. code-block:: yaml
161
162 grafana:
163 collector:
164 enabled: true
165
166
Ales Komarek9e054912016-10-22 00:36:50 +0200167Client setups
168-------------
169
Ales Komarek3f044b22016-10-30 00:27:24 +0200170Client with token based auth
Ales Komarek9e054912016-10-22 00:36:50 +0200171
172.. code-block:: yaml
173
174 grafana:
175 client:
176 enabled: true
177 server:
178 protocol: https
179 host: grafana.host
180 port: 3000
181 token: token
Ales Komarek3f044b22016-10-30 00:27:24 +0200182
183Client with base auth
184
185.. code-block:: yaml
186
187 grafana:
188 client:
189 enabled: true
190 server:
191 protocol: https
192 host: grafana.host
193 port: 3000
194 user: admin
195 password: password
196
197Client enforcing graphite data source
198
199.. code-block:: yaml
200
201 grafana:
202 client:
203 enabled: true
Ales Komarek9e054912016-10-22 00:36:50 +0200204 datasource:
205 graphite:
206 type: graphite
207 host: mtr01.domain.com
208 protocol: https
Ales Komarek98588222015-12-08 10:43:59 +0100209 port: 443
Ales Komarek3f044b22016-10-30 00:27:24 +0200210
211Client enforcing elasticsearch data source
212
213.. code-block:: yaml
214
215 grafana:
216 client:
217 enabled: true
218 datasource:
Ales Komarek9e054912016-10-22 00:36:50 +0200219 elasticsearch:
220 type: elasticsearch
221 host: log01.domain.com
Ales Komarek5a23b512015-12-08 11:20:02 +0100222 port: 80
Ales Komarek5a23b512015-12-08 11:20:02 +0100223 index: grafana-dash
Ales Komarek9e054912016-10-22 00:36:50 +0200224
Ales Komarek7a593fa2016-10-22 17:32:35 +0200225Client defined and enforced dashboard
Ales Komarek9e054912016-10-22 00:36:50 +0200226
227.. code-block:: yaml
228
229 grafana:
230 client:
231 enabled: true
232 server:
233 host: grafana.host
234 port: 3000
235 token: token
236 dashboard:
237 system_metrics:
238 title: "Generic system metrics"
239 style: dark
240 editable: false
241 row:
242 top:
243 title: "First row"
244
245Client enforced dashboards defined in salt-mine
246
247.. code-block:: yaml
248
249 grafana:
250 client:
251 enabled: true
Ales Komarekae47c9f2016-10-22 12:30:30 +0200252 remote_data:
253 engine: salt_mine
Ales Komarek9e054912016-10-22 00:36:50 +0200254 server:
255 host: grafana.host
256 port: 3000
257 token: token
258
Ales Komarek7a593fa2016-10-22 17:32:35 +0200259
Ales Komarekae47c9f2016-10-22 12:30:30 +0200260Usage
261=====
262
Ales Komarekd125d512016-10-24 11:00:40 +0200263There's a difference between JSON dashboard representation and models we us.
264The lists used in JSON format [for rows, panels and target] were replaced by
265dictionaries. This form of serialization allows better merging and overrides
266of hierarchical data structures that dashboard models are.
Ales Komarekae47c9f2016-10-22 12:30:30 +0200267
Ales Komarek7a593fa2016-10-22 17:32:35 +0200268The default format of Grafana dashboards with lists for rows, panels and targets.
Ales Komarekae47c9f2016-10-22 12:30:30 +0200269
270.. code-block:: yaml
271
272 system_metrics:
273 title: graph
274 editable: true
275 hideControls: false
276 rows:
277 - title: Usage
278 height: 250px
279 panels:
280 - title: Panel Title
281 span: 6
282 editable: false
283 type: graph
Guillaume Thouvenin2958bda2016-11-08 11:55:55 +0100284 targets:
Ales Komarekae47c9f2016-10-22 12:30:30 +0200285 - refId: A
286 target: "support_prd.cfg01_iot_tcpcloud_eu.cpu.0.idle"
287 datasource: graphite01
288 renderer: flot
289 showTitle: true
290
Ales Komarekd125d512016-10-24 11:00:40 +0200291The modified version of Grafana dashboard format with dictionary declarations.
292Please note that dictionary keys are only for logical separation and are not
293displayed in generated dashboards.
Ales Komarek7a593fa2016-10-22 17:32:35 +0200294
Ales Komarekae47c9f2016-10-22 12:30:30 +0200295.. code-block:: yaml
296
297 system_metrics:
Ales Komarek7a593fa2016-10-22 17:32:35 +0200298 system_metrics2:
299 title: graph
300 editable: true
301 hideControls: false
302 row:
303 usage:
304 title: Usage
305 height: 250px
306 panel:
307 usage-panel:
308 title: Panel Title
309 span: 6
310 editable: false
311 type: graph
312 target:
313 A:
314 refId: A
315 target: "support_prd.cfg01_iot_tcpcloud_eu.cpu.0.idle"
316 datasource: graphite01
317 renderer: flot
318 showTitle: true
Ales Komarekae47c9f2016-10-22 12:30:30 +0200319
Ales Komarek9e054912016-10-22 00:36:50 +0200320
Ales Komarek86490892015-12-04 16:43:48 +0100321Read more
322=========
Ales Komarek4b6c8662014-02-24 21:48:29 +0100323
324* http://grafana.org/
Ales Komarek5a23b512015-12-08 11:20:02 +0100325* http://docs.grafana.org/reference/export_import/