forked from shakrmedia/docker-statsd-influxdb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.js
42 lines (37 loc) · 1.11 KB
/
config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
(function() {
if (process.env.INFLUXDB_HOST !== undefined) {
var host = process.env.INFLUXDB_HOST;
} else if (process.env.INFLUXDB_MASTER_SERVICE_HOST !== undefined) {
var host = process.env.INFLUXDB_MASTER_SERVICE_HOST;
} else {
var host = "127.0.0.1";
}
if (process.env.INFLUXDB_PORT !== undefined) {
var port = parseInt(process.env.INFLUXDB_PORT);
} else if (process.env.INFLUXDB_MASTSER_SERVICE_PORT !== undefined) {
var port = parseInt(process.env.INFLUXDB_MASTER_SERVICE_PORT);
} else {
var port = 8086;
}
return {
influxdb: {
host: host,
port: port,
database: process.env.INFLUXDB_DATABASE || "site_dev",
username: process.env.INFLUXDB_USERNAME || "root",
password: process.env.INFLUXDB_PASSWORD || "root",
flush: {
enable: true
},
proxy: {
enable: false,
suffix: 'raw',
flushInterval: 1000
}
},
port: parseInt(process.env.STATSD_PORT) || 8125,
debug: process.env.STATSD_DEBUG || false,
backends: ['statsd-influxdb-backend'],
legacyNamespace: false
};
})();