gitlab-org--gitlab-foss/config/initializers/sentry.rb

26 lines
884 B
Ruby
Raw Normal View History

2016-01-18 16:15:10 +00:00
# Be sure to restart your server when you modify this file.
require 'gitlab/current_settings'
2016-01-20 08:48:38 +00:00
if Rails.env.production?
# allow it to fail: it may do so when create_from_defaults is executed before migrations are actually done
begin
sentry_enabled = Gitlab::CurrentSettings.current_application_settings.sentry_enabled
2016-01-20 08:48:38 +00:00
rescue
sentry_enabled = false
end
2016-01-18 16:15:10 +00:00
2016-01-20 08:48:38 +00:00
if sentry_enabled
Raven.configure do |config|
config.dsn = Gitlab::CurrentSettings.current_application_settings.sentry_dsn
2016-02-15 17:41:12 +00:00
config.release = Gitlab::REVISION
# Sanitize fields based on those sanitized from Rails.
config.sanitize_fields = Rails.application.config.filter_parameters.map(&:to_s)
# Sanitize authentication headers
config.sanitize_http_headers = %w[Authorization Private-Token]
config.tags = { program: Gitlab::Sentry.program_context }
2016-01-20 08:48:38 +00:00
end
2016-01-18 16:15:10 +00:00
end
end