-
Notifications
You must be signed in to change notification settings - Fork 400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Blocking controller instrumentation #91
Comments
something like this should do the trick: var newrelic = require('newrelic');
// ...elsewhere...
function pingController(req, res, next) {
newrelic.setIgnoreTransaction(true);
// ...other pingController stuff...
next();
}
// ...elsewhere...
app.get('/ping', pingController); You could probably create a quick and dirty middleware to call Let us know if that doesn't work! |
Looks great, thanks. Two questions though
if(process.env.NEW_RELIC_LICENSE_KEY) {
require('newrelic');
} is it correct to remove the if-block and instead set
|
Yes. Just make sure that you set it before you
Yes, the module bootstraps a single agent / API and then returns the same object each time you require the module. |
Just wanted to let you know it seems to work as expected. Route definition: app.get('/ping', ignoreNewrelic(), controllers.web.ping);
var newrelic = require('newrelic');
module.exports = function() {
return function(req, res, next) {
newrelic.setIgnoreTransaction(true);
next();
};
}; Ping controller: module.exports = function(req, res, next) {
res.end('pong');
}; |
Great! BTW, you don't need var api = require('newrelic');
module.exports = function (req, res, next) {
api.setIgnoreTransaction(true);
next();
} Glad it's working for you! |
…nestjs/app/protobufjs-7.2.4 chore(deps): bump protobufjs from 7.2.3 to 7.2.4 in /nestjs/app
…-node-12 Dropped Node 12.
Update setup node
removed node 10 from ci, updated engines to >=12, added files list an…
removed node 10 from ci, updated engines to >=12, added files list an…
Is there a node equivalent to this https://docs.newrelic.com/docs/ruby/blocking-controller-instrumentation ?
I've set up Availability monitoring but the ping tampers with the stats (much more requests, much less errors, much less response time etc). How do I create a connect/express route which will not be tracked? E.g. sth. like a middleware which I can add to the routes:
The text was updated successfully, but these errors were encountered: