Track the locale in Sentry so we know which ones are failing

This commit is contained in:
Bob Van Landuyt 2017-07-20 08:53:57 +02:00
parent bf4ec606a5
commit b6646e778d
2 changed files with 15 additions and 0 deletions

View file

@ -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,

View 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