$npx -y skills add getsentry/sentry-for-ai --skill sentry-ruby-sdkFull Sentry SDK setup for Ruby. Use when asked to add Sentry to Ruby, install sentry-ruby, setup Sentry in Rails/Sinatra/Rack, or configure error monitoring, tracing, logging, metrics, profiling, or crons for Ruby applications. Also handles migration from AppSignal, Honeybadger,
| 1 | > [All Skills](../../SKILL_TREE.md) > [SDK Setup](../sentry-sdk-setup/SKILL.md) > Ruby SDK |
| 2 | |
| 3 | # Sentry Ruby SDK |
| 4 | |
| 5 | Opinionated wizard that scans the project and guides through complete Sentry setup. |
| 6 | |
| 7 | ## Invoke This Skill When |
| 8 | |
| 9 | - User asks to "add Sentry to Ruby" or "set up Sentry" in a Ruby app |
| 10 | - User wants error monitoring, tracing, logging, metrics, profiling, or crons in Ruby |
| 11 | - User mentions `sentry-ruby`, `sentry-rails`, or the Ruby Sentry SDK |
| 12 | - User is migrating from AppSignal, Honeybadger, Bugsnag, Rollbar, or Airbrake to Sentry |
| 13 | - User wants to monitor exceptions, HTTP requests, or background jobs in Rails/Sinatra |
| 14 | |
| 15 | > **Note:** SDK APIs below reflect sentry-ruby v6.6.2. |
| 16 | > Always verify against [docs.sentry.io/platforms/ruby/](https://docs.sentry.io/platforms/ruby/) before implementing. |
| 17 | |
| 18 | --- |
| 19 | |
| 20 | ## Phase 1: Detect |
| 21 | |
| 22 | ```bash |
| 23 | # Existing Sentry gems |
| 24 | grep -i sentry Gemfile 2>/dev/null |
| 25 | |
| 26 | # Framework |
| 27 | grep -iE '\brails\b|\bsinatra\b' Gemfile 2>/dev/null |
| 28 | |
| 29 | # Web server — Puma triggers queue time guidance |
| 30 | grep -iE '\bpuma\b' Gemfile 2>/dev/null |
| 31 | |
| 32 | # Background jobs |
| 33 | grep -iE '\bsidekiq\b|\bresque\b|\bdelayed_job\b' Gemfile 2>/dev/null |
| 34 | |
| 35 | # Yabeda metrics framework |
| 36 | grep -iE '\byabeda\b' Gemfile 2>/dev/null |
| 37 | |
| 38 | # Competitor monitoring tools — triggers migration path if found |
| 39 | grep -iE '\bappsignal\b|\bhoneybadger\b|\bbugsnag\b|\brollbar\b|\bairbrake\b' Gemfile 2>/dev/null |
| 40 | |
| 41 | # Scheduled jobs — triggers Crons recommendation |
| 42 | grep -iE '\bsidekiq-cron\b|\bclockwork\b|\bwhenever\b|\brufus-scheduler\b' Gemfile 2>/dev/null |
| 43 | grep -rn "Sidekiq::Cron\|Clockwork\|every.*do" config/ lib/ --include="*.rb" 2>/dev/null | head -10 |
| 44 | |
| 45 | # OpenTelemetry tracing — check for SDK + instrumentations |
| 46 | grep -iE '\bopentelemetry-sdk\b|\bopentelemetry-instrumentation\b' Gemfile 2>/dev/null |
| 47 | grep -rn "OpenTelemetry::SDK\.configure\|\.use_all\|\.in_span" config/ lib/ app/ --include="*.rb" 2>/dev/null | head -5 |
| 48 | |
| 49 | # Existing metric patterns (StatsD, Datadog, Prometheus) |
| 50 | grep -rE "(statsd|dogstatsd|prometheus|\.gauge|\.histogram|\.increment|\.timing)" \ |
| 51 | app/ lib/ --include="*.rb" 2>/dev/null | grep -v "_spec\|_test" | head -20 |
| 52 | |
| 53 | # Companion frontend |
| 54 | cat package.json frontend/package.json web/package.json 2>/dev/null | grep -E '"@sentry|"sentry-' |
| 55 | ``` |
| 56 | |
| 57 | **Route from what you find:** |
| 58 | - **Competitor detected** (`appsignal`, `honeybadger`, `bugsnag`, `rollbar`, `airbrake`) → load `${SKILL_ROOT}/references/migration.md` first; **delete the competitor initializer** as part of migration |
| 59 | - **Sentry already present** → skip to Phase 2 to configure features |
| 60 | - **Rails** → use `sentry-rails` + `config/initializers/sentry.rb` |
| 61 | - **Rack/Sinatra** → `sentry-ruby` + `Sentry::Rack::CaptureExceptions` middleware |
| 62 | - **Sidekiq** → add `sentry-sidekiq`; recommend Metrics if existing metric patterns found |
| 63 | - **Yabeda detected** → add `sentry-yabeda`; routes Yabeda metrics to Sentry metrics |
| 64 | - **Puma detected** → queue time capture is automatic (v6.4.0+), but the reverse proxy must set `X-Request-Start` header; see `${SKILL_ROOT}/references/tracing.md` → "Request Queue Time" |
| 65 | - **OTel tracing detected** (`opentelemetry-sdk` + instrumentations in Gemfile, or `OpenTelemetry::SDK.configure` in source) → use OTLP path: `config.otlp.enabled = true`; do **not** set `traces_sample_rate`; Sentry links errors to OTel traces automatically |
| 66 | |
| 67 | --- |
| 68 | |
| 69 | ## Phase 2: Recommend |
| 70 | |
| 71 | Lead with a concrete proposal — don't ask open-ended questions: |
| 72 | |
| 73 | | Feature | Recommend when... | |
| 74 | |---------|------------------| |
| 75 | | Error Monitoring | **Always** | |
| 76 | | OTLP Integration | OTel tracing detected — **replaces** native Tracing | |
| 77 | | Tracing | Rails / Sinatra / Rack / any HTTP framework; **skip if OTel tracing detected** | |
| 78 | | Logging | **Always** — `enable_logs: true` costs nothing | |
| 79 | | Metrics | Sidekiq present; existing metric lib (StatsD, Prometheus) detected | |
| 80 | | Profiling | ⚠️ Beta — performance profiling requested; requires `stackprof` or `vernier` gem; **skip if OTel tracing detected** (requires `traces_sample_rate`, incompatible with OTLP) | |
| 81 | | Crons | Scheduled jobs detected (ActiveJob, Sidekiq-Cron, Clockwork, Whenever) | |
| 82 | |
| 83 | **OTel tracing detected:** *"I see OpenTelemetry tracing in the project. I recommend Sentry's OTLP integration for tracing (via your existing OTel setup) + Error Monitoring + Sentry Logging [+ Metrics/Crons if applicable]. Shall I proceed?"* |
| 84 | |
| 85 | **No OTel:** *"I recommend Error Monitoring + Tracing + Logging [+ Metrics if applicable]. Shall I proceed?"* |
| 86 | |
| 87 | --- |
| 88 | |
| 89 | ## Phase 3: Guide |
| 90 | |
| 91 | ### Install |
| 92 | |
| 93 | **Rails:** |
| 94 | ```ruby |
| 95 | # Gemfile |
| 96 | gem "sent |