lib/opentelemetry/sdk/trace/multi_span_processor.rb in opentelemetry-sdk-0.2.0 vs lib/opentelemetry/sdk/trace/multi_span_processor.rb in opentelemetry-sdk-0.3.0

- old
+ new

@@ -39,10 +39,21 @@ # @param [Span] span the {Span} that just ended. def on_finish(span) @span_processors.each { |processor| processor.on_finish(span) } end - # Called when {TracerFactory#shutdown} is called. + # Export all ended spans to the configured `Exporter` that have not yet + # been exported. + # + # 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. + def force_flush + @span_processors.each(&:force_flush) + end + + # Called when {TracerProvider#shutdown} is called. def shutdown @span_processors.each(&:shutdown) end end end