BigW Consortium Gitlab

sentry.rb 884 Bytes
Newer Older
Jeroen Nijhof committed
1 2 3 4
# Be sure to restart your server when you modify this file.

require 'gitlab/current_settings'

5 6 7
if Rails.env.production?
  # allow it to fail: it may do so when create_from_defaults is executed before migrations are actually done
  begin
8
    sentry_enabled = Gitlab::CurrentSettings.current_application_settings.sentry_enabled
9 10 11
  rescue
    sentry_enabled = false
  end
Jeroen Nijhof committed
12

13 14
  if sentry_enabled
    Raven.configure do |config|
15
      config.dsn = Gitlab::CurrentSettings.current_application_settings.sentry_dsn
16
      config.release = Gitlab::REVISION
17

18 19
      # Sanitize fields based on those sanitized from Rails.
      config.sanitize_fields = Rails.application.config.filter_parameters.map(&:to_s)
20 21
      # Sanitize authentication headers
      config.sanitize_http_headers = %w[Authorization Private-Token]
22
      config.tags = { program: Gitlab::Sentry.program_context }
23
    end
Jeroen Nijhof committed
24 25
  end
end