Adding statsd

This commit is contained in:
Jonathan Cremin 2015-08-09 13:46:09 +01:00
parent 84e5925135
commit 741f49ad63
4 changed files with 12 additions and 0 deletions

View file

@ -24,6 +24,7 @@ import mongodb from 'mongodb-promisified';
const objectId = mongodb().ObjectId;
import debugname from 'debug';
const debug = debugname('hostr-web');
import stats from 'koa-statsd';
if (process.env.SENTRY_DSN) {
const ravenClient = new raven.Client(process.env.SENTRY_DSN);
@ -34,6 +35,10 @@ const redisUrl = process.env.REDIS_URL || process.env.REDISTOGO_URL || 'redis://
const app = koa();
if (process.env.STATSD_HOST) {
app.use(stats({prefix: 'hostr-web', host: process.env.STATSD_HOST}));
}
app.use(errors({template: path.join(__dirname, 'public', '404.html')}));
app.use(function*(next){