Module: Gitlab::ErrorTracking::Processor::GrpcErrorProcessor
- Extended by:
- Concerns::ProcessesExceptions
- Defined in:
- lib/gitlab/error_tracking/processor/grpc_error_processor.rb
Constant Summary collapse
- DEBUG_ERROR_STRING_REGEX =
Braces added by gRPC Ruby code: github.com/grpc/grpc/blob/0e38b075ffff72ab2ad5326e3f60ba6dcc234f46/src/ruby/lib/grpc/errors.rb#L46
RE2('(.*) debug_error_string:\{(.*)\}')
Class Method Summary collapse
- .call(event) ⇒ Object
- .custom_grpc_fingerprint?(fingerprint) ⇒ Boolean
- .process_custom_fingerprint(event) ⇒ Object
-
.process_first_exception_value(event) ⇒ Object
Sentry can report multiple exceptions in an event.
- .split_debug_error_string(message) ⇒ Object
Class Method Details
.call(event) ⇒ Object
13 14 15 16 17 18 |
# File 'lib/gitlab/error_tracking/processor/grpc_error_processor.rb', line 13 def call(event) process_first_exception_value(event) process_custom_fingerprint(event) event end |
.custom_grpc_fingerprint?(fingerprint) ⇒ Boolean
58 59 60 |
# File 'lib/gitlab/error_tracking/processor/grpc_error_processor.rb', line 58 def custom_grpc_fingerprint?(fingerprint) fingerprint.is_a?(Array) && fingerprint.length == 2 && fingerprint[0].start_with?('GRPC::') end |
.process_custom_fingerprint(event) ⇒ Object
49 50 51 52 53 54 55 56 |
# File 'lib/gitlab/error_tracking/processor/grpc_error_processor.rb', line 49 def process_custom_fingerprint(event) fingerprint = event.fingerprint return event unless custom_grpc_fingerprint?(fingerprint) , _ = split_debug_error_string(fingerprint[1]) fingerprint[1] = if end |
.process_first_exception_value(event) ⇒ Object
Sentry can report multiple exceptions in an event. Sanitize only the first one since that’s what is used for grouping.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/gitlab/error_tracking/processor/grpc_error_processor.rb', line 22 def process_first_exception_value(event) # Better in new version, will be event.exception.values exceptions = extract_exceptions_from(event) exception = exceptions.first return unless valid_exception?(exception) = exception.value return unless exception.type&.start_with?('GRPC::') return unless .present? , debug_str = split_debug_error_string() # Worse in new version, no setter! Have to poke at the # instance variable if .present? exceptions.each do |exception| next unless valid_exception?(exception) (exception, ) end end event.extra[:grpc_debug_error_string] = debug_str if debug_str end |
.split_debug_error_string(message) ⇒ Object
62 63 64 65 66 67 68 69 70 |
# File 'lib/gitlab/error_tracking/processor/grpc_error_processor.rb', line 62 def split_debug_error_string() return unless match = DEBUG_ERROR_STRING_REGEX.match() return unless match [match[1], match[2]] end |