summaryrefslogtreecommitdiff
path: root/worker.js
diff options
context:
space:
mode:
Diffstat (limited to 'worker.js')
-rw-r--r--worker.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/worker.js b/worker.js
index b0d9cf4..7cac550 100644
--- a/worker.js
+++ b/worker.js
@@ -8,6 +8,7 @@ const amqp = require("amqplib"),
Promise = require("bluebird"),
winston = require("winston"),
loggly = require("winston-loggly-bulk"),
+ datadog = require("winston-datadog"),
Seq = require("sequelize"),
cacheManager = require("cache-manager"),
api_name_mappings = require("../orm/mappings").map,
@@ -18,6 +19,7 @@ const RABBITMQ_URI = process.env.RABBITMQ_URI,
DATABASE_URI = process.env.DATABASE_URI,
QUEUE = process.env.QUEUE || "shrink",
LOGGLY_TOKEN = process.env.LOGGLY_TOKEN,
+ DATADOG_TOKEN = process.env.DATADOG_TOKEN,
// matches + players, 5 players with 50 matches as default
BATCHSIZE = parseInt(process.env.BATCHSIZE) || 20,
// maximum number of elements to be inserted in one statement
@@ -46,6 +48,12 @@ if (LOGGLY_TOKEN)
json: true
});
+// datadog integration
+if (DATADOG_TOKEN)
+ logger.add(new datadog({
+ api_key: DATADOG_TOKEN
+ }), null, true);
+
// split an array into arrays of max chunksize
function* chunks(arr) {
for (let c=0, len=arr.length; c<len; c+=CHUNKSIZE)