lib/opentelemetry/sdk/trace/multi_span_processor.rb in opentelemetry-sdk-0.6.0 vs lib/opentelemetry/sdk/trace/multi_span_processor.rb in opentelemetry-sdk-0.7.0

- old
+ new

@@ -24,12 +24,14 @@ # # This method is called synchronously on the execution thread, should # not throw or block the execution thread. # # @param [Span] span the {Span} that just started. - def on_start(span) - @span_processors.each { |processor| processor.on_start(span) } + # @param [Context] parent_context the parent {Context} of the newly + # started span. + def on_start(span, parent_context) + @span_processors.each { |processor| processor.on_start(span, parent_context) } end # Called when a {Span} is ended, if the {Span#recording?} # returns true. # @@ -46,16 +48,22 @@ # # This method should only be called in cases where it is absolutely # necessary, such as when using some FaaS providers that may suspend # the process after an invocation, but before the `Processor` exports # the completed spans. + # + # @return [Integer] Export::SUCCESS if no error occurred, Export::FAILURE if + # a non-specific failure occurred, Export::TIMEOUT if a timeout occurred. def force_flush - @span_processors.each(&:force_flush) + @span_processors.map(&:force_flush).uniq.max end # Called when {TracerProvider#shutdown} is called. + # + # @return [Integer] Export::SUCCESS if no error occurred, Export::FAILURE if + # a non-specific failure occurred, Export::TIMEOUT if a timeout occurred. def shutdown - @span_processors.each(&:shutdown) + @span_processors.map(&:shutdown).uniq.max end end end end end