Skip to main content
Auto-instrument Rails, Sinatra, and other Rack-based frameworks.

1. Install

Or add to your Gemfile:

2. Configure

Create an initializer config/initializers/opentelemetry.rb:

3. Set Environment Variables

4. Run

All exceptions raised in controllers, jobs, and middleware are automatically captured.

Rails Error Reporting (Rails 7.1+)

Rails 7.1 introduced Rails.error.handle and Rails.error.report. You can hook Squasher into this with a custom subscriber using the HTTP API:

Alternative: Direct HTTP API

Usage

Sinatra

Same OTel setup works with Sinatra:

Agent handoff