Loading...
Loading...
Setup Sentry in Ruby apps. Use when asked to add Sentry to Ruby, install sentry-ruby gem, or configure error monitoring for Ruby applications or Rails.
npx skill4agent add getsentry/sentry-agent-skills sentry-ruby-setupGemfilegem "sentry-ruby"
# For profiling, also add:
gem "stackprof"bundle installrequire "sentry-ruby"
Sentry.init do |config|
config.dsn = "YOUR_SENTRY_DSN"
config.send_default_pii = true
# Breadcrumbs from logs
config.breadcrumbs_logger = [:sentry_logger, :http_logger]
# Tracing
config.traces_sample_rate = 1.0
# Profiling (requires stackprof gem)
config.profiles_sample_rate = 1.0
# Logs
config.enable_logs = true
endconfig/initializers/sentry.rbSentry.init do |config|
config.dsn = ENV["SENTRY_DSN"]
config.send_default_pii = true
config.breadcrumbs_logger = [:active_support_logger, :http_logger]
config.traces_sample_rate = 1.0
config.profiles_sample_rate = 1.0
config.enable_logs = true
end# Gemfile
gem "sentry-ruby"
gem "sentry-rails" # Rails integration
gem "sentry-sidekiq" # If using Sidekiq
gem "sentry-delayed_job" # If using Delayed Job
gem "sentry-resque" # If using Resque| Option | Description | Default |
|---|---|---|
| Sentry DSN | Required |
| Include user data | |
| % of transactions traced | |
| % of traces profiled | |
| Send logs to Sentry | |
| Environment name | Auto-detected |
| Release version | Auto-detected |
| Logger | Description |
|---|---|
| Sentry's own logger |
| HTTP request breadcrumbs |
| Rails ActiveSupport (Rails only) |
SENTRY_DSN=https://xxx@o123.ingest.sentry.io/456
SENTRY_AUTH_TOKEN=sntrys_xxx
SENTRY_ORG=my-org
SENTRY_PROJECT=my-project# Capture test message
Sentry.capture_message("Test message from Ruby")
# Or trigger intentional error
1 / 0| Issue | Solution |
|---|---|
| Errors not appearing | Ensure |
| No traces | Set |
| No profiles | Add |
| Rails errors missing | Use |