We've released version 4.0 of the AppSignal gem, which offers significant changes and improvements to our Ruby integration.
In this blog post, we'll cover the core updates and explain the steps you need to take before you upgrade.
One Helper For All Your Error Reporting Needs
AppSignal for Ruby 4.0 introduces new functionality to our report_error
helper, which we first introduced in 3.10.0.
The Appsignal.report_error
helper lets you capture multiple exceptions from a single request, providing high-context error insights with just one line of code.
Here's how to use it to report multiple errors:
Improved Helpers for Better Background Job Monitoring
While we offer out-of-the-box support for most of the integrations Ruby apps use, like Resque, Sidekiq, and Delayed Job, we've improved our helpers. It's now easier for you to monitor custom scripts and unsupported libraries with the new Appsignal.monitor
helper.
With Appsignal.monitor
, you no longer need to create transactions manually, add instrumentations, and catch exceptions; you can now instrument your code in a simple block:
Sample Data Is Now Amendable
Sample data adds contextual data to samples (like relevant IDs from models, the application state in a request/background job, and other specific information from your app), so you get the most out of your monitoring data.
In AppSignal for Ruby 4.0, sample data is easier to use, thanks to its amendability. You can add the same type of data multiple times, as and when it makes sense in your app's flow.
This data will be visible when inspecting a request in AppSignal.
A New Way to Configure AppSignal for Ruby
We've made some changes to how you configure AppSignal, including removing and replacing some configuration options.
The new Appsignal.configure
helper will automatically detect your app environment.
This provides a more stable, convenient and efficient way to configure your AppSignal integration (whether you're using Rails, Sinatra, or any other integration we support), while ensuring the configuration defaults remain intact.
A full list of changes to our configuration can be found in our documentation about upgrading from AppSignal for Ruby 3.x to 4.x and Ruby changelog.
How to Upgrade to 4.0
Depending on what version of the AppSignal gem you currently use, upgrading immediately to 4.0 may introduce breaking changes. For that reason, we recommend taking the following steps to ensure a smooth upgrade process.
1. Upgrade to the Latest Version of AppSignal (3.0)
To do this, update the gem's version lock to ~> 3.0
in your Gemfile:
Save your Gemfile and run:
bundle update appsignal
2. Resolve Errors and Deprecation Warnings
These will be printed in your STDERR
output and logged in your app's appsignal.log
file.
3. Upgrade to the Latest 4.x Version of AppSignal
Once you've fixed all errors and deprecation warnings, you can upgrade to 4.x by removing the version lock from your Gemfile:
After updating your Gemfile, run:
bundle update appsignal
Our upgrading from AppSignal for Ruby 3.x to 4.x documentation explains this process in more detail and highlights the fundamental changes between AppSignal 3.x and 4.0.
Get Monitoring with AppSignal for Ruby v4.0
If you're not yet an AppSignal customer, you can sign up today for a free 30-day trial (no credit card required) and be up and monitoring in less time than it takes to drink a cup of coffee.
We're here to help if you have any trouble upgrading to 4.x or monitoring questions in general. Just drop us an email!