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 | |
Guillaume Thouvenin | 22c462b | 2017-03-09 17:01:26 +0100 | [diff] [blame] | 158 | Server with two additionals plugins. It requires to have access to the Internet. |
| 159 | |
| 160 | .. code-block:: yaml |
| 161 | |
| 162 | grafana: |
| 163 | server: |
| 164 | enabled: true |
| 165 | plugins: |
| 166 | grafana-piechart-panel: |
| 167 | enabled: true |
| 168 | grafana-example-app: |
| 169 | enabled: true |
Ales Komarek | 7a593fa | 2016-10-22 17:32:35 +0200 | [diff] [blame] | 170 | |
Ales Komarek | ae47c9f | 2016-10-22 12:30:30 +0200 | [diff] [blame] | 171 | Collector setup |
| 172 | --------------- |
| 173 | |
Ales Komarek | 7a593fa | 2016-10-22 17:32:35 +0200 | [diff] [blame] | 174 | Used to aggregate dashboards from monitoring node. |
Ales Komarek | ae47c9f | 2016-10-22 12:30:30 +0200 | [diff] [blame] | 175 | |
| 176 | .. code-block:: yaml |
| 177 | |
| 178 | grafana: |
| 179 | collector: |
| 180 | enabled: true |
| 181 | |
| 182 | |
Ales Komarek | 9e05491 | 2016-10-22 00:36:50 +0200 | [diff] [blame] | 183 | Client setups |
| 184 | ------------- |
| 185 | |
Ales Komarek | 3f044b2 | 2016-10-30 00:27:24 +0200 | [diff] [blame] | 186 | Client with token based auth |
Ales Komarek | 9e05491 | 2016-10-22 00:36:50 +0200 | [diff] [blame] | 187 | |
| 188 | .. code-block:: yaml |
| 189 | |
| 190 | grafana: |
| 191 | client: |
| 192 | enabled: true |
| 193 | server: |
| 194 | protocol: https |
| 195 | host: grafana.host |
| 196 | port: 3000 |
| 197 | token: token |
Ales Komarek | 3f044b2 | 2016-10-30 00:27:24 +0200 | [diff] [blame] | 198 | |
| 199 | Client with base auth |
| 200 | |
| 201 | .. code-block:: yaml |
| 202 | |
| 203 | grafana: |
| 204 | client: |
| 205 | enabled: true |
| 206 | server: |
| 207 | protocol: https |
| 208 | host: grafana.host |
| 209 | port: 3000 |
| 210 | user: admin |
| 211 | password: password |
| 212 | |
| 213 | Client enforcing graphite data source |
| 214 | |
| 215 | .. code-block:: yaml |
| 216 | |
| 217 | grafana: |
| 218 | client: |
| 219 | enabled: true |
Ales Komarek | 9e05491 | 2016-10-22 00:36:50 +0200 | [diff] [blame] | 220 | datasource: |
| 221 | graphite: |
| 222 | type: graphite |
| 223 | host: mtr01.domain.com |
| 224 | protocol: https |
Ales Komarek | 9858822 | 2015-12-08 10:43:59 +0100 | [diff] [blame] | 225 | port: 443 |
Ales Komarek | 3f044b2 | 2016-10-30 00:27:24 +0200 | [diff] [blame] | 226 | |
| 227 | Client enforcing elasticsearch data source |
| 228 | |
| 229 | .. code-block:: yaml |
| 230 | |
| 231 | grafana: |
| 232 | client: |
| 233 | enabled: true |
| 234 | datasource: |
Ales Komarek | 9e05491 | 2016-10-22 00:36:50 +0200 | [diff] [blame] | 235 | elasticsearch: |
| 236 | type: elasticsearch |
| 237 | host: log01.domain.com |
Ales Komarek | 5a23b51 | 2015-12-08 11:20:02 +0100 | [diff] [blame] | 238 | port: 80 |
Ales Komarek | 5a23b51 | 2015-12-08 11:20:02 +0100 | [diff] [blame] | 239 | index: grafana-dash |
Ales Komarek | 9e05491 | 2016-10-22 00:36:50 +0200 | [diff] [blame] | 240 | |
Ales Komarek | 7a593fa | 2016-10-22 17:32:35 +0200 | [diff] [blame] | 241 | Client defined and enforced dashboard |
Ales Komarek | 9e05491 | 2016-10-22 00:36:50 +0200 | [diff] [blame] | 242 | |
| 243 | .. code-block:: yaml |
| 244 | |
| 245 | grafana: |
| 246 | client: |
| 247 | enabled: true |
| 248 | server: |
| 249 | host: grafana.host |
| 250 | port: 3000 |
| 251 | token: token |
| 252 | dashboard: |
| 253 | system_metrics: |
| 254 | title: "Generic system metrics" |
| 255 | style: dark |
| 256 | editable: false |
| 257 | row: |
| 258 | top: |
| 259 | title: "First row" |
| 260 | |
| 261 | Client enforced dashboards defined in salt-mine |
| 262 | |
| 263 | .. code-block:: yaml |
| 264 | |
| 265 | grafana: |
| 266 | client: |
| 267 | enabled: true |
Ales Komarek | ae47c9f | 2016-10-22 12:30:30 +0200 | [diff] [blame] | 268 | remote_data: |
| 269 | engine: salt_mine |
Ales Komarek | 9e05491 | 2016-10-22 00:36:50 +0200 | [diff] [blame] | 270 | server: |
| 271 | host: grafana.host |
| 272 | port: 3000 |
| 273 | token: token |
| 274 | |
Ales Komarek | 7a593fa | 2016-10-22 17:32:35 +0200 | [diff] [blame] | 275 | |
Ales Komarek | ae47c9f | 2016-10-22 12:30:30 +0200 | [diff] [blame] | 276 | Usage |
| 277 | ===== |
| 278 | |
Ales Komarek | d125d51 | 2016-10-24 11:00:40 +0200 | [diff] [blame] | 279 | There's a difference between JSON dashboard representation and models we us. |
| 280 | The lists used in JSON format [for rows, panels and target] were replaced by |
| 281 | dictionaries. This form of serialization allows better merging and overrides |
| 282 | of hierarchical data structures that dashboard models are. |
Ales Komarek | ae47c9f | 2016-10-22 12:30:30 +0200 | [diff] [blame] | 283 | |
Ales Komarek | 7a593fa | 2016-10-22 17:32:35 +0200 | [diff] [blame] | 284 | 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] | 285 | |
| 286 | .. code-block:: yaml |
| 287 | |
| 288 | system_metrics: |
| 289 | title: graph |
| 290 | editable: true |
| 291 | hideControls: false |
| 292 | rows: |
| 293 | - title: Usage |
| 294 | height: 250px |
| 295 | panels: |
| 296 | - title: Panel Title |
| 297 | span: 6 |
| 298 | editable: false |
| 299 | type: graph |
Guillaume Thouvenin | 2958bda | 2016-11-08 11:55:55 +0100 | [diff] [blame] | 300 | targets: |
Ales Komarek | ae47c9f | 2016-10-22 12:30:30 +0200 | [diff] [blame] | 301 | - refId: A |
| 302 | target: "support_prd.cfg01_iot_tcpcloud_eu.cpu.0.idle" |
| 303 | datasource: graphite01 |
| 304 | renderer: flot |
| 305 | showTitle: true |
| 306 | |
Ales Komarek | d125d51 | 2016-10-24 11:00:40 +0200 | [diff] [blame] | 307 | The modified version of Grafana dashboard format with dictionary declarations. |
| 308 | Please note that dictionary keys are only for logical separation and are not |
| 309 | displayed in generated dashboards. |
Ales Komarek | 7a593fa | 2016-10-22 17:32:35 +0200 | [diff] [blame] | 310 | |
Ales Komarek | ae47c9f | 2016-10-22 12:30:30 +0200 | [diff] [blame] | 311 | .. code-block:: yaml |
| 312 | |
| 313 | system_metrics: |
Ales Komarek | 7a593fa | 2016-10-22 17:32:35 +0200 | [diff] [blame] | 314 | system_metrics2: |
| 315 | title: graph |
| 316 | editable: true |
| 317 | hideControls: false |
| 318 | row: |
| 319 | usage: |
| 320 | title: Usage |
| 321 | height: 250px |
| 322 | panel: |
| 323 | usage-panel: |
| 324 | title: Panel Title |
| 325 | span: 6 |
| 326 | editable: false |
| 327 | type: graph |
| 328 | target: |
| 329 | A: |
| 330 | refId: A |
| 331 | target: "support_prd.cfg01_iot_tcpcloud_eu.cpu.0.idle" |
| 332 | datasource: graphite01 |
| 333 | renderer: flot |
| 334 | showTitle: true |
Ales Komarek | ae47c9f | 2016-10-22 12:30:30 +0200 | [diff] [blame] | 335 | |
Ales Komarek | 9e05491 | 2016-10-22 00:36:50 +0200 | [diff] [blame] | 336 | |
Ales Komarek | 8649089 | 2015-12-04 16:43:48 +0100 | [diff] [blame] | 337 | Read more |
| 338 | ========= |
Ales Komarek | 4b6c866 | 2014-02-24 21:48:29 +0100 | [diff] [blame] | 339 | |
| 340 | * http://grafana.org/ |
Ales Komarek | 5a23b51 | 2015-12-08 11:20:02 +0100 | [diff] [blame] | 341 | * http://docs.grafana.org/reference/export_import/ |
Filip Pytloun | 9e431b0 | 2017-02-02 13:02:03 +0100 | [diff] [blame] | 342 | |
| 343 | Documentation and Bugs |
| 344 | ====================== |
| 345 | |
| 346 | To learn how to install and update salt-formulas, consult the documentation |
| 347 | available online at: |
| 348 | |
| 349 | http://salt-formulas.readthedocs.io/ |
| 350 | |
| 351 | In the unfortunate event that bugs are discovered, they should be reported to |
| 352 | the appropriate issue tracker. Use Github issue tracker for specific salt |
| 353 | formula: |
| 354 | |
| 355 | https://github.com/salt-formulas/salt-formula-grafana/issues |
| 356 | |
| 357 | For feature requests, bug reports or blueprints affecting entire ecosystem, |
| 358 | use Launchpad salt-formulas project: |
| 359 | |
| 360 | https://launchpad.net/salt-formulas |
| 361 | |
| 362 | You can also join salt-formulas-users team and subscribe to mailing list: |
| 363 | |
| 364 | https://launchpad.net/~salt-formulas-users |
| 365 | |
| 366 | Developers wishing to work on the salt-formulas projects should always base |
| 367 | their work on master branch and submit pull request against specific formula. |
| 368 | |
| 369 | https://github.com/salt-formulas/salt-formula-grafana |
| 370 | |
| 371 | Any questions or feedback is always welcome so feel free to join our IRC |
| 372 | channel: |
| 373 | |
| 374 | #salt-formulas @ irc.freenode.net |