Skip to content

Bump Sentry Ruby SDK to v6#2606

Merged
lfdebrux merged 4 commits intomainfrom
ldeb-sentry-6
Mar 10, 2026
Merged

Bump Sentry Ruby SDK to v6#2606
lfdebrux merged 4 commits intomainfrom
ldeb-sentry-6

Conversation

@lfdebrux
Copy link
Contributor

What problem does this pull request solve?

Trello card: https://trello.com/c/mBwTjNea/2867-update-sentry-ruby-to-v6

Bumps sentry-rails and sentry-ruby from 5.28.1 to 6.4.1.

Sentry Ruby SDK 6.0.0 removed the interface for before_send/before_breadcrumb filters, so that returning a hash instead of an event object no longer works (see https://github.com/getsentry/sentry-ruby/blob/master/CHANGELOG.md#600, getsentry/sentry-ruby#2529). This PR rewrites the filter code to keep the same behaviour, as we have had incidents in the past where a person's email address was in the exception message sent to Sentry.

Things to consider when reviewing

  • Ensure that you consider the wider context.
  • Does it work when run on your machine?
  • Is it clear what the code is doing?
  • Do the commit messages explain why the changes were made?
  • Are there all the unit tests needed?
  • Do the end to end tests need updating before these changes will pass?
  • Has all relevant documentation been updated?

lfdebrux and others added 4 commits March 10, 2026 08:55
Bumps [sentry-rails](https://github.com/getsentry/sentry-ruby/tree/master/sentry-rails) and [sentry-ruby](https://github.com/getsentry/sentry-ruby/tree/master/sentry-ruby) to 6.4.1.

Updates `sentry-rails` from 5.28.1 to 6.4.1
- [Release notes](https://github.com/getsentry/sentry-ruby/releases)
- [Changelog](https://github.com/getsentry/sentry-ruby/blob/master/CHANGELOG.md)
- [Commits](getsentry/sentry-ruby@5.28.1...6.4.1)

Updates `sentry-ruby` from 5.28.1 to 6.4.1
- [Release notes](https://github.com/getsentry/sentry-ruby/releases)
- [Changelog](https://github.com/getsentry/sentry-ruby/blob/master/CHANGELOG.md)
- [Commits](getsentry/sentry-ruby@5.28.1...6.4.1)
config.enable_tracing has been removed in favour of
config.traces_sample_rate, which has a default value of nil

Sentry::Event#to_hash has been replaced by to_h

Returning a hash from before_send is no longer supported and will
drop the event. Instead, we need to individually apply the filters to
the places where PII could get in as per https://docs.sentry.io/platforms/ruby/guides/rails/configuration/filtering/#using-before-send

We also need to filter the breadcrumbs using config.before_breadcrumb.
Re-add filtering of email addresses from exception messages sent to
Sentry, as it has happened in the past.

We also tweak the specs slightly, to avoid having the test email address
in the exception stacktrace. This was causing one of the tests to fail,
and I didn't think it was worth making the implementation go through the
traceback to scrub email addresses as it previously was; I think we are
unlikely to have an email address that we don't want in Sentry hardcoded
in the source code.
@sonarqubecloud
Copy link

@github-actions
Copy link

🎉 A review copy of this PR has been deployed! You can reach it at: https://pr-2606.admin.review.forms.service.gov.uk/

It may take 5 minutes or so for the application to be fully deployed and working. If it still isn't ready
after 5 minutes, there may be something wrong with the ECS task. You will need to go to the integration AWS account
to debug, or otherwise ask an infrastructure person.

For the sign in details and more information, see the review apps wiki page.

@lfdebrux lfdebrux added this pull request to the merge queue Mar 10, 2026
Merged via the queue into main with commit 091a2d0 Mar 10, 2026
7 checks passed
@lfdebrux lfdebrux deleted the ldeb-sentry-6 branch March 10, 2026 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants