lib/opentelemetry/exporter/otlp/exporter.rb in opentelemetry-exporter-otlp-0.29.0 vs lib/opentelemetry/exporter/otlp/exporter.rb in opentelemetry-exporter-otlp-0.29.1
- old
+ new
@@ -26,12 +26,11 @@
private_constant(:SUCCESS, :FAILURE)
# Default timeouts in seconds.
KEEP_ALIVE_TIMEOUT = 30
RETRY_COUNT = 5
- WRITE_TIMEOUT_SUPPORTED = Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.6')
- private_constant(:KEEP_ALIVE_TIMEOUT, :RETRY_COUNT, :WRITE_TIMEOUT_SUPPORTED)
+ private_constant(:KEEP_ALIVE_TIMEOUT, :RETRY_COUNT)
ERROR_MESSAGE_INVALID_HEADERS = 'headers must be a String with comma-separated URL Encoded UTF-8 k=v pairs or a Hash'
private_constant(:ERROR_MESSAGE_INVALID_HEADERS)
DEFAULT_USER_AGENT = "OTel-OTLP-Exporter-Ruby/#{OpenTelemetry::Exporter::OTLP::VERSION} Ruby/#{RUBY_VERSION} (#{RUBY_PLATFORM}; #{RUBY_ENGINE}/#{RUBY_ENGINE_VERSION})".freeze
@@ -151,11 +150,11 @@
remaining_timeout = OpenTelemetry::Common::Utilities.maybe_timeout(timeout, start_time)
return FAILURE if remaining_timeout.zero?
@http.open_timeout = remaining_timeout
@http.read_timeout = remaining_timeout
- @http.write_timeout = remaining_timeout if WRITE_TIMEOUT_SUPPORTED
+ @http.write_timeout = remaining_timeout
@http.start unless @http.started?
response = measure_request_duration { @http.request(request) }
case response
when Net::HTTPOK
@@ -211,10 +210,10 @@
end
ensure
# Reset timeouts to defaults for the next call.
@http.open_timeout = @timeout
@http.read_timeout = @timeout
- @http.write_timeout = @timeout if WRITE_TIMEOUT_SUPPORTED
+ @http.write_timeout = @timeout
end
def handle_redirect(location)
# TODO: figure out destination and reinitialize @http and @path
end