Multiple Rack libraries

This feature requires AppSignal for Ruby version 3.12.0 or higher.

If an application uses multiple Ruby web frameworks, like the ones listed below, follow this guide to set up instrumentation for all libraries.

Installation

For each library AppSignal should integrate with, call Appsignal.load(:library_name) where :library_name is replaced with the library name you want to instrument.

Follow the guides listed above for each library for additional steps per library and guidance on where to position each Appsignal.load call.

Ruby
require "appsignal" Appsignal.load(:grape) Appsignal.load(:hanami) Appsignal.load(:padrino) Appsignal.load(:sinatra) Appsignal.start

Rack example app

For example, in an application that uses a lot of these Rack libraries:

Ruby
# config.ru require "appsignal" Appsignal.load(:grape) require_relative "./app" Appsignal.load(:hanami) Appsignal.load(:padrino) Appsignal.load(:sinatra) Appsignal.start run MyApp.run

Rails app example

In a Rails app, add the loaders to the config/application.rb file.

Ruby
# config/application.rb require_relative "boot" require "rails/all" Bundler.require(*Rails.groups) Appsignal.load(:sinatra) # ...