Skip to content

Commit 81f4a86

Browse files
committed
Update to use Sentry Ruby SDK
1 parent 5545826 commit 81f4a86

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

app/controllers/application_controller.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class ApplicationController < ActionController::Base
1111
protect_from_forgery with: :exception
1212
before_action :configure_permitted_parameters, if: :devise_controller?
1313
before_action :if_not_signed_in, unless: :devise_controller?
14-
before_action :set_raven_context, if: proc { Rails.env.production? }
14+
before_action :set_sentry_context, if: proc { Rails.env.production? }
1515
before_action :set_locale
1616
around_action :with_timezone
1717

@@ -35,9 +35,9 @@ def configure_permitted_parameters
3535
configure_for_accept_invitation
3636
end
3737

38-
def set_raven_context
39-
Raven.user_context(id: current_user.id) if user_signed_in?
40-
Raven.extra_context(params: params.to_unsafe_h, url: request.url)
38+
def set_sentry_context
39+
Sentry.set_user(id: current_user.id) if user_signed_in?
40+
Sentry.set_extras(params: params.to_unsafe_h, url: request.url)
4141
end
4242

4343
def locale

config/environments/production.rb

+1-2
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,8 @@
127127
config.action_controller.default_url_options = { host: primary_domain }
128128
config.action_controller.asset_host = primary_domain
129129

130-
Raven.configure do |config|
130+
Sentry.init do |config|
131131
config.dsn = ENV['SENTRY_DSN']
132-
config.sanitize_fields = Rails.application.config.filter_parameters.map(&:to_s)
133132
end
134133

135134
# Inserts middleware to perform automatic connection switching.

0 commit comments

Comments
 (0)