Sinatra is officially supported, but requires a bit of manual configuration. Follow the installation steps in AppSignal, start by clicking 'Add app' on the accounts screen.

After installing the gem you need to add the AppSignal integration require after sinatra (or sinatra/base).

require "sinatra" # or require 'sinatra/base' require "appsignal/integrations/sinatra"

Then create the AppSignal configuration file, config/appsignal.yml. See the Ruby configuration page for more details on how to configure AppSignal.

After these steps, start your Sinatra app and wait for data to arrive in AppSignal.

Recent change Since AppSignal gem version 1.3 you no longer need to manually include the Appsignal::Rack::SinatraInstrumentation middleware in your application. Please remove it from your application.

Ignoring errors

To ignore a specific Sinatra error set the sinatra.skip_appsignal_error flag in the request environment. This will tell AppSignal to ignore the error that occurs during the request. This allows you to stop reporting of errors to AppSignal.

Only ignore errors like this if you need to ignore errors from a Sinatra app using code. See the ignore_errors option to ignore it for the entire app. If you don't want to be notified about an error, see our notification settings.

get "/" do env["sinatra.skip_appsignal_error"] = true # Add this line to an endpoint or callback raise "uh oh" # Example error, don't copy this end

Example applications

We have two example applications in our examples repository on GitHub. The examples show how to set up AppSignal in small Sinatra applications and modular Sinatra applications.