← All platforms

Ruby error tracking

Not every Ruby app is a Rails app. Add the Sentry Ruby gem and send your exceptions to Telebugs on your own server.

~/hoofnotes  bundle add sentry-ruby
~/hoofnotes  nvim check_notes.rb
require "sentry-ruby"
Sentry.init do |config|
# Copy the complete Telebugs DSN, key and path included.
config.dsn = "YOUR_TELEBUGS_DSN"
end
begin
raise "Hello from Hoof Notes"
rescue StandardError => error
Sentry.capture_exception(error)
ensure
Sentry.close
end
~/hoofnotes  bundle exec ruby check_notes.rb

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

Hang on, I already use Sentry

Keep sentry-ruby. Point it at your Telebugs DSN and keep reporting errors as before. The reports go to your server; you don’t need a Sentry account.

Do rescued errors disappear?

They don’t have to. Use Sentry.capture_exception to keep a report even when your program recovers. The exception and its Ruby backtrace go together.

And if it is a Rails app?

We support that, too. The Rails integration connects to request errors and Active Job. Other job runners use their own SDK integrations.