Skip to content

Commit c1da565

Browse files
iHiDclaude
andauthored
Replace Bugsnag with Sentry (#8341)
* Replace Bugsnag with Sentry for error monitoring 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> * Update Gemfile.lock and fix sentry test stubs 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> * Add x86_64-linux platform to Gemfile.lock 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> * Use separate Sentry DSN config keys for Rails and JS - 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> * Sample JS errors: 100% logged-in, 1% logged-out 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> * Filter dynamic import errors from Sentry (#8349) 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> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e3d7c7d commit c1da565

64 files changed

Lines changed: 267 additions & 278 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.appends/.github/labels.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
# https://github.com/exercism/org-wide-files/blob/main/global-files/.github/labels.yml. #
44
# ----------------------------------------------------------------------------------------- #
55

6-
- name: "bot/bugsnag"
6+
- name: "bot/sentry"
77
description: ""
8-
color: "A32E92"
9-
10-
- name: "bot/bugsnag-clientside"
8+
color: "362D59"
9+
10+
- name: "bot/sentry-clientside"
1111
description: ""
12-
color: "A32E92"
12+
color: "362D59"
1313

1414
- name: "dependencies"
1515
description: "Pull requests that update a dependency file"

.github/labels.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,13 +172,13 @@
172172
# https://github.com/exercism/org-wide-files/blob/main/global-files/.github/labels.yml. #
173173
# ----------------------------------------------------------------------------------------- #
174174

175-
- name: "bot/bugsnag"
175+
- name: "bot/sentry"
176176
description: ""
177-
color: "A32E92"
178-
179-
- name: "bot/bugsnag-clientside"
177+
color: "362D59"
178+
179+
- name: "bot/sentry-clientside"
180180
description: ""
181-
color: "A32E92"
181+
color: "362D59"
182182

183183
- name: "dependencies"
184184
description: "Pull requests that update a dependency file"

Gemfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ gem 'rack-cors'
2727

2828
# Helper gems for Rails
2929
gem 'bootsnap', '>= 1.4.2', require: false
30-
gem 'bugsnag'
30+
gem 'sentry-rails'
31+
gem 'sentry-ruby'
3132

3233
# Interaction gems
3334
gem 'rugged'

Gemfile.lock

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,6 @@ GEM
147147
bindex (0.8.1)
148148
bootsnap (1.18.6)
149149
msgpack (~> 1.2)
150-
bugsnag (6.27.1)
151-
concurrent-ruby (~> 1.0)
152150
builder (3.3.0)
153151
bullet (8.0.8)
154152
activesupport (>= 3.0.0)
@@ -230,6 +228,8 @@ GEM
230228
faraday_middleware (1.2.1)
231229
faraday (~> 1.0)
232230
ffi (1.17.2)
231+
ffi (1.17.2-arm64-darwin)
232+
ffi (1.17.2-x86_64-linux-gnu)
233233
friendly_id (5.4.2)
234234
activerecord (>= 4.0.0)
235235
fugit (1.11.1)
@@ -243,11 +243,23 @@ GEM
243243
google-protobuf (4.31.1)
244244
bigdecimal
245245
rake (>= 13)
246+
google-protobuf (4.31.1-arm64-darwin)
247+
bigdecimal
248+
rake (>= 13)
249+
google-protobuf (4.31.1-x86_64-linux-gnu)
250+
bigdecimal
251+
rake (>= 13)
246252
googleapis-common-protos-types (1.20.0)
247253
google-protobuf (>= 3.18, < 5.a)
248254
grpc (1.73.0)
249255
google-protobuf (>= 3.25, < 5.0)
250256
googleapis-common-protos-types (~> 1.0)
257+
grpc (1.73.0-arm64-darwin)
258+
google-protobuf (>= 3.25, < 5.0)
259+
googleapis-common-protos-types (~> 1.0)
260+
grpc (1.73.0-x86_64-linux)
261+
google-protobuf (>= 3.25, < 5.0)
262+
googleapis-common-protos-types (~> 1.0)
251263
haml (6.3.0)
252264
temple (>= 0.8.2)
253265
thor
@@ -354,6 +366,10 @@ GEM
354366
nokogiri (1.18.8)
355367
mini_portile2 (~> 2.8.2)
356368
racc (~> 1.4)
369+
nokogiri (1.18.8-arm64-darwin)
370+
racc (~> 1.4)
371+
nokogiri (1.18.8-x86_64-linux-gnu)
372+
racc (~> 1.4)
357373
oauth2 (2.0.12)
358374
faraday (>= 0.17.3, < 4.0)
359375
jwt (>= 1.0, < 4.0)
@@ -551,6 +567,12 @@ GEM
551567
rexml (~> 3.2, >= 3.2.5)
552568
rubyzip (>= 1.2.2, < 3.0)
553569
websocket (~> 1.0)
570+
sentry-rails (6.3.0)
571+
railties (>= 5.2.0)
572+
sentry-ruby (~> 6.3.0)
573+
sentry-ruby (6.3.0)
574+
bigdecimal
575+
concurrent-ruby (~> 1.0, >= 1.0.2)
554576
show_me_the_cookies (6.0.0)
555577
capybara (>= 2, < 4)
556578
sidekiq (7.3.9)
@@ -634,8 +656,9 @@ GEM
634656
zeitwerk (2.7.3)
635657

636658
PLATFORMS
637-
ruby
659+
arm64-darwin-23
638660
x64-mingw32
661+
x86_64-linux
639662

640663
DEPENDENCIES
641664
addressable (~> 2.7)
@@ -647,7 +670,6 @@ DEPENDENCIES
647670
aws-sdk-sesv2
648671
base64
649672
bootsnap (>= 1.4.2)
650-
bugsnag
651673
bullet
652674
byebug
653675
capybara (>= 2.15)
@@ -701,6 +723,8 @@ DEPENDENCIES
701723
rubyzip (~> 2.3)
702724
rugged
703725
selenium-webdriver
726+
sentry-rails
727+
sentry-ruby
704728
show_me_the_cookies
705729
sidekiq (~> 7.2)
706730
sidekiq-failures

app/commands/document/search_docs.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def call
3232
Kaminari.paginate_array(docs, total_count:).
3333
page(page).per(per)
3434
rescue StandardError => e
35-
Bugsnag.notify(e)
35+
Sentry.capture_exception(e)
3636
Fallback.(criteria, track_slug, page, per)
3737
end
3838

app/commands/exercise/approach/link_matching_submissions.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ def relink_matched_submissions!
2020

2121
Submission::LinkToMatchingApproach.defer(submission)
2222
rescue StandardError => e
23-
Bugsnag.notify(e)
23+
Sentry.capture_exception(e)
2424
end
2525
end
2626

2727
def link_unmatched_submissions!
2828
Submission.has_iteration.tagged.where(exercise:, approach: nil).find_each do |submission|
2929
Submission::LinkApproach.(submission, approach) if approach.matches_tags?(submission.tags)
3030
rescue StandardError => e
31-
Bugsnag.notify(e)
31+
Sentry.capture_exception(e)
3232
end
3333
end
3434

app/commands/git/sync_problem_specifications.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def call
1414
exercise.deprecated? ? :deprecated : :active
1515
)
1616
rescue StandardError => e
17-
Bugsnag.notify(e)
17+
Sentry.capture_exception(e)
1818
end
1919
end
2020

app/commands/git/sync_tooling_invoker.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ class Git::SyncToolingInvoker
66
def call
77
Git::ToolingInvoker.new.update!
88
rescue StandardError => e
9-
Bugsnag.notify(e)
9+
Sentry.capture_exception(e)
1010
end
1111
end

app/commands/git/sync_tooling_manager.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ class Git::SyncToolingManager
66
def call
77
Git::ToolingManager.new.update!
88
rescue StandardError => e
9-
Bugsnag.notify(e)
9+
Sentry.capture_exception(e)
1010
end
1111
end

app/commands/git/sync_track.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def call
3030

3131
# TODO: (Optional) consider raising error when slug in config is different from track slug
3232

33-
# TODO: (Optional) We should raise a bugsnag here too. Note: this is not needed if
33+
# TODO: (Optional) We should raise a sentry error here too. Note: this is not needed if
3434
# we validate a track using configlet
3535
blurb = head_git_track.blurb[0, 350]
3636

0 commit comments

Comments
 (0)