# File lib/new_relic/agent/instrumentation/excon/middleware.rb, line 45
      def finish_trace(datum) #THREAD_LOCAL_ACCESS
        segment = datum[:connection] && datum[:connection].instance_variable_get(TRACE_DATA_IVAR)
        if segment
          begin
            datum[:connection].instance_variable_set(TRACE_DATA_IVAR, nil)

            if datum[:response]
              wrapped_response = ::NewRelic::Agent::HTTPClients::ExconHTTPResponse.new(datum[:response])
              segment.read_response_headers wrapped_response
            end
          ensure
            segment.finish
          end
        end
      end