Issue Description
In a typical Rails CRUD app any create, update, or destroy action will issue a 302 redirect after successfully completing the action but none of the traces/spans created during those actions will get reported because the 302 status code is ignored by default in the trace_ignore_status_codes configuration option.
Reproduction Steps
- Enable Sentry SDK debugging:
config.sdk_logger = Sentry::Logger.new(STDOUT)
config.sdk_logger.level = ::Logger::DEBUG
- Issue a redirect from any Rails action (I hope I don't need to provide a working Rails app for this):
class UsersController
def create
@user = User.new(user_params)
if @user.save
redirect_to users_path
else
render :new
end
end
end
- Invoke the Rails action in your app
- Observe a log entry that looks like the following:
DEBUG -- sentry: ** [Sentry] [Tracing] Discarding <http.server> transaction </users> due to ignored HTTP status code: 302
- Observe that no traces for the action are available in Sentry
This can be fixed by including the following line in the Sentry.init block:
config.trace_ignore_status_codes = [301, 303, (305..399), (401..404)]
Expected Behavior
I would expect that by default Sentry's Rails integration would record traces for all of the typical CRUD actions when using standard Rails idioms - e.g. redirect on success. And if for some reason that's not possible, I'd at least expect to see a huge alert or warning or something in the Rails integration docs that mentions that by default you won't get traces for any Rails action that succeeds with a redirect unless you change the configuration.
Actual Behavior
No traces get recorded for any successful create, update, or destroy action when redirecting the user to subsequent page.
Ruby Version
ruby 4.0.3 (2026-04-21 revision 85ddef263a) +PRISM [arm64-darwin24]
SDK Version
6.7.0
Integration and Its Version
sentry-rails (6.7.0)
Sentry Config
Sentry.init do |config|
config.dsn = SentryConfig.new.dsn
config.breadcrumbs_logger = [:active_support_logger, :http_logger]
# Set the environment to the name of the app instance instead of the Rails/Rack
# env value because all of the DigitalOcean apps will be running as "production" apps
# (even staging).
config.environment = AppConfig.new.name
# Add data like request headers and IP for users,
# see https://docs.sentry.io/platforms/ruby/data-management/data-collected/ for more info
config.send_default_pii = true
# Enable sending logs to Sentry
config.enable_logs = true
# Patch Ruby logger to forward logs
config.enabled_patches = [:logger]
# Set traces_sample_rate to 1.0 to capture 100%
# of transactions for tracing.
# We recommend adjusting this value in production.
config.traces_sample_rate = 1.0
# or
# config.traces_sampler = lambda do |context|
# true
# end
end
Issue Description
In a typical Rails CRUD app any
create,update, ordestroyaction will issue a 302 redirect after successfully completing the action but none of the traces/spans created during those actions will get reported because the 302 status code is ignored by default in thetrace_ignore_status_codesconfiguration option.Reproduction Steps
DEBUG -- sentry: ** [Sentry] [Tracing] Discarding <http.server> transaction </users> due to ignored HTTP status code: 302This can be fixed by including the following line in the
Sentry.initblock:Expected Behavior
I would expect that by default Sentry's Rails integration would record traces for all of the typical CRUD actions when using standard Rails idioms - e.g. redirect on success. And if for some reason that's not possible, I'd at least expect to see a huge alert or warning or something in the Rails integration docs that mentions that by default you won't get traces for any Rails action that succeeds with a redirect unless you change the configuration.
Actual Behavior
No traces get recorded for any successful create, update, or destroy action when redirecting the user to subsequent page.
Ruby Version
ruby 4.0.3 (2026-04-21 revision 85ddef263a) +PRISM [arm64-darwin24]
SDK Version
6.7.0
Integration and Its Version
sentry-rails (6.7.0)
Sentry Config