Skip to content
Snippets Groups Projects
Commit 107485d9 authored by Pete Fritchman's avatar Pete Fritchman
Browse files

plumb in middleware to send request logs to statsd

parent 3d3578a8
No related branches found
No related tags found
No related merge requests found
......@@ -97,6 +97,16 @@ app.use(express.logger({
}
}));
var statsd_config = config.get('statsd');
if (statsd_config && statsd_config.enabled) {
logger_statsd = require("connect-logger-statsd");
app.use(logger_statsd({
host: statsd_config.hostname || "localhost",
port: statsd_config.port || 8125,
prefix: statsd_config.prefix || "browserid.webhead."
}));
}
// #3 - Add Strict-Transport-Security headers if we're serving over SSL
if (config.get('scheme') == 'https') {
app.use(function(req, resp, next) {
......
......@@ -75,6 +75,16 @@ app.use(express.logger({
}
}));
var statsd_config = config.get('statsd');
if (statsd_config && statsd_config.enabled) {
logger_statsd = require("connect-logger-statsd");
app.use(logger_statsd({
host: statsd_config.hostname || "localhost",
port: statsd_config.port || 8125,
prefix: statsd_config.prefix || "browserid.dbwriter."
}));
}
// Add Strict-Transport-Security headers if we're serving over SSL
if (config.get('scheme') == 'https') {
app.use(function(req, resp, next) {
......
......@@ -67,6 +67,16 @@ app.use(express.logger({
}
}));
var statsd_config = config.get('statsd');
if (statsd_config && statsd_config.enabled) {
logger_statsd = require("connect-logger-statsd");
app.use(logger_statsd({
host: statsd_config.hostname || "localhost",
port: statsd_config.port || 8125,
prefix: statsd_config.prefix || "browserid.keysigner."
}));
}
app.use(function(req, resp, next) {
next();
});
......
......@@ -66,6 +66,16 @@ app.use(express.logger({
}
}));
var statsd_config = config.get('statsd');
if (statsd_config && statsd_config.enabled) {
logger_statsd = require("connect-logger-statsd");
app.use(logger_statsd({
host: statsd_config.hostname || "localhost",
port: statsd_config.port || 8125,
prefix: statsd_config.prefix || "browserid.verifier."
}));
}
app.use(express.bodyParser());
app.post('/verify', function(req, resp, next) {
......
......@@ -83,6 +83,9 @@ g_configs.production = {
create_schema: true,
may_write: false
},
statsd: {
enabled: false
},
bcrypt_work_factor: 12,
authentication_duration_ms: (2 * 7 * 24 * 60 * 60 * 1000),
certificate_validity_ms: (24 * 60 * 60 * 1000),
......
......@@ -29,6 +29,8 @@
, "postprocess": "0.0.3"
, "urlparse": "0.0.1"
, "uglifycss": "0.0.4"
, "node-statsd": "https://github.com/mojodna/node-statsd/tarball/2584c08fad"
, "connect-logger-statsd": "0.0.1"
}
, "scripts": {
"postinstall": "./scripts/generate_ephemeral_keys.sh",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment