Skip to content

Commit

Permalink
feat: Improve SSL error logging. (#1644)
Browse files Browse the repository at this point in the history
Log more information about why an SSL error occured as this can be very difficult to diagnose. This is logged in the same way as other probably fatal issues are, e.g. HTTP 404s.

Co-authored-by: Matthew Wear <[email protected]>
  • Loading branch information
megabus-tobin and mwear authored Jun 28, 2024
1 parent 8a16f1f commit 406cabe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,9 @@ def send_bytes(bytes, timeout:) # rubocop:disable Metrics/MethodLength
rescue Net::OpenTimeout, Net::ReadTimeout
retry if backoff?(retry_count: retry_count += 1, reason: 'timeout')
return FAILURE
rescue OpenSSL::SSL::SSLError
rescue OpenSSL::SSL::SSLError => e
retry if backoff?(retry_count: retry_count += 1, reason: 'openssl_error')
OpenTelemetry.handle_error(exception: e, message: 'SSL error in OTLP::Exporter#send_bytes')
return FAILURE
rescue SocketError
retry if backoff?(retry_count: retry_count += 1, reason: 'socket_error')
Expand Down
3 changes: 2 additions & 1 deletion exporter/otlp/lib/opentelemetry/exporter/otlp/exporter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,9 @@ def send_bytes(bytes, timeout:) # rubocop:disable Metrics/CyclomaticComplexity,
rescue Net::OpenTimeout, Net::ReadTimeout
retry if backoff?(retry_count: retry_count += 1, reason: 'timeout')
return FAILURE
rescue OpenSSL::SSL::SSLError
rescue OpenSSL::SSL::SSLError => e
retry if backoff?(retry_count: retry_count += 1, reason: 'openssl_error')
OpenTelemetry.handle_error(exception: e, message: 'SSL error in OTLP::Exporter#send_bytes')
return FAILURE
rescue SocketError
retry if backoff?(retry_count: retry_count += 1, reason: 'socket_error')
Expand Down

0 comments on commit 406cabe

Please sign in to comment.