diff --git a/initializers/nrmid.js b/initializers/nrmid.js new file mode 100644 index 000000000..f5a06ac2f --- /dev/null +++ b/initializers/nrmid.js @@ -0,0 +1,18 @@ +var newrelic = require("newrelic"); + +var fixTransactionName = function(connection, actionTemplate, next) { + if(connection.type === 'web'){ + newrelic.setControllerName(actionTemplate.name); + } + next(connection, true); +} + +var reportException = function(type, err, extraMessages, severity){ + newrelic.noticeError(err); +} + +exports.nrmid = function(api, next){ + api.actions.preProcessors.push(fixTransactionName); + api.exceptionHandlers.reporters.push(reportException); + next(); +}; \ No newline at end of file diff --git a/routes.js b/routes.js index e797691c1..e58a61de4 100755 --- a/routes.js +++ b/routes.js @@ -333,7 +333,7 @@ exports.routes = { { path: "/:apiVersion/download/document/:docId", action: "downloadDocument" }, - { path: "/:apiVersion/reports/analyze", action: "getChallengeAnalyze" }, + //{ path: "/:apiVersion/reports/analyze", action: "getChallengeAnalyze" }, { path: "/:apiVersion/reports/client/costs", action: "getClientChallengeCosts" }, { path: "/:apiVersion/reports/client/challenges", action: "clientChallengeCosts" }, { path: "/:apiVersion/reports/client/activeChallenges", action: "getClientActiveChallengeCosts" },