Merge pull request #9858 from opf/bump/sentry

Bump sentry to 4.8.0 for improved debugging + activestorage logging and remove doubled exceptions
pull/9862/head
ulferts 3 years ago committed by GitHub
commit c890299eb0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      Gemfile
  2. 20
      Gemfile.lock
  3. 8
      app/controllers/errors_controller.rb
  4. 12
      config/initializers/sentry.rb

@ -188,9 +188,9 @@ gem 'mini_magick', '~> 4.11.0', require: false
# Sentry error reporting, loaded on demand
group :sentry do
gem "sentry-delayed_job", '~> 4.7.0', require: false
gem "sentry-rails", '~> 4.7.0', require: false
gem "sentry-ruby", '~> 4.7.0', require: false
gem "sentry-delayed_job", '~> 4.8.0', require: false
gem "sentry-rails", '~> 4.8.0', require: false
gem "sentry-ruby", '~> 4.8.0', require: false
end
group :test do

@ -875,17 +875,17 @@ GEM
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2)
semantic (1.6.1)
sentry-delayed_job (4.7.3)
sentry-delayed_job (4.8.0)
delayed_job (>= 4.0)
sentry-ruby-core (~> 4.7.0)
sentry-rails (4.7.3)
sentry-ruby-core (~> 4.8.0)
sentry-rails (4.8.0)
railties (>= 5.0)
sentry-ruby-core (~> 4.7.0)
sentry-ruby (4.7.3)
sentry-ruby-core (~> 4.8.0)
sentry-ruby (4.8.0)
concurrent-ruby (~> 1.0, >= 1.0.2)
faraday (>= 1.0)
sentry-ruby-core (= 4.7.3)
sentry-ruby-core (4.7.3)
sentry-ruby-core (= 4.8.0)
sentry-ruby-core (4.8.0)
concurrent-ruby
faraday
shoulda-context (2.0.0)
@ -1112,9 +1112,9 @@ DEPENDENCIES
secure_headers (~> 6.3.0)
selenium-webdriver (~> 4.0)
semantic (~> 1.6.1)
sentry-delayed_job (~> 4.7.0)
sentry-rails (~> 4.7.0)
sentry-ruby (~> 4.7.0)
sentry-delayed_job (~> 4.8.0)
sentry-rails (~> 4.8.0)
sentry-ruby (~> 4.8.0)
shoulda-context (~> 2.0)
shoulda-matchers (~> 5.0)
spring

@ -14,11 +14,17 @@ class ErrorsController < ::ActionController::Base
end
def internal_error
render_500
render_500 error_options
end
private
def error_options
{
exception: request.env["action_dispatch.exception"] || request.env["sentry.rescued_exception"]
}.compact
end
def use_layout
'only_logo'
end

@ -10,8 +10,6 @@ if OpenProject::Logging::SentryLogger.enabled?
# as we're dynamically loading it
# https://github.com/getsentry/sentry-ruby/blob/master/sentry-rails/lib/sentry/rails/railtie.rb#L8-L13
OpenProject::Application.configure do |app|
# need to be placed at first to capture as many errors as possible
app.config.middleware.insert 0, Sentry::Rails::CaptureExceptions
# need to be placed at last to smuggle app exceptions via env
app.config.middleware.use(Sentry::Rails::RescuedExceptionInterceptor)
end
@ -33,6 +31,16 @@ if OpenProject::Logging::SentryLogger.enabled?
end
end
# Output debug info for sentry
config.before_send = lambda do |event, hint|
Rails.logger.debug do
payload_sizes = event.to_json_compatible.transform_values { |v| JSON.generate(v).bytesize }.inspect
"[Sentry] will send event #{hint}. Payload sizes are #{payload_sizes.inspect}"
end
event
end
# Don't send loaded modules
config.send_modules = false

Loading…
Cancel
Save