Using highlight.io with Ruby on Rails
This backend SDK requires one of the Highlight frontend SDKs to be installed, so please make sure you've followed the fullstack mapping guide first.
Add Highlight to your Gemfile and install with Bundler.
Highlight::H.new initializes the SDK and allows you to call the singleton
Highlight::H.instance. Setting your project id also lets Highlight record errors for background tasks and processes that aren't associated with a frontend session.
with_highlight_context can be used as a Rails
around_action to wrap any controller actions to automatically record errors.
Now that you've set up the Middleware, you can verify that the backend error handling works by throwing an error in a controller. Visit the highlight errors page and check that backend errors are coming in.
If you want to explicitly send an error to Highlight, you can use the
record_exception method within traced code.
Start sending logs to Highlight! Follow the logging setup guide to get started.