To send error data that you are handling in your own code to New Relic, use the Ruby agent API NewRelic::Agent.notice_error
call within your error handler.
Notify the New Relic Ruby agent of an error
This API call takes the exception and an optional options hash. Use this format:
notice_error(exception, options = { }) ⇒ Object
This function records the given error and passes it through the normal error filtering process, including configuration-based ignoring of errors and the global #ignore_error_filter
method if defined.
The exception
is the exception to be recorded, or an error message. If needed, you can also include options = { }
. The following parameters will receive special treatment, and any other parameters you supply will be treated as custom parameters.
options = { } | Comments |
---|---|
| Only records the error trace. This does not affect the error rate or Apdex status. For information on expected errors in the UI, see View expected errors. Replaces the |
| Custom parameters. |
| The request path, minus any request parameters or query string. Usually not needed. Include this only if you are calling |
| The metric name associated with the transaction. Usually not needed. Include this only if you are calling |
| Older Ruby agent versions allowed passing a |
For more help
If you need more help, check out these support and learning resources:
- Browse the Explorers Hub to get help from the community and join in discussions.
- Find answers on our sites and learn how to use our support portal.
- Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS.
- Review New Relic's data security and licenses documentation.