def start_active_span(operation_name,
                          child_of: nil,
                          references: nil,
                          start_time: Time.now,
                          tags: nil,
                          ignore_active_scope: false,
                          finish_on_close: true)
      if child_of.nil? && references.nil? && !ignore_active_scope
        child_of = active_span
      end

      span = start_span(
        operation_name,
        child_of: child_of,
        references: references,
        start_time: start_time,
        tags: tags,
        ignore_active_scope: ignore_active_scope
      )

      scope_manager.activate(span: span, finish_on_close: finish_on_close).tap do |scope|
        if block_given?
          yield scope
          scope.close
        end
      end
    end
def start_active_span(operation_name,
                          child_of: nil,
                          references: nil,
                          start_time: Time.now,
                          tags: nil,
                          ignore_active_scope: false,
                          finish_on_close: true)
      if child_of.nil? && references.nil? && !ignore_active_scope
        child_of = active_span
      end

      span = start_span(
        operation_name,
        child_of: child_of,
        references: references,
        start_time: start_time,
        tags: tags,
        ignore_active_scope: ignore_active_scope
      )

      scope_manager.activate(span: span, finish_on_close: finish_on_close).tap do |scope|
        if block_given?
          yield scope
          scope.close
        end
      end
    end
Returns a newly started and activated Scope.

 If ScopeManager#active is not nil, no explicit references are provided,
 and `ignore_active_scope` is false, then an inferred References#CHILD_OF
 reference is created to the ScopeManager#active's SpanContext when
 start_active_span is invoked.

 @param operation_name [String] The operation name for the Span
 @param child_of [SpanContext, Span] SpanContext that acts as a parent to
        the newly-started Span. If a Span instance is provided, its
        context is automatically substituted. See [Reference] for more
        information.

   If specified, the `references` parameter must be omitted.
 @param references [Array<Reference>] An array of reference
   objects that identify one or more parent SpanContexts.
 @param start_time [Time] When the Span started, if not now
 @param tags [Hash] Tags to assign to the Span at start time
 @param ignore_active_scope [Boolean] whether to create an implicit
   References#CHILD_OF reference to the ScopeManager#active.
 @param finish_on_close [Boolean] whether span should automatically be
   finished when Scope#close is called
 @yield [Scope] If an optional block is passed to start_active it will
   yield the newly-started Scope. If `finish_on_close` is true then the
   Span will be finished automatically after the block is executed.
 @return [Scope] The newly-started and activated Scope