Track the locale in Sentry so we know which ones are failing
This commit is contained in:
parent
bf4ec606a5
commit
b6646e778d
2 changed files with 15 additions and 0 deletions
|
@ -7,6 +7,8 @@ module Gitlab
|
|||
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,
|
||||
|
|
13
spec/lib/gitlab/sentry_spec.rb
Normal file
13
spec/lib/gitlab/sentry_spec.rb
Normal file
|
@ -0,0 +1,13 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe Gitlab::Sentry do
|
||||
describe '.context' do
|
||||
it 'adds the locale to the tags' do
|
||||
expect(described_class).to receive(:enabled?).and_return(true)
|
||||
|
||||
described_class.context(nil)
|
||||
|
||||
expect(Raven.tags_context[:locale]).to eq(I18n.locale.to_s)
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue