Ruby SDK
Tindra uses the official Sentry Ruby SDK. No Tindra-specific gem required. Works with Rails, Sinatra, and plain Ruby.
Installation
Add to your Gemfile:
gem 'sentry-ruby'
For Rails:
gem 'sentry-ruby'
gem 'sentry-rails'
Then:
bundle install
Setup
Plain Ruby
Sentry.init do |config|
config.dsn = 'https://your-key@your-hostname.tindra.sh/1'
config.environment = ENV['RACK_ENV'] || 'production'
config.release = ENV['APP_VERSION']
config.traces_sample_rate = 0.1
end
Rails
Create an initializer at config/initializers/sentry.rb:
Sentry.init do |config|
config.dsn = ENV['SENTRY_DSN']
config.breadcrumbs_logger = [:active_support_logger, :http_logger]
config.traces_sample_rate = 0.1
config.profiles_sample_rate = 0.1
end
profiles_sample_rate does nothing without a profiler gem. See Profiling below.
Add to .env or credentials:
SENTRY_DSN=https://your-key@your-hostname.tindra.sh/1
Additional integrations
For background jobs, install the relevant gems:
| Integration | Gem |
|---|---|
| Sidekiq | sentry-sidekiq |
| OpenTelemetry | sentry-opentelemetry |
Manual error capturing
begin
process_order(order)
rescue => e
Sentry.capture_exception(e)
raise
end
Capture a message
Sentry.capture_message("User exceeded quota", level: :warning)
User context
Use a stable application ID to follow the same user across errors, logs, and traces. Email is optional; keep the identity consistent between related applications.
Sentry.set_user(id: current_user.id, email: current_user.email)
Extra context
Sentry.set_extras(order_id: order.id, cart_total: cart.total)
Sentry.set_tags(checkout_flow: 'express')
Profiling
config.profiles_sample_rate needs a profiler gem behind it. stackprof works everywhere; vernier handles multi-threaded servers like Puma better and needs Ruby 3.2.1+.
gem 'stackprof' # or: gem 'vernier'
Sentry.init do |config|
config.dsn = 'https://your-key@your-hostname.tindra.sh/1'
config.traces_sample_rate = 0.1
config.profiles_sample_rate = 1.0
# Vernier only:
# config.profiler_class = Sentry::Vernier::Profiler
end
stackprof needs sentry-ruby 5.9.0, vernier needs 5.21.0. See Profiling.
Testing
Sentry.capture_exception(RuntimeError.new("Hello Tindra"))
Check your dashboard. The event should appear within a few seconds.
Verify project setup
After configuring the SDK, open Check setup for your project in Settings > Projects. Start a fresh check and capture an exception with the displayed tindra_setup tag, then wait for confirmed storage. The Project Setup guide covers generated browser/Node.js snippets, other SDKs, missing data, and optional transaction, profile, and source-map checks.