Skip to content

Commit 406cabe

Browse files
megabus-tobinmwear
andauthored
feat: Improve SSL error logging. (#1644)
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]>
1 parent 8a16f1f commit 406cabe

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

exporter/otlp-http/lib/opentelemetry/exporter/otlp/http/trace_exporter.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,9 @@ def send_bytes(bytes, timeout:) # rubocop:disable Metrics/MethodLength
180180
rescue Net::OpenTimeout, Net::ReadTimeout
181181
retry if backoff?(retry_count: retry_count += 1, reason: 'timeout')
182182
return FAILURE
183-
rescue OpenSSL::SSL::SSLError
183+
rescue OpenSSL::SSL::SSLError => e
184184
retry if backoff?(retry_count: retry_count += 1, reason: 'openssl_error')
185+
OpenTelemetry.handle_error(exception: e, message: 'SSL error in OTLP::Exporter#send_bytes')
185186
return FAILURE
186187
rescue SocketError
187188
retry if backoff?(retry_count: retry_count += 1, reason: 'socket_error')

exporter/otlp/lib/opentelemetry/exporter/otlp/exporter.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,9 @@ def send_bytes(bytes, timeout:) # rubocop:disable Metrics/CyclomaticComplexity,
184184
rescue Net::OpenTimeout, Net::ReadTimeout
185185
retry if backoff?(retry_count: retry_count += 1, reason: 'timeout')
186186
return FAILURE
187-
rescue OpenSSL::SSL::SSLError
187+
rescue OpenSSL::SSL::SSLError => e
188188
retry if backoff?(retry_count: retry_count += 1, reason: 'openssl_error')
189+
OpenTelemetry.handle_error(exception: e, message: 'SSL error in OTLP::Exporter#send_bytes')
189190
return FAILURE
190191
rescue SocketError
191192
retry if backoff?(retry_count: retry_count += 1, reason: 'socket_error')

0 commit comments

Comments
 (0)