BigW Consortium Gitlab

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

require 'gitlab/current_settings'
include Gitlab::CurrentSettings

6 7 8 9 10 11 12
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 = current_application_settings.sentry_enabled
  rescue
    sentry_enabled = false
  end
Jeroen Nijhof committed
13

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

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