diff --git a/exporter/otlp-http/lib/opentelemetry/exporter/otlp/http/trace_exporter.rb b/exporter/otlp-http/lib/opentelemetry/exporter/otlp/http/trace_exporter.rb index 0ae739df5a..de2b857788 100644 --- a/exporter/otlp-http/lib/opentelemetry/exporter/otlp/http/trace_exporter.rb +++ b/exporter/otlp-http/lib/opentelemetry/exporter/otlp/http/trace_exporter.rb @@ -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') diff --git a/exporter/otlp/lib/opentelemetry/exporter/otlp/exporter.rb b/exporter/otlp/lib/opentelemetry/exporter/otlp/exporter.rb index b017e4a30c..1f32c4bd19 100644 --- a/exporter/otlp/lib/opentelemetry/exporter/otlp/exporter.rb +++ b/exporter/otlp/lib/opentelemetry/exporter/otlp/exporter.rb @@ -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')