2023-01-04 16:03:52 +01:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2023-01-10 12:07:46 +01:00
|
|
|
require 'version'
|
|
|
|
|
2023-01-04 16:03:52 +01:00
|
|
|
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.
|
2023-02-02 15:48:58 +01:00
|
|
|
config.traces_sample_rate = 0.01
|
2023-01-04 16:03:52 +01:00
|
|
|
config.environment = Rails.env
|
2023-01-10 12:07:46 +01:00
|
|
|
config.release = Version.current
|
|
|
|
end
|
|
|
|
|
|
|
|
Sentry.configure_scope do |scope|
|
|
|
|
scope.set_tags(instance: ENV.fetch('DEFAULT_HOST'))
|
2023-01-04 16:03:52 +01:00
|
|
|
end
|