diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2019-05-10 16:12:33 -0500 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2019-05-13 13:27:41 -0500 |
commit | 4c2f6814907f3988c86c9f79a155d1d48ba61793 (patch) | |
tree | eee0368269fc9065c81bb767d6df60b35fa02891 /spec/lib/gitlab | |
parent | 9dc41a0993a38f99eeda9c2e8bb3ace070003496 (diff) | |
download | gitlab-ce-4c2f6814907f3988c86c9f79a155d1d48ba61793.tar.gz |
Add correlation id to all sentry errors
Before this, we were only adding the correlation id to the "acceptable
exceptions" which we handle in code.
But we need to add it to the default raven context so the information
would be available for uncaught exceptions.
Diffstat (limited to 'spec/lib/gitlab')
-rw-r--r-- | spec/lib/gitlab/sentry_spec.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/spec/lib/gitlab/sentry_spec.rb b/spec/lib/gitlab/sentry_spec.rb index ae522a588ee..af8b059b984 100644 --- a/spec/lib/gitlab/sentry_spec.rb +++ b/spec/lib/gitlab/sentry_spec.rb @@ -2,12 +2,15 @@ require 'spec_helper' describe Gitlab::Sentry do describe '.context' do - it 'adds the locale to the tags' do + it 'adds the expected tags' do expect(described_class).to receive(:enabled?).and_return(true) + allow(Labkit::Correlation::CorrelationId).to receive(:current_id).and_return('cid') described_class.context(nil) expect(Raven.tags_context[:locale].to_s).to eq(I18n.locale.to_s) + expect(Raven.tags_context[Labkit::Correlation::CorrelationId::LOG_KEY.to_sym].to_s) + .to eq('cid') end end |