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 | 377c14c | 2016-12-05 13:11:53 +0100 | [diff] [blame] | 47 | Server installed with LDAP authentication and all authenticated users are |
| 48 | administrators |
| 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 | |
| 70 | Server 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 | |
| 94 | Server 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 Thouvenin | 2958bda | 2016-11-08 11:55:55 +0100 | [diff] [blame] | 124 | Server installed with default StackLight JSON dashboards. This will |
| 125 | be replaced by the possibility for a service to provide its own dashboard |
| 126 | using salt-mine. |
Guillaume Thouvenin | 70ca667 | 2016-10-26 11:25:37 +0200 | [diff] [blame] | 127 | |
| 128 | .. code-block:: yaml |
| 129 | |
| 130 | grafana: |
| 131 | server: |
| 132 | enabled: true |
Guillaume Thouvenin | 70ca667 | 2016-10-26 11:25:37 +0200 | [diff] [blame] | 133 | dashboards: |
| 134 | enabled: true |
| 135 | path: /var/lib/grafana/dashboards |
| 136 | |
Ales Komarek | 3f044b2 | 2016-10-30 00:27:24 +0200 | [diff] [blame] | 137 | Server 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 Komarek | 7a593fa | 2016-10-22 17:32:35 +0200 | [diff] [blame] | 154 | |
Ales Komarek | ae47c9f | 2016-10-22 12:30:30 +0200 | [diff] [blame] | 155 | Collector setup |
| 156 | --------------- |
| 157 | |
Ales Komarek | 7a593fa | 2016-10-22 17:32:35 +0200 | [diff] [blame] | 158 | Used to aggregate dashboards from monitoring node. |
Ales Komarek | ae47c9f | 2016-10-22 12:30:30 +0200 | [diff] [blame] | 159 | |
| 160 | .. code-block:: yaml |
| 161 | |
| 162 | grafana: |
| 163 | collector: |
| 164 | enabled: true |
| 165 | |
| 166 | |
Ales Komarek | 9e05491 | 2016-10-22 00:36:50 +0200 | [diff] [blame] | 167 | Client setups |
| 168 | ------------- |
| 169 | |
Ales Komarek | 3f044b2 | 2016-10-30 00:27:24 +0200 | [diff] [blame] | 170 | Client with token based auth |
Ales Komarek | 9e05491 | 2016-10-22 00:36:50 +0200 | [diff] [blame] | 171 | |
| 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 Komarek | 3f044b2 | 2016-10-30 00:27:24 +0200 | [diff] [blame] | 182 | |
| 183 | Client 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 | |
| 197 | Client enforcing graphite data source |
| 198 | |
| 199 | .. code-block:: yaml |
| 200 | |
| 201 | grafana: |
| 202 | client: |
| 203 | enabled: true |
Ales Komarek | 9e05491 | 2016-10-22 00:36:50 +0200 | [diff] [blame] | 204 | datasource: |
| 205 | graphite: |
| 206 | type: graphite |
| 207 | host: mtr01.domain.com |
| 208 | protocol: https |
Ales Komarek | 9858822 | 2015-12-08 10:43:59 +0100 | [diff] [blame] | 209 | port: 443 |
Ales Komarek | 3f044b2 | 2016-10-30 00:27:24 +0200 | [diff] [blame] | 210 | |
| 211 | Client enforcing elasticsearch data source |
| 212 | |
| 213 | .. code-block:: yaml |
| 214 | |
| 215 | grafana: |
| 216 | client: |
| 217 | enabled: true |
| 218 | datasource: |
Ales Komarek | 9e05491 | 2016-10-22 00:36:50 +0200 | [diff] [blame] | 219 | elasticsearch: |
| 220 | type: elasticsearch |
| 221 | host: log01.domain.com |
Ales Komarek | 5a23b51 | 2015-12-08 11:20:02 +0100 | [diff] [blame] | 222 | port: 80 |
Ales Komarek | 5a23b51 | 2015-12-08 11:20:02 +0100 | [diff] [blame] | 223 | index: grafana-dash |
Ales Komarek | 9e05491 | 2016-10-22 00:36:50 +0200 | [diff] [blame] | 224 | |
Ales Komarek | 7a593fa | 2016-10-22 17:32:35 +0200 | [diff] [blame] | 225 | Client defined and enforced dashboard |
Ales Komarek | 9e05491 | 2016-10-22 00:36:50 +0200 | [diff] [blame] | 226 | |
| 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 | |
| 245 | Client enforced dashboards defined in salt-mine |
| 246 | |
| 247 | .. code-block:: yaml |
| 248 | |
| 249 | grafana: |
| 250 | client: |
| 251 | enabled: true |
Ales Komarek | ae47c9f | 2016-10-22 12:30:30 +0200 | [diff] [blame] | 252 | remote_data: |
| 253 | engine: salt_mine |
Ales Komarek | 9e05491 | 2016-10-22 00:36:50 +0200 | [diff] [blame] | 254 | server: |
| 255 | host: grafana.host |
| 256 | port: 3000 |
| 257 | token: token |
| 258 | |
Ales Komarek | 7a593fa | 2016-10-22 17:32:35 +0200 | [diff] [blame] | 259 | |
Ales Komarek | ae47c9f | 2016-10-22 12:30:30 +0200 | [diff] [blame] | 260 | Usage |
| 261 | ===== |
| 262 | |
Ales Komarek | d125d51 | 2016-10-24 11:00:40 +0200 | [diff] [blame] | 263 | There's a difference between JSON dashboard representation and models we us. |
| 264 | The lists used in JSON format [for rows, panels and target] were replaced by |
| 265 | dictionaries. This form of serialization allows better merging and overrides |
| 266 | of hierarchical data structures that dashboard models are. |
Ales Komarek | ae47c9f | 2016-10-22 12:30:30 +0200 | [diff] [blame] | 267 | |
Ales Komarek | 7a593fa | 2016-10-22 17:32:35 +0200 | [diff] [blame] | 268 | 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] | 269 | |
| 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 Thouvenin | 2958bda | 2016-11-08 11:55:55 +0100 | [diff] [blame] | 284 | targets: |
Ales Komarek | ae47c9f | 2016-10-22 12:30:30 +0200 | [diff] [blame] | 285 | - refId: A |
| 286 | target: "support_prd.cfg01_iot_tcpcloud_eu.cpu.0.idle" |
| 287 | datasource: graphite01 |
| 288 | renderer: flot |
| 289 | showTitle: true |
| 290 | |
Ales Komarek | d125d51 | 2016-10-24 11:00:40 +0200 | [diff] [blame] | 291 | The modified version of Grafana dashboard format with dictionary declarations. |
| 292 | Please note that dictionary keys are only for logical separation and are not |
| 293 | displayed in generated dashboards. |
Ales Komarek | 7a593fa | 2016-10-22 17:32:35 +0200 | [diff] [blame] | 294 | |
Ales Komarek | ae47c9f | 2016-10-22 12:30:30 +0200 | [diff] [blame] | 295 | .. code-block:: yaml |
| 296 | |
| 297 | system_metrics: |
Ales Komarek | 7a593fa | 2016-10-22 17:32:35 +0200 | [diff] [blame] | 298 | 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 Komarek | ae47c9f | 2016-10-22 12:30:30 +0200 | [diff] [blame] | 319 | |
Ales Komarek | 9e05491 | 2016-10-22 00:36:50 +0200 | [diff] [blame] | 320 | |
Ales Komarek | 8649089 | 2015-12-04 16:43:48 +0100 | [diff] [blame] | 321 | Read more |
| 322 | ========= |
Ales Komarek | 4b6c866 | 2014-02-24 21:48:29 +0100 | [diff] [blame] | 323 | |
| 324 | * http://grafana.org/ |
Ales Komarek | 5a23b51 | 2015-12-08 11:20:02 +0100 | [diff] [blame] | 325 | * http://docs.grafana.org/reference/export_import/ |