lib/opentelemetry/sdk/trace/span_processor.rb in opentelemetry-sdk-1.5.0 vs lib/opentelemetry/sdk/trace/span_processor.rb in opentelemetry-sdk-1.6.0

- old
+ new

@@ -21,9 +21,27 @@ # @param [Span] span the {Span} that just started. # @param [Context] parent_context the parent {Context} of the newly # started span. def on_start(span, parent_context); end + # The on_finishing method is an experimental feature and may have breaking changes. + # The OpenTelemetry specification defines it as "On Ending". As `end` is a reserved + # keyword in Ruby, we are using `on_finishing` instead. + # + # Called when a {Span} is ending, after the end timestamp has been set + # but before span becomes immutable. This allows for updating the span + # by setting attributes or adding links and events. + # + # This method is called synchronously and should not block the current + # thread nor throw exceptions. + # + # This method is optional on the Span Processor interface. It will only + # get called if it exists within the processor. + # + # @param [Span] span the {Span} that just is ending (still mutable). + # @return [void] + def on_finishing(span); end + # Called when a {Span} is ended, if the {Span#recording?} # returns true. # # This method is called synchronously on the execution thread, should # not throw or block the execution thread.