gitlab-org--gitlab-foss/lib/gitlab/sentry.rb
Douwe Maan dceb2112d2 Merge branch 'bvl-validate-po-files' into 'master'
Validate PO files in static analysis

See merge request !13000
2017-09-01 14:30:43 +00:00

31 lines
612 B
Ruby

module Gitlab
module Sentry
extend Gitlab::CurrentSettings
def self.enabled?
Rails.env.production? && current_application_settings.sentry_enabled?
end
def self.context(current_user = nil)
return unless self.enabled?
Raven.tags_context(locale: I18n.locale)
if current_user
Raven.user_context(
id: current_user.id,
email: current_user.email,
username: current_user.username
)
end
end
def self.program_context
if Sidekiq.server?
'sidekiq'
else
'rails'
end
end
end
end