The development of an in-vacuum long trace profiler (IVLTP) which can provide ultra high precision real time measurements on the surface slope of optical elements is reported. The unique features of this instrument include a specifically designed ultra high repeatability linear slide, a pentamirror composed of two plane mirrors of ultra low slope error, and an ultra high vacuum (UHV) compatible complementary metal oxide semiconductor (CMOS) image sensor. The mechanical system is made of Invar 36 alloy to reduce the room temperature drift effect during data acquisitions. Each IVLTP scan completes in 120 seconds, covering a 168 mm of surface length and generating more than 5000 slope data points. The root mean square (RMS) of the difference between two consecutive scans was found to be 0.0081 μrad on average and 0.0045 μrad RMS at its best. The main application of this IVLTP is to provide the real time feedback signals needed for controlling the 25-actuator surface benders of the active mirrors and active gratings installed in the ultra high resolution soft X-ray beamlines at the Taiwan Photon Source (TPS).