Skip to content

Replace Bugsnag with Sentry#8341

Merged
iHiD merged 7 commits into
mainfrom
ihid/replace-bugsnag-with-sentry
Feb 8, 2026
Merged

Replace Bugsnag with Sentry#8341
iHiD merged 7 commits into
mainfrom
ihid/replace-bugsnag-with-sentry

Conversation

@iHiD
Copy link
Copy Markdown
Member

@iHiD iHiD commented Feb 8, 2026

Summary

  • Migrate error monitoring from Bugsnag to Sentry across both Ruby backend and JS frontend
  • Replace bugsnag gem with sentry-ruby + sentry-rails; replace @bugsnag/js + @bugsnag/plugin-react with @sentry/react
  • All Bugsnag.notify() calls replaced with Sentry.capture_exception() (~50 Ruby call sites, 5 JS/TS call sites)
  • Sentry only enabled in production, configured via Exercism.config.sentry_dsn (backend) and env.json sentry_dsn key (frontend)
  • Preserved the Active Storage RecordNotFound filter via Sentry's before_send
  • Replaced skip_bugsnag job pattern with retry_on ActiveRecord::Deadlocked + excluded_exceptions
  • Updated CSP connect policy from sessions.bugsnag.com to *.ingest.sentry.io
  • Updated GitHub labels from bot/bugsnag to bot/sentry

Setup required

  • Add sentry_dsn to Exercism config
  • Add sentry_dsn to app/javascript/.config/env.json
  • Run bundle install to update Gemfile.lock

Test plan

  • yarn test — 160 suites pass
  • bundle install (needs to be run to update Gemfile.lock)
  • bundle exec rails test:zeitwerk — verify autoloading
  • bundle exec rubocop --except Metrics — lint check
  • grep -ri bugsnag — confirm zero remaining references
  • Verify Sentry receives events in production

🤖 Generated with Claude Code

Migrate error monitoring from Bugsnag to Sentry across both the Ruby
backend and JavaScript frontend. Uses Exercism.config.sentry_dsn for
backend config and env.json for frontend config, both production-only.

- Swap bugsnag gem for sentry-ruby + sentry-rails
- Swap @bugsnag/js + @bugsnag/plugin-react for @sentry/react
- Replace all Bugsnag.notify() calls with Sentry.capture_exception()
- Preserve Active Storage RecordNotFound filter via before_send
- Replace skip_bugsnag job pattern with retry_on + excluded_exceptions
- Update CSP connect policy for Sentry ingest domain
- Update GitHub labels from bot/bugsnag to bot/sentry

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@iHiD iHiD requested a review from dem4ron as a code owner February 8, 2026 10:54
iHiD and others added 6 commits February 8, 2026 11:02
Run bundle install to remove bugsnag from lockfile and add sentry gems.
Fix Mocha stubbing errors in sentry_test.rb for cases where url is
never accessed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
CI runs on Linux and the lockfile only had the darwin platform after
the gem swap.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Backend: Exercism.config.sentry_rails_dsn
- Frontend: Exercism.config.sentry_js_dsn (piped through env.json)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use beforeSend to always capture errors from logged-in users (with
user ID attached) and sample only 1% of errors from logged-out users
to avoid excessive noise.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
These "Failed to fetch dynamically imported module" TypeErrors are
caused by transient network issues, ad blockers, or deploys
invalidating cached chunk names. They are not actionable and just
create noise.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
@iHiD iHiD merged commit c1da565 into main Feb 8, 2026
7 checks passed
@iHiD iHiD deleted the ihid/replace-bugsnag-with-sentry branch February 8, 2026 17:33
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.

1 participant