Take the 2-minute tour ×

In our Rails app we rescue most of the exceptions on ApplicationController to give correct API response, but still want to track errors happening using ErrorCollector. Is there a way to manually send error to NewRelic?

share|improve this question
add comment

3 Answers

Not sure if it's recommended way to use, but this works perfectly:

NewRelic::Agent.agent.error_collector.notice_error( exception )
share|improve this answer
add comment

Based on what I see in the New Relic agent code you can do

NewRelic::Agent.notice_error(exception, options)

I have tested this nad have this running in my stack

share|improve this answer
Here's the documentation for this: rdoc.info/github/newrelic/rpm/NewRelic/Agent:notice_error It's basically an alias to the method Igor included in his solution, except it returns nil instead of the exception. So while it behaves a little differently, it's essentially the same thing and much less verbose. –  Sean Moubry Sep 20 '13 at 18:19
add comment

Full documentation of the API call to notice errors and increment the error metric is the New Relic Ruby Agent API documentation here http://rdoc.info/github/newrelic/rpm/NewRelic/Agent/Transaction.notice_error

share|improve this answer
add comment

Your Answer


