def add_stack(limit: nil, stack: Kernel.caller)
      frame_count = 0
      @data[:stack] = []

      stack.each do |i|
        # If the stack has the full instana gem version in it's path
        # then don't include that frame. Also don't exclude the Rack module.
        if !i.match(/instana\/instrumentation\/rack.rb/).nil? ||
          (i.match(::Instana::VERSION_FULL).nil? && i.match('lib/instana/').nil?)

          break if limit && frame_count >= limit

          x = i.split(':')

          @data[:stack] << {
            :c => x[0],
            :n => x[1],
            :m => x[2]
          }
         frame_count = frame_count + 1 if limit
        end
      end
    end
def add_stack(limit: nil, stack: Kernel.caller)
      frame_count = 0
      @data[:stack] = []

      stack.each do |i|
        # If the stack has the full instana gem version in it's path
        # then don't include that frame. Also don't exclude the Rack module.
        if !i.match(/instana\/instrumentation\/rack.rb/).nil? ||
          (i.match(::Instana::VERSION_FULL).nil? && i.match('lib/instana/').nil?)

          break if limit && frame_count >= limit

          x = i.split(':')

          @data[:stack] << {
            :c => x[0],
            :n => x[1],
            :m => x[2]
          }
         frame_count = frame_count + 1 if limit
        end
      end
    end
Adds a backtrace to this span

 @param limit [Integer] Limit the backtrace to the top <limit> frames