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 | |
Guillaume Thouvenin | 54a1b74 | 2016-12-13 10:08:32 +0100 | [diff] [blame^] | 16 | Server installed from system package and listening on 1.2.3.4:3000 (the default |
| 17 | is 0.0.0.0:3000) |
Ales Komarek | 9e05491 | 2016-10-22 00:36:50 +0200 | [diff] [blame] | 18 | |
| 19 | .. code-block:: yaml |
Michael Kutý | a79bbdb | 2014-03-03 20:46:34 +0100 | [diff] [blame] | 20 | |
| 21 | grafana: |
| 22 | server: |
| 23 | enabled: true |
Guillaume Thouvenin | 54a1b74 | 2016-12-13 10:08:32 +0100 | [diff] [blame^] | 24 | bind: |
| 25 | address: 1.2.3.4 |
| 26 | port: 3000 |
Ales Komarek | 9e05491 | 2016-10-22 00:36:50 +0200 | [diff] [blame] | 27 | admin: |
| 28 | user: admin |
| 29 | password: passwd |
| 30 | database: |
| 31 | engine: sqlite |
| 32 | |
| 33 | Server 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 Komarek | 9858822 | 2015-12-08 10:43:59 +0100 | [diff] [blame] | 43 | database: |
| 44 | engine: postgresql |
Michael Kutý | a79bbdb | 2014-03-03 20:46:34 +0100 | [diff] [blame] | 45 | host: localhost |
Ales Komarek | 9858822 | 2015-12-08 10:43:59 +0100 | [diff] [blame] | 46 | port: 5432 |
Ales Komarek | 9e05491 | 2016-10-22 00:36:50 +0200 | [diff] [blame] | 47 | name: grafana |
| 48 | user: grafana |
| 49 | password: passwd |
| 50 | |
Guillaume Thouvenin | 377c14c | 2016-12-05 13:11:53 +0100 | [diff] [blame] | 51 | Server installed with LDAP authentication and all authenticated users are |
| 52 | administrators |
| 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 | |
| 74 | Server 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 | |
| 98 | Server 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 Thouvenin | 2958bda | 2016-11-08 11:55:55 +0100 | [diff] [blame] | 128 | Server installed with default StackLight JSON dashboards. This will |
| 129 | be replaced by the possibility for a service to provide its own dashboard |
| 130 | using salt-mine. |
Guillaume Thouvenin | 70ca667 | 2016-10-26 11:25:37 +0200 | [diff] [blame] | 131 | |
| 132 | .. code-block:: yaml |
| 133 | |
| 134 | grafana: |
| 135 | server: |
| 136 | enabled: true |
Guillaume Thouvenin | 70ca667 | 2016-10-26 11:25:37 +0200 | [diff] [blame] | 137 | dashboards: |
| 138 | enabled: true |
| 139 | path: /var/lib/grafana/dashboards |
| 140 | |
Ales Komarek | 3f044b2 | 2016-10-30 00:27:24 +0200 | [diff] [blame] | 141 | Server 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 Komarek | 7a593fa | 2016-10-22 17:32:35 +0200 | [diff] [blame] | 158 | |
Ales Komarek | ae47c9f | 2016-10-22 12:30:30 +0200 | [diff] [blame] | 159 | Collector setup |
| 160 | --------------- |
| 161 | |
Ales Komarek | 7a593fa | 2016-10-22 17:32:35 +0200 | [diff] [blame] | 162 | Used to aggregate dashboards from monitoring node. |
Ales Komarek | ae47c9f | 2016-10-22 12:30:30 +0200 | [diff] [blame] | 163 | |
| 164 | .. code-block:: yaml |
| 165 | |
| 166 | grafana: |
| 167 | collector: |
| 168 | enabled: true |
| 169 | |
| 170 | |
Ales Komarek | 9e05491 | 2016-10-22 00:36:50 +0200 | [diff] [blame] | 171 | Client setups |
| 172 | ------------- |
| 173 | |
Ales Komarek | 3f044b2 | 2016-10-30 00:27:24 +0200 | [diff] [blame] | 174 | Client with token based auth |
Ales Komarek | 9e05491 | 2016-10-22 00:36:50 +0200 | [diff] [blame] | 175 | |
| 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 Komarek | 3f044b2 | 2016-10-30 00:27:24 +0200 | [diff] [blame] | 186 | |
| 187 | Client 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 | |
| 201 | Client enforcing graphite data source |
| 202 | |
| 203 | .. code-block:: yaml |
| 204 | |
| 205 | grafana: |
| 206 | client: |
| 207 | enabled: true |
Ales Komarek | 9e05491 | 2016-10-22 00:36:50 +0200 | [diff] [blame] | 208 | datasource: |
| 209 | graphite: |
| 210 | type: graphite |
| 211 | host: mtr01.domain.com |
| 212 | protocol: https |
Ales Komarek | 9858822 | 2015-12-08 10:43:59 +0100 | [diff] [blame] | 213 | port: 443 |
Ales Komarek | 3f044b2 | 2016-10-30 00:27:24 +0200 | [diff] [blame] | 214 | |
| 215 | Client enforcing elasticsearch data source |
| 216 | |
| 217 | .. code-block:: yaml |
| 218 | |
| 219 | grafana: |
| 220 | client: |
| 221 | enabled: true |
| 222 | datasource: |
Ales Komarek | 9e05491 | 2016-10-22 00:36:50 +0200 | [diff] [blame] | 223 | elasticsearch: |
| 224 | type: elasticsearch |
| 225 | host: log01.domain.com |
Ales Komarek | 5a23b51 | 2015-12-08 11:20:02 +0100 | [diff] [blame] | 226 | port: 80 |
Ales Komarek | 5a23b51 | 2015-12-08 11:20:02 +0100 | [diff] [blame] | 227 | index: grafana-dash |
Ales Komarek | 9e05491 | 2016-10-22 00:36:50 +0200 | [diff] [blame] | 228 | |
Ales Komarek | 7a593fa | 2016-10-22 17:32:35 +0200 | [diff] [blame] | 229 | Client defined and enforced dashboard |
Ales Komarek | 9e05491 | 2016-10-22 00:36:50 +0200 | [diff] [blame] | 230 | |
| 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 | |
| 249 | Client enforced dashboards defined in salt-mine |
| 250 | |
| 251 | .. code-block:: yaml |
| 252 | |
| 253 | grafana: |
| 254 | client: |
| 255 | enabled: true |
Ales Komarek | ae47c9f | 2016-10-22 12:30:30 +0200 | [diff] [blame] | 256 | remote_data: |
| 257 | engine: salt_mine |
Ales Komarek | 9e05491 | 2016-10-22 00:36:50 +0200 | [diff] [blame] | 258 | server: |
| 259 | host: grafana.host |
| 260 | port: 3000 |
| 261 | token: token |
| 262 | |
Ales Komarek | 7a593fa | 2016-10-22 17:32:35 +0200 | [diff] [blame] | 263 | |
Ales Komarek | ae47c9f | 2016-10-22 12:30:30 +0200 | [diff] [blame] | 264 | Usage |
| 265 | ===== |
| 266 | |
Ales Komarek | d125d51 | 2016-10-24 11:00:40 +0200 | [diff] [blame] | 267 | There's a difference between JSON dashboard representation and models we us. |
| 268 | The lists used in JSON format [for rows, panels and target] were replaced by |
| 269 | dictionaries. This form of serialization allows better merging and overrides |
| 270 | of hierarchical data structures that dashboard models are. |
Ales Komarek | ae47c9f | 2016-10-22 12:30:30 +0200 | [diff] [blame] | 271 | |
Ales Komarek | 7a593fa | 2016-10-22 17:32:35 +0200 | [diff] [blame] | 272 | 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] | 273 | |
| 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 Thouvenin | 2958bda | 2016-11-08 11:55:55 +0100 | [diff] [blame] | 288 | targets: |
Ales Komarek | ae47c9f | 2016-10-22 12:30:30 +0200 | [diff] [blame] | 289 | - refId: A |
| 290 | target: "support_prd.cfg01_iot_tcpcloud_eu.cpu.0.idle" |
| 291 | datasource: graphite01 |
| 292 | renderer: flot |
| 293 | showTitle: true |
| 294 | |
Ales Komarek | d125d51 | 2016-10-24 11:00:40 +0200 | [diff] [blame] | 295 | The modified version of Grafana dashboard format with dictionary declarations. |
| 296 | Please note that dictionary keys are only for logical separation and are not |
| 297 | displayed in generated dashboards. |
Ales Komarek | 7a593fa | 2016-10-22 17:32:35 +0200 | [diff] [blame] | 298 | |
Ales Komarek | ae47c9f | 2016-10-22 12:30:30 +0200 | [diff] [blame] | 299 | .. code-block:: yaml |
| 300 | |
| 301 | system_metrics: |
Ales Komarek | 7a593fa | 2016-10-22 17:32:35 +0200 | [diff] [blame] | 302 | 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 Komarek | ae47c9f | 2016-10-22 12:30:30 +0200 | [diff] [blame] | 323 | |
Ales Komarek | 9e05491 | 2016-10-22 00:36:50 +0200 | [diff] [blame] | 324 | |
Ales Komarek | 8649089 | 2015-12-04 16:43:48 +0100 | [diff] [blame] | 325 | Read more |
| 326 | ========= |
Ales Komarek | 4b6c866 | 2014-02-24 21:48:29 +0100 | [diff] [blame] | 327 | |
| 328 | * http://grafana.org/ |
Ales Komarek | 5a23b51 | 2015-12-08 11:20:02 +0100 | [diff] [blame] | 329 | * http://docs.grafana.org/reference/export_import/ |