**TL;DR:** Rails setup lives in config/initializers/sentry.rb with two gems (three for profiling). Ruby defaults to restrictive data collection, and profiles_sample_rate is relative to the trace sample rate. Verify Raise in a controller action and hit it through a real request. Missing events with a correct DSN usually mean the initializer never ran (check it is in config/initializers and not behind a conditional that skips your environment).

## Setup

```ruby
# Gemfile
gem "sentry-ruby"
gem "sentry-rails"
gem "stackprof" # only if you want profiling
```

```ruby
# config/initializers/sentry.rb
Sentry.init do |config|
  config.dsn = '___PUBLIC_DSN___'
  config.breadcrumbs_logger = [:active_support_logger, :http_logger]
  config.traces_sample_rate = 0.1 # docs example is 1.0; adjust for production
  config.profiles_sample_rate = 1.0 # relative to traces_sample_rate, not absolute
end
```

## profiles_sample_rate is relative

This is the trap: `profiles_sample_rate = 1.0` does not mean profile everything. It means profile 100% of sampled traces. With `traces_sample_rate = 0.1` you get profiles for ~10% of requests. If profiling data looks thin, the trace rate is usually the bottleneck, not the profile rate.

## Ruby defaults to restrictive data collection

Unlike the JavaScript SDK, the Ruby SDK does not send user identity data, HTTP bodies, or URL query params by default. You opt in per category with the `data_collection` option. If your Rails events feel sparse compared to a JS frontend's events, that is the default, not a bug. Turn on the categories you need deliberately, and keep PII review in the loop when you do.

## Verify

Raise in a controller action and hit it through a real request. Then check the issue stream. Missing events with a correct DSN usually mean the initializer never ran (check it is in config/initializers and not behind a conditional that skips your environment).

## When to use this

- This covers exactly what the title says: Sentry Rails.
- You are setting this up for the first time, or auditing an existing setup.
- You want the key gotchas in one place before you start.

## When not to use this

- You are doing a different workflow with Sentry; these steps are specific to the title above.
- You need the full reference docs; this is the short path, not the manual.

## Compatibility

- Mentions 0.1, 1.0 in the original; behavior may differ on much older or newer releases.

---

## Vectle citations

- Exact version: <https://vectle.com/skills/skl_vXd2zAYETE-c-nzv1gIKaw/versions/skv_CjrPfzYTzP375hKbCsjREA>
- Canonical HTML skill page: <https://vectle.com/skills/skl_vXd2zAYETE-c-nzv1gIKaw>
- Current Markdown URL: <https://vectle.com/skills/skl_vXd2zAYETE-c-nzv1gIKaw/markdown>

## Selected public attribution and original notices/references

```json
{
  "author": "issueatlas",
  "client": null,
  "notices_and_references": [
    "https://docs.sentry.io/platforms/ruby/guides/rails/"
  ]
}
```
