← All platforms

Rack Middleware error tracking

A Rack app can be small without being invisible when it breaks. Use Sentry’s Rack middleware to send Ruby error reports to your Telebugs server.

~/hoofnotes  bundle add sentry-ruby
~/hoofnotes  nvim config.ru
require "sentry-ruby"
Sentry.init do |config|
# Copy the complete Telebugs DSN, key and path included.
config.dsn = "YOUR_TELEBUGS_DSN"
end
require_relative "hoofnotes/app"
use Sentry::Rack::CaptureExceptions
run HoofNotes::App
~/hoofnotes  bundle exec rackup

Space pauses or resumes. R replays. Escape shows the complete setup.

Hang on, I already use Sentry

Keep sentry-ruby and change its destination to your Telebugs DSN. Your error reports stay on your server. You don’t need a Sentry account.

Do I need Rails for this?

No. The middleware works with a Rack app directly. Exceptions escaping your application can arrive with a Ruby backtrace and the request context the SDK captures.

Can I keep handling some errors myself?

Yes. Your app decides what to handle. Report a rescued exception explicitly with Sentry.capture_exception when it still deserves a look.