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