lib/opentelemetry/sdk/trace/export/multi_span_exporter.rb in opentelemetry-sdk-0.4.0 vs lib/opentelemetry/sdk/trace/export/multi_span_exporter.rb in opentelemetry-sdk-0.5.0
- old
+ new
@@ -27,11 +27,11 @@
def export(spans)
@span_exporters.inject(SUCCESS) do |result_code, span_exporter|
merge_result_code(result_code, span_exporter.export(spans))
rescue => e # rubocop:disable Style/RescueStandardError
OpenTelemetry.logger.warn("exception raised by export - #{e}")
- FAILED_NOT_RETRYABLE
+ FAILURE
end
end
# Called when {TracerProvider#shutdown} is called, if this exporter is
# registered to a {TracerProvider} object.
@@ -44,16 +44,12 @@
# Returns a merged error code, see the rules in the code.
def merge_result_code(result_code, new_result_code)
if result_code == SUCCESS && new_result_code == SUCCESS
# If both errors are success then return success.
SUCCESS
- elsif result_code == FAILED_NOT_RETRYABLE || new_result_code == FAILED_NOT_RETRYABLE
- # If any of the codes is not retryable then return not_retryable.
- FAILED_NOT_RETRYABLE
else
- # At this point at least one of the code is FAILED_RETRYABLE and
- # none are FAILED_NOT_RETRYABLE, so return FAILED_RETRYABLE.
- FAILED_RETRYABLE
+ # At this point at least one of the code is FAILURE, so return FAILURE.
+ FAILURE
end
end
end
end
end