Skip to content
This repository was archived by the owner on Jan 23, 2025. It is now read-only.

Commit fff741f

Browse files
committed
include new relic middleware to show action hero actions for all transactions
1 parent c7ed96a commit fff741f

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

initializers/nrmid.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
var newrelic = require("newrelic");
2+
3+
var fixTransactionName = function(connection, actionTemplate, next) {
4+
if(connection.type === 'web'){
5+
newrelic.setControllerName(actionTemplate.name);
6+
}
7+
next(connection, true);
8+
}
9+
10+
var reportException = function(type, err, extraMessages, severity){
11+
newrelic.noticeError(err);
12+
}
13+
14+
exports.nrmid = function(api, next){
15+
api.actions.preProcessors.push(fixTransactionName);
16+
api.exceptionHandlers.reporters.push(reportException);
17+
next();
18+
};

0 commit comments

Comments
 (0)