blob: 504dfb6f637480c7d578b76f1a14fedcc9fc8980 [file] [log] [blame]
Ales Komarek9a579052014-02-24 23:14:45 +01001/** @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 */
6define(['settings'],
7function (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ý56bc4d12014-03-03 19:01:04 +010016 elasticsearch: "http://{{ salt['pillar.get']('grafana:server:elasticsearch:host', "") }}:{{ salt['pillar.get']('grafana:server:elasticsearch:port', 9200) }}",
Ales Komarek9a579052014-02-24 23:14:45 +010017
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ýa52b0db2014-03-03 19:54:05 +010025 {% if (pillar.grafana.server.data|length) == 1 %}
Michael Kutý56bc4d12014-03-03 19:01:04 +010026
Michael Kutý8af52952014-03-03 19:38:47 +010027 {% for data in pillar.grafana.server.data %}
28 {%- if data.type == "graphite" %}
Michael Kutýa52b0db2014-03-03 19:54:05 +010029 graphiteUrl: "http://{{ data.host }}:{{ data.port }}",
Michael Kutý8af52952014-03-03 19:38:47 +010030 {%- endif %}
31 {% endfor %}
32
33 {%- else %}
34 /*graphiteUrl: "http://"+{{ salt['pillar.get']('grafana:server:data:host', "")}}+":{{ salt['pillar.get']('grafana:server:data:port', 80)}}",
35 */
Ales Komarek9a579052014-02-24 23:14:45 +010036
37 /**
38 * Multiple graphite servers? Comment out graphiteUrl and replace with
39 *
40 * datasources: {
Michael Kutýa52b0db2014-03-03 19:54:05 +010041
Ales Komarek9a579052014-02-24 23:14:45 +010042 * data_center_us: { type: 'graphite', url: 'http://<graphite_url>', default: true },
43 * data_center_eu: { type: 'graphite', url: 'http://<graphite_url>' }
44 * }
45 */
Michael Kutý8af52952014-03-03 19:38:47 +010046 {%- endif %}
Ales Komarek9a579052014-02-24 23:14:45 +010047
48 default_route: '/dashboard/file/default.json',
49
50 /**
51 * If your graphite server has another timezone than you & users browsers specify the offset here
52 * Example: "-0500" (for UTC - 5 hours)
53 */
54 timezoneOffset: null,
55
56 grafana_index: "grafana-dash",
57
58 panel_names: [
59 'text',
60 'graphite'
61 ]
62 });
63});