Ales Komarek | 9a57905 | 2014-02-24 23:14:45 +0100 | [diff] [blame] | 1 | /** @scratch /configuration/config.js/1 |
| 2 | * == Configuration |
| 3 | * config.js is where you will find the core Grafana configuration. This file contains parameter that |
| 4 | * must be set before kibana is run for the first time. |
| 5 | */ |
| 6 | define(['settings'], |
| 7 | function (Settings) { |
| 8 | "use strict"; |
| 9 | |
| 10 | return new Settings({ |
| 11 | |
| 12 | /** |
| 13 | * elasticsearch url: |
| 14 | * For Basic authentication use: http://username:password@domain.com:9200 |
| 15 | */ |
Michael Kutý | 56bc4d1 | 2014-03-03 19:01:04 +0100 | [diff] [blame^] | 16 | elasticsearch: "http://{{ salt['pillar.get']('grafana:server:elasticsearch:host', "") }}:{{ salt['pillar.get']('grafana:server:elasticsearch:port', 9200) }}", |
Ales Komarek | 9a57905 | 2014-02-24 23:14:45 +0100 | [diff] [blame] | 17 | |
| 18 | /** |
| 19 | * graphite-web url: |
| 20 | * For Basic authentication use: http://username:password@domain.com |
| 21 | * Basic authentication requires special HTTP headers to be configured |
| 22 | * in nginx or apache for cross origin domain sharing to work (CORS). |
| 23 | * Check install documentation on github |
| 24 | */ |
Michael Kutý | 56bc4d1 | 2014-03-03 19:01:04 +0100 | [diff] [blame^] | 25 | {% set data = pillar.grafana.server.data %} |
| 26 | |
| 27 | {% if data.get("type", "") == "graphite" %} |
| 28 | {% if data.get("ssl", "false") %} |
| 29 | graphiteUrl: "https://"+{{ data.get("host", "") }}+":{{ data.get("port", 443) }}", |
| 30 | {% else %} |
| 31 | graphiteUrl: "http://"+{{ data.get("host", "") }}+":{{ data.get("port", 80) }}", |
| 32 | {% endif %} |
| 33 | {% endif %} |
Ales Komarek | 9a57905 | 2014-02-24 23:14:45 +0100 | [diff] [blame] | 34 | |
| 35 | /** |
| 36 | * Multiple graphite servers? Comment out graphiteUrl and replace with |
| 37 | * |
| 38 | * datasources: { |
| 39 | * data_center_us: { type: 'graphite', url: 'http://<graphite_url>', default: true }, |
| 40 | * data_center_eu: { type: 'graphite', url: 'http://<graphite_url>' } |
| 41 | * } |
| 42 | */ |
| 43 | |
| 44 | default_route: '/dashboard/file/default.json', |
| 45 | |
| 46 | /** |
| 47 | * If your graphite server has another timezone than you & users browsers specify the offset here |
| 48 | * Example: "-0500" (for UTC - 5 hours) |
| 49 | */ |
| 50 | timezoneOffset: null, |
| 51 | |
| 52 | grafana_index: "grafana-dash", |
| 53 | |
| 54 | panel_names: [ |
| 55 | 'text', |
| 56 | 'graphite' |
| 57 | ] |
| 58 | }); |
| 59 | }); |