lib/opentelemetry/exporter/zipkin/exporter.rb in opentelemetry-exporter-zipkin-0.23.1 vs lib/opentelemetry/exporter/zipkin/exporter.rb in opentelemetry-exporter-zipkin-0.23.2

- old
+ new

@@ -22,12 +22,11 @@ private_constant(:SUCCESS, :FAILURE, :TIMEOUT) # 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) def initialize(endpoint: OpenTelemetry::Common::Utilities.config_opt('OTEL_EXPORTER_ZIPKIN_ENDPOINT', default: 'http://localhost:9411/api/v2/spans'), headers: OpenTelemetry::Common::Utilities.config_opt('OTEL_EXPORTER_ZIPKIN_TRACES_HEADERS', 'OTEL_EXPORTER_ZIPKIN_HEADERS'), timeout: OpenTelemetry::Common::Utilities.config_opt('OTEL_EXPORTER_ZIPKIN_TRACES_TIMEOUT', 'OTEL_EXPORTER_ZIPKIN_TIMEOUT', default: 10), metrics_reporter: nil) @@ -128,15 +127,15 @@ remaining_timeout = OpenTelemetry::Common::Utilities.maybe_timeout(timeout, start_time) return TIMEOUT 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) } response.body # Read and discard body - # in opentelemetry-js 200-399 is succcess, in opentelemetry-collector zipkin exporter,200-299 is a success + # in opentelemetry-js 200-399 is success, in opentelemetry-collector zipkin exporter,200-299 is a success # zipkin api docs list 202 as default success code # https://zipkin.io/zipkin-api/#/default/post_spans # TODO: redirect case response