Introduces sentry, removes airbrake

Sentry is the premiere FOSS error tracking app.
This commit is contained in:
Henne Vogelsang 2021-03-05 17:00:49 +01:00
parent 3faee06e48
commit b4b20bd135
No known key found for this signature in database
GPG key ID: 9D6164C2955FADE0
6 changed files with 24 additions and 37 deletions

View file

@ -144,7 +144,7 @@ gem 'axlsx', git: 'https://github.com/randym/axlsx.git'
gem 'axlsx_rails'
# as error catcher
gem 'airbrake'
gem 'sentry-rails'
# to make links faster
gem 'turbolinks'

View file

@ -68,10 +68,6 @@ GEM
addressable (2.6.0)
public_suffix (>= 2.0.2, < 4.0)
afm (0.2.2)
airbrake (9.2.2)
airbrake-ruby (~> 4.4)
airbrake-ruby (4.4.0)
rbtree3 (~> 0.5)
ajax-datatables-rails (0.4.3)
railties (>= 4.0)
archive-zip (0.12.0)
@ -446,7 +442,6 @@ GEM
rb-fsevent (0.10.3)
rb-inotify (0.10.0)
ffi (~> 1.0)
rbtree3 (0.5.0)
recaptcha (4.14.0)
json
redcarpet (3.5.1)
@ -526,6 +521,12 @@ GEM
selenium-webdriver (3.142.6)
childprocess (>= 0.5, < 4.0)
rubyzip (>= 1.2.2)
sentry-rails (4.2.2)
rails (>= 5.0)
sentry-ruby-core (~> 4.2.0)
sentry-ruby-core (4.2.2)
concurrent-ruby
faraday
sexp_processor (4.11.0)
shellany (0.0.1)
shoulda-matchers (4.1.2)
@ -617,7 +618,6 @@ DEPENDENCIES
active_model_serializers
acts_as_commentable_with_threading
acts_as_list
airbrake
ajax-datatables-rails
autoprefixer-rails
awesome_nested_set
@ -707,6 +707,7 @@ DEPENDENCIES
ruby-oembed
sass-rails (>= 4.0.2)
selectize-rails
sentry-rails
shoulda-matchers
simplecov-cobertura
skylight

View file

@ -1,22 +0,0 @@
Airbrake.configure do |config|
# Change this to some sensible data for your errbit instance
config.project_id = ENV['OSEM_ERRBIT_ID'] || Rails.application.secrets.errbit_id || ''
config.project_key = ENV['OSEM_ERRBIT_KEY'] || Rails.application.secrets.errbit_key || ''
config.host = ENV['OSEM_ERRBIT_HOST']
config.environment = Rails.env
if config.project_key.blank? || config.host.blank?
config.ignore_environments = [:production, :development, :test]
else
config.ignore_environments = [:development, :test]
end
end
Airbrake.add_filter do |notice|
notice.ignore! if notice[:errors].any? { |error| error[:type] == 'ActiveRecord::RecordNotFound' }
notice.ignore! if notice[:errors].any? { |error| error[:type] == 'ActionController::InvalidAuthenticityToken' }
notice.ignore! if notice[:errors].any? { |error| error[:type] == 'ActionController::UnknownAction' }
notice.ignore! if notice[:errors].any? { |error| error[:type] == 'AbstractController::ActionNotFound' }
notice.ignore! if notice[:errors].any? { |error| error[:type] == 'ActionView::MissingTemplate' }
notice.ignore! if notice[:errors].any? { |error| error[:type] == 'ActionController::UnknownFormat' }
notice.ignore! if notice[:errors].any? { |error| error[:type] == 'ActionController::RoutingError' && error[:message] =~ %r{\[GET\]} }
end

View file

@ -0,0 +1,12 @@
Sentry.init do |config|
config.dsn = ENV.fetch('OSEM_SENTRY_DSN', Rails.application.secrets.sentry_dsn)
config.breadcrumbs_logger = [:active_support_logger]
# To activate performance monitoring, set one of these options.
# We recommend adjusting the value in production:
config.traces_sample_rate = 0.5
# or
# config.traces_sampler = lambda do |context|
# true
# end
end

View file

@ -31,8 +31,8 @@ production:
# Generate your own with rake secret or use the environment
# secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
# Your errbit API key
# errbit_key: '12345'
# Your sentry.io DSN key
# sentry_dsn: '12345'
########## OMNIAUTH Providers ##########
# Leave the variables' names empty, unless you use the providers, in which

View file

@ -52,12 +52,8 @@
# See https://github.com/openSUSE/osem/wiki/Translation
# OSEM_TRANSIFEX_APIKEY=1234
# The errbit host to post exceptions to
# OSEM_ERRBIT_HOST=errbit.example.com
# The project to use on the errbit host
# OSEM_ERRBIT_ID=1234
# The key for this project
# OSEM_ERRBIT_KEY=5678
# sentry.io DSN key
# OSEM_SENTRY_DSN=1234
# OMNIAUTH Developer Key/Secret for GOOGLE
# OSEM_GOOGLE_KEY=1234