Introduces sentry, removes airbrake
Sentry is the premiere FOSS error tracking app.
This commit is contained in:
parent
3faee06e48
commit
b4b20bd135
6 changed files with 24 additions and 37 deletions
|
|
@ -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
|
||||
12
config/initializers/sentry.rb
Normal file
12
config/initializers/sentry.rb
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue