From 4d05e5aef5815610bdc14079d93590ce1d900d4a Mon Sep 17 00:00:00 2001 From: Adam Jazairi Date: Tue, 9 Aug 2022 14:03:13 -0400 Subject: [PATCH] Migrate from sentry-raven to sentry-ruby Why these changes are being introduced: Sentry now prefers the sentry-ruby/sentry-rails gems and has deprecated sentry-raven. Relevant ticket(s): https://mitlibraries.atlassian.net/browse/ENGX-88 How this addresses that need: This removes sentry-raven and adds sentry-ruby and sentry-rails, including the required initializer. Side effects of this change: None. --- Gemfile | 3 ++- Gemfile.lock | 10 +++++++--- config/initializers/sentry.rb | 5 +++++ 3 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 config/initializers/sentry.rb diff --git a/Gemfile b/Gemfile index 2bb109aa..f3207728 100644 --- a/Gemfile +++ b/Gemfile @@ -24,7 +24,8 @@ gem 'rack-cors' gem 'rails', '~> 6.1.0' gem 'redis' gem 'sass-rails' -gem 'sentry-raven' +gem 'sentry-rails' +gem 'sentry-ruby' gem 'uglifier' group :production do diff --git a/Gemfile.lock b/Gemfile.lock index 8327a3ba..20c081e7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -306,8 +306,11 @@ GEM rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2, < 3.0) websocket (~> 1.0) - sentry-raven (3.1.2) - faraday (>= 1.0) + sentry-rails (5.4.1) + railties (>= 5.0) + sentry-ruby (~> 5.4.1) + sentry-ruby (5.4.1) + concurrent-ruby (~> 1.0, >= 1.0.2) simplecov (0.21.2) docile (~> 1.1) simplecov-html (~> 0.11) @@ -391,7 +394,8 @@ DEPENDENCIES rubocop-rails sass-rails selenium-webdriver - sentry-raven + sentry-rails + sentry-ruby simplecov simplecov-lcov sqlite3 diff --git a/config/initializers/sentry.rb b/config/initializers/sentry.rb new file mode 100644 index 00000000..43aa902a --- /dev/null +++ b/config/initializers/sentry.rb @@ -0,0 +1,5 @@ +Sentry.init do |config| + return unless ENV.has_key?('SENTRY_DSN') + config.dsn = ENV.fetch('SENTRY_DSN') + config.breadcrumbs_logger = [:active_support_logger, :http_logger] +end