Commit 12321771 authored by Thong Kuah's avatar Thong Kuah

Don't send error backtrace to Sentry

As it already has the full error sent to it
parent 7cd9cdbe
...@@ -19,11 +19,14 @@ module Clusters ...@@ -19,11 +19,14 @@ module Clusters
app_id: app.id, app_id: app.id,
project_ids: app.cluster.project_ids, project_ids: app.cluster.project_ids,
group_ids: app.cluster.group_ids, group_ids: app.cluster.group_ids,
message: error.message, message: error.message
backtrace: Gitlab::Profiler.clean_backtrace(error.backtrace)
} }
logger.error(meta) logger_meta = meta.merge(
backtrace: Gitlab::Profiler.clean_backtrace(error.backtrace)
)
logger.error(logger_meta)
Gitlab::Sentry.track_acceptable_exception(error, extra: meta) Gitlab::Sentry.track_acceptable_exception(error, extra: meta)
end end
......
...@@ -5,7 +5,6 @@ shared_examples 'logs kubernetes errors' do ...@@ -5,7 +5,6 @@ shared_examples 'logs kubernetes errors' do
{ {
exception: error_name, exception: error_name,
message: error_message, message: error_message,
backtrace: instance_of(Array),
service: service.class.name, service: service.class.name,
app_id: application.id, app_id: application.id,
project_ids: application.cluster.project_ids, project_ids: application.cluster.project_ids,
...@@ -14,8 +13,14 @@ shared_examples 'logs kubernetes errors' do ...@@ -14,8 +13,14 @@ shared_examples 'logs kubernetes errors' do
} }
end end
let(:logger_hash) do
error_hash.merge(
backtrace: instance_of(Array)
)
end
it 'logs into kubernetes.log and Sentry' do it 'logs into kubernetes.log and Sentry' do
expect(service.send(:logger)).to receive(:error).with(error_hash) expect(service.send(:logger)).to receive(:error).with(logger_hash)
expect(Gitlab::Sentry).to receive(:track_acceptable_exception).with( expect(Gitlab::Sentry).to receive(:track_acceptable_exception).with(
error, error,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment