Commit cb69d6d4 authored by Stan Hu's avatar Stan Hu

Tweak Sentry GRPC error processor

It appears the error processor was not able to sanitize some errors
because the `message` did not contain `GRPC::`; that was only present in
the exception `type`. We adjust the processor to handle this
undocumented structure.
parent ffea1ee9
...@@ -24,9 +24,11 @@ module Gitlab ...@@ -24,9 +24,11 @@ module Gitlab
return unless entry.is_a?(Hash) return unless entry.is_a?(Hash)
exception_type = entry[:type]
raw_message = entry[:value] raw_message = entry[:value]
return unless raw_message.start_with?('GRPC::') return unless exception_type&.start_with?('GRPC::')
return unless raw_message.present?
message, debug_str = split_debug_error_string(raw_message) message, debug_str = split_debug_error_string(raw_message)
......
...@@ -20,7 +20,8 @@ RSpec.describe Gitlab::ErrorTracking::Processor::GrpcErrorProcessor do ...@@ -20,7 +20,8 @@ RSpec.describe Gitlab::ErrorTracking::Processor::GrpcErrorProcessor do
exception: { exception: {
values: [ values: [
{ {
value: "GRPC::DeadlineExceeded: 4:DeadlineExceeded. debug_error_string:{\"hello\":1}" type: "GRPC::DeadlineExceeded",
value: "4:DeadlineExceeded. debug_error_string:{\"hello\":1}"
} }
] ]
}, },
...@@ -43,7 +44,8 @@ RSpec.describe Gitlab::ErrorTracking::Processor::GrpcErrorProcessor do ...@@ -43,7 +44,8 @@ RSpec.describe Gitlab::ErrorTracking::Processor::GrpcErrorProcessor do
exception: { exception: {
values: [ values: [
{ {
value: "GRPC::DeadlineExceeded: 4:DeadlineExceeded." type: "GRPC::DeadlineExceeded",
value: "4:DeadlineExceeded."
} }
] ]
}, },
......
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