How to use the newrelic.noticeError function in newrelic

To help you get started, we’ve selected a few newrelic examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sergeyksv / tinelic / modules / web / index.js View on Github external
], safe.sure(cb, function () {
			// Set up Raven
			ctx.locals.ravenjs = new raven.Client('http://blah:blah@localhost/collect/sentry/'+self_id);
			setTimeout(function () {
				ctx.locals.ravenjs.captureError(new Error("Tinelic Sentry startup!"));
			}, 1000);
			require("newrelic").noticeError( new Error("Tinelic NewRelic startup!"));

			cb(null,{api:{
				getFeed:function (token, p, cb) {
					if (ctx.locals.newrelic)
						ctx.locals.newrelic.setTransactionName("/webapi/"+(token=="public"?"public":"token")+"/feed/"+p.feed);
					feed = p.feed.split(".");
					requirejs(["feed/"+feed[0]], function (m) {
						m[feed[1]](token,p.params,cb);
					},cb);
				}
			}});
		}));
	},cb);
github sergeyksv / tinelic / modules / collectapi.js View on Github external
}, function( error ){
		if (error) {
			// report getsentry error with newrelic ;)
			newrelic.noticeError(error);
			res.writeHead( 500, { 'x-sentry-error': error.toString() } );
			res.status(500).end( error.toString() );
		} else {
			res.status(200).end( "ok" );
		}
	});
});
github sergeyksv / tinelic / modules / collect.js View on Github external
}, error => {
						if (error) {
							// report getsentry error with newrelic ;)
							newrelic.noticeError(error);
							res.writeHead(500, { 'x-sentry-error': error.toString() });
							res.status(500).end(error.toString());
						} else {
							res.status(200).end('ok');
						}
					});
				}
github sergeyksv / tinelic / modules / collectapi.js View on Github external
}, function (err) {
		if (err) {
			newrelic.noticeError(err);
			console.log(data);
		}
		res.set('Content-Type', 'image/gif');
		res.send(buf);
	});
});
github sergeyksv / tinelic / app.js View on Github external
const callback = function (err, ...args2) {
							if (err)
								newrelic.noticeError(err);
							cb.call(this, err, ...args2);
						};
github brave / vault / src / index.js View on Github external
logger.forEach(function (entry) {
    if ((entry.data) && (typeof entry.data.msec === 'number')) { params.request.duration = entry.data.msec }
  })

  if ((newrelic) && (request.response._error)) {
    flattened = {}
    underscore.keys(params).forEach(param => {
      underscore.keys(params[param]).forEach(key => {
        if ((param === 'error') && ((key === 'message') || (key === 'payload') || (key === 'stack'))) return

        flattened[param + '.' + key] = params[param][key]
      })
    })
    flattened.url = flattened['request.pathname']
    delete flattened['request.pathname']
    newrelic.noticeError(request.response._error, flattened)
  }

  debug('end', { sdebug: params })
})
github artsy / metaphysics / src / lib / graphql-error-handler.js View on Github external
return graphqlError => {
      const error = graphqlError.originalError || graphqlError
      if (error.statusCode === undefined || error.statusCode >= 500) {
        newrelic.noticeError(error, query)
      }
      return { message: error.message }
    }
  }
github sergeyksv / tinelic / modules / collect.js View on Github external
}, err => {
							if (err)
								newrelic.noticeError(err);
							transaction.end();
						});
					});