Ales Komarek | 4b6c866 | 2014-02-24 21:48:29 +0100 | [diff] [blame] | 1 | |
Ales Komarek | 8649089 | 2015-12-04 16:43:48 +0100 | [diff] [blame] | 2 | ======= |
3 | Grafana | ||||
4 | ======= | ||||
Ales Komarek | 4b6c866 | 2014-02-24 21:48:29 +0100 | [diff] [blame] | 5 | |
6 | A beautiful, easy to use and feature rich Graphite dashboard replacement and graph editor. | ||||
7 | |||||
Ales Komarek | 7a593fa | 2016-10-22 17:32:35 +0200 | [diff] [blame] | 8 | |
Ales Komarek | 5a23b51 | 2015-12-08 11:20:02 +0100 | [diff] [blame] | 9 | Sample pillars |
10 | ============== | ||||
Ales Komarek | 4b6c866 | 2014-02-24 21:48:29 +0100 | [diff] [blame] | 11 | |
Ales Komarek | 7a593fa | 2016-10-22 17:32:35 +0200 | [diff] [blame] | 12 | |
Ales Komarek | 9e05491 | 2016-10-22 00:36:50 +0200 | [diff] [blame] | 13 | Server deployments |
14 | ------------------ | ||||
15 | |||||
16 | Server installed from system package | ||||
17 | |||||
18 | .. code-block:: yaml | ||||
Michael Kutý | a79bbdb | 2014-03-03 20:46:34 +0100 | [diff] [blame] | 19 | |
20 | grafana: | ||||
21 | server: | ||||
22 | enabled: true | ||||
Ales Komarek | 9e05491 | 2016-10-22 00:36:50 +0200 | [diff] [blame] | 23 | admin: |
24 | user: admin | ||||
25 | password: passwd | ||||
26 | database: | ||||
27 | engine: sqlite | ||||
28 | |||||
29 | Server 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 Komarek | 9858822 | 2015-12-08 10:43:59 +0100 | [diff] [blame] | 39 | database: |
40 | engine: postgresql | ||||
Michael Kutý | a79bbdb | 2014-03-03 20:46:34 +0100 | [diff] [blame] | 41 | host: localhost |
Ales Komarek | 9858822 | 2015-12-08 10:43:59 +0100 | [diff] [blame] | 42 | port: 5432 |
Ales Komarek | 9e05491 | 2016-10-22 00:36:50 +0200 | [diff] [blame] | 43 | name: grafana |
44 | user: grafana | ||||
45 | password: passwd | ||||
46 | |||||
Guillaume Thouvenin | 2958bda | 2016-11-08 11:55:55 +0100 | [diff] [blame] | 47 | Server installed with default StackLight JSON dashboards. This will |
48 | be replaced by the possibility for a service to provide its own dashboard | ||||
49 | using salt-mine. | ||||
Guillaume Thouvenin | 70ca667 | 2016-10-26 11:25:37 +0200 | [diff] [blame] | 50 | |
51 | .. code-block:: yaml | ||||
52 | |||||
53 | grafana: | ||||
54 | server: | ||||
55 | enabled: true | ||||
Guillaume Thouvenin | 70ca667 | 2016-10-26 11:25:37 +0200 | [diff] [blame] | 56 | dashboards: |
57 | enabled: true | ||||
58 | path: /var/lib/grafana/dashboards | ||||
59 | |||||
Ales Komarek | 3f044b2 | 2016-10-30 00:27:24 +0200 | [diff] [blame] | 60 | Server with theme overrides |
61 | |||||
62 | .. code-block:: yaml | ||||
63 | |||||
64 | grafana: | ||||
65 | server: | ||||
66 | enabled: true | ||||
67 | theme: | ||||
68 | light: | ||||
69 | css_override: | ||||
70 | source: http://path.to.theme | ||||
71 | source_hash: sha256=xyz | ||||
72 | build: xyz | ||||
73 | dark: | ||||
74 | css_override: | ||||
75 | source: salt://path.to.theme | ||||
76 | |||||
Ales Komarek | 7a593fa | 2016-10-22 17:32:35 +0200 | [diff] [blame] | 77 | |
Ales Komarek | ae47c9f | 2016-10-22 12:30:30 +0200 | [diff] [blame] | 78 | Collector setup |
79 | --------------- | ||||
80 | |||||
Ales Komarek | 7a593fa | 2016-10-22 17:32:35 +0200 | [diff] [blame] | 81 | Used to aggregate dashboards from monitoring node. |
Ales Komarek | ae47c9f | 2016-10-22 12:30:30 +0200 | [diff] [blame] | 82 | |
83 | .. code-block:: yaml | ||||
84 | |||||
85 | grafana: | ||||
86 | collector: | ||||
87 | enabled: true | ||||
88 | |||||
89 | |||||
Ales Komarek | 9e05491 | 2016-10-22 00:36:50 +0200 | [diff] [blame] | 90 | Client setups |
91 | ------------- | ||||
92 | |||||
Ales Komarek | 3f044b2 | 2016-10-30 00:27:24 +0200 | [diff] [blame] | 93 | Client with token based auth |
Ales Komarek | 9e05491 | 2016-10-22 00:36:50 +0200 | [diff] [blame] | 94 | |
95 | .. code-block:: yaml | ||||
96 | |||||
97 | grafana: | ||||
98 | client: | ||||
99 | enabled: true | ||||
100 | server: | ||||
101 | protocol: https | ||||
102 | host: grafana.host | ||||
103 | port: 3000 | ||||
104 | token: token | ||||
Ales Komarek | 3f044b2 | 2016-10-30 00:27:24 +0200 | [diff] [blame] | 105 | |
106 | Client with base auth | ||||
107 | |||||
108 | .. code-block:: yaml | ||||
109 | |||||
110 | grafana: | ||||
111 | client: | ||||
112 | enabled: true | ||||
113 | server: | ||||
114 | protocol: https | ||||
115 | host: grafana.host | ||||
116 | port: 3000 | ||||
117 | user: admin | ||||
118 | password: password | ||||
119 | |||||
120 | Client enforcing graphite data source | ||||
121 | |||||
122 | .. code-block:: yaml | ||||
123 | |||||
124 | grafana: | ||||
125 | client: | ||||
126 | enabled: true | ||||
Ales Komarek | 9e05491 | 2016-10-22 00:36:50 +0200 | [diff] [blame] | 127 | datasource: |
128 | graphite: | ||||
129 | type: graphite | ||||
130 | host: mtr01.domain.com | ||||
131 | protocol: https | ||||
Ales Komarek | 9858822 | 2015-12-08 10:43:59 +0100 | [diff] [blame] | 132 | port: 443 |
Ales Komarek | 3f044b2 | 2016-10-30 00:27:24 +0200 | [diff] [blame] | 133 | |
134 | Client enforcing elasticsearch data source | ||||
135 | |||||
136 | .. code-block:: yaml | ||||
137 | |||||
138 | grafana: | ||||
139 | client: | ||||
140 | enabled: true | ||||
141 | datasource: | ||||
Ales Komarek | 9e05491 | 2016-10-22 00:36:50 +0200 | [diff] [blame] | 142 | elasticsearch: |
143 | type: elasticsearch | ||||
144 | host: log01.domain.com | ||||
Ales Komarek | 5a23b51 | 2015-12-08 11:20:02 +0100 | [diff] [blame] | 145 | port: 80 |
Ales Komarek | 5a23b51 | 2015-12-08 11:20:02 +0100 | [diff] [blame] | 146 | index: grafana-dash |
Ales Komarek | 9e05491 | 2016-10-22 00:36:50 +0200 | [diff] [blame] | 147 | |
Ales Komarek | 7a593fa | 2016-10-22 17:32:35 +0200 | [diff] [blame] | 148 | Client defined and enforced dashboard |
Ales Komarek | 9e05491 | 2016-10-22 00:36:50 +0200 | [diff] [blame] | 149 | |
150 | .. code-block:: yaml | ||||
151 | |||||
152 | grafana: | ||||
153 | client: | ||||
154 | enabled: true | ||||
155 | server: | ||||
156 | host: grafana.host | ||||
157 | port: 3000 | ||||
158 | token: token | ||||
159 | dashboard: | ||||
160 | system_metrics: | ||||
161 | title: "Generic system metrics" | ||||
162 | style: dark | ||||
163 | editable: false | ||||
164 | row: | ||||
165 | top: | ||||
166 | title: "First row" | ||||
167 | |||||
168 | Client enforced dashboards defined in salt-mine | ||||
169 | |||||
170 | .. code-block:: yaml | ||||
171 | |||||
172 | grafana: | ||||
173 | client: | ||||
174 | enabled: true | ||||
Ales Komarek | ae47c9f | 2016-10-22 12:30:30 +0200 | [diff] [blame] | 175 | remote_data: |
176 | engine: salt_mine | ||||
Ales Komarek | 9e05491 | 2016-10-22 00:36:50 +0200 | [diff] [blame] | 177 | server: |
178 | host: grafana.host | ||||
179 | port: 3000 | ||||
180 | token: token | ||||
181 | |||||
Ales Komarek | 7a593fa | 2016-10-22 17:32:35 +0200 | [diff] [blame] | 182 | |
Ales Komarek | ae47c9f | 2016-10-22 12:30:30 +0200 | [diff] [blame] | 183 | Usage |
184 | ===== | ||||
185 | |||||
Ales Komarek | d125d51 | 2016-10-24 11:00:40 +0200 | [diff] [blame] | 186 | There's a difference between JSON dashboard representation and models we us. |
187 | The lists used in JSON format [for rows, panels and target] were replaced by | ||||
188 | dictionaries. This form of serialization allows better merging and overrides | ||||
189 | of hierarchical data structures that dashboard models are. | ||||
Ales Komarek | ae47c9f | 2016-10-22 12:30:30 +0200 | [diff] [blame] | 190 | |
Ales Komarek | 7a593fa | 2016-10-22 17:32:35 +0200 | [diff] [blame] | 191 | The default format of Grafana dashboards with lists for rows, panels and targets. |
Ales Komarek | ae47c9f | 2016-10-22 12:30:30 +0200 | [diff] [blame] | 192 | |
193 | .. code-block:: yaml | ||||
194 | |||||
195 | system_metrics: | ||||
196 | title: graph | ||||
197 | editable: true | ||||
198 | hideControls: false | ||||
199 | rows: | ||||
200 | - title: Usage | ||||
201 | height: 250px | ||||
202 | panels: | ||||
203 | - title: Panel Title | ||||
204 | span: 6 | ||||
205 | editable: false | ||||
206 | type: graph | ||||
Guillaume Thouvenin | 2958bda | 2016-11-08 11:55:55 +0100 | [diff] [blame] | 207 | targets: |
Ales Komarek | ae47c9f | 2016-10-22 12:30:30 +0200 | [diff] [blame] | 208 | - refId: A |
209 | target: "support_prd.cfg01_iot_tcpcloud_eu.cpu.0.idle" | ||||
210 | datasource: graphite01 | ||||
211 | renderer: flot | ||||
212 | showTitle: true | ||||
213 | |||||
Ales Komarek | d125d51 | 2016-10-24 11:00:40 +0200 | [diff] [blame] | 214 | The modified version of Grafana dashboard format with dictionary declarations. |
215 | Please note that dictionary keys are only for logical separation and are not | ||||
216 | displayed in generated dashboards. | ||||
Ales Komarek | 7a593fa | 2016-10-22 17:32:35 +0200 | [diff] [blame] | 217 | |
Ales Komarek | ae47c9f | 2016-10-22 12:30:30 +0200 | [diff] [blame] | 218 | .. code-block:: yaml |
219 | |||||
220 | system_metrics: | ||||
Ales Komarek | 7a593fa | 2016-10-22 17:32:35 +0200 | [diff] [blame] | 221 | system_metrics2: |
222 | title: graph | ||||
223 | editable: true | ||||
224 | hideControls: false | ||||
225 | row: | ||||
226 | usage: | ||||
227 | title: Usage | ||||
228 | height: 250px | ||||
229 | panel: | ||||
230 | usage-panel: | ||||
231 | title: Panel Title | ||||
232 | span: 6 | ||||
233 | editable: false | ||||
234 | type: graph | ||||
235 | target: | ||||
236 | A: | ||||
237 | refId: A | ||||
238 | target: "support_prd.cfg01_iot_tcpcloud_eu.cpu.0.idle" | ||||
239 | datasource: graphite01 | ||||
240 | renderer: flot | ||||
241 | showTitle: true | ||||
Ales Komarek | ae47c9f | 2016-10-22 12:30:30 +0200 | [diff] [blame] | 242 | |
Ales Komarek | 9e05491 | 2016-10-22 00:36:50 +0200 | [diff] [blame] | 243 | |
Ales Komarek | 8649089 | 2015-12-04 16:43:48 +0100 | [diff] [blame] | 244 | Read more |
245 | ========= | ||||
Ales Komarek | 4b6c866 | 2014-02-24 21:48:29 +0100 | [diff] [blame] | 246 | |
247 | * http://grafana.org/ | ||||
Ales Komarek | 5a23b51 | 2015-12-08 11:20:02 +0100 | [diff] [blame] | 248 | * http://docs.grafana.org/reference/export_import/ |