1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-01 12:24:28 +01:00
fab-manager/config/initializers/sentry.rb

26 lines
782 B
Ruby
Raw Normal View History

2023-01-04 16:03:52 +01:00
# frozen_string_literal: true
Sentry.init do |config|
config.excluded_exceptions += ['Pundit::NotAuthorizedError']
config.before_send = lambda do |event, hint|
if hint[:exception].is_a?(Redis::CommandError) && hint[:exception].message == 'LOADING Redis is loading the dataset in memory'
nil
else
event
end
end
if ENV.fetch('ENABLE_SENTRY', 'false') == 'true'
config.dsn = 'https://b7dd8812fd0d4d4eac907001e2efec86@o486357.ingest.sentry.io/4504446773886976'
end
config.breadcrumbs_logger = [:active_support_logger]
# Set traces_sample_rate to 1.0 to capture 100%
# of transactions for performance monitoring.
# We recommend adjusting this value in production.
config.traces_sample_rate = 0.01
config.environment = Rails.env
end