Can I️ log this as total time?
The regulations regarding the logging of time are specified in FAR Part 61.51 (Pilot Logbooks):

(a) Training time and aeronautical experience. Each person must document and record the following time in a manner acceptable to the Administrator:
(1) Training and aeronautical experience used to meet the requirements for a certificate, rating, or flight review of this part.
(2) The aeronautical experience required for meeting the recent flight experience requirements of this part.

Time other than (1) and (2) above does not need to be logged as it can't be used other than as specified in (1) and (2) above.
That being said, you can put/log what ever you want in your logbook in order to record the flight for historical purposes.  But as for &quot;Total Time&quot; to satisfy the requirements for a certificate, rating, or flight review OR the aeronautical experience required for meeting the recent flight experience requirements of Part 61, the time you are with your friend (as a tag along, and not giving instruction) cannot be used for any purpose specified under 61.51.
Further, since you are not performing the duties of a safety pilot, a required crew member or in any required capacity as a pilot, you can't, for the purposes of meeting any requirements/conditions specified under FAR 61.51, log and receive benefit of the time as &quot;Actual Instrument&quot; time.