Displacement sensing... sliding a rod inside a hollow tube

Hello! I am trying to find a solution to sense a solid rod position within a hollow tube. A 30 inches solid rod can slide out from one end of a 33 inches hollow tube. I attached an image to help illustrate the setting.

The hollow tube opening diameter is .8" made of metal or plastic, and the rod diameter is 0.75" made of wood. I can drill things to the rod if needed.

There are a couple sensor I have thought of...
(1) IR sensor/laser rangefinder/ultrasound sensor:
The tube opening is too narrow to fit both a transmitter and receiver, also the light/sound may bound inside the tube, returning inaccurate reading.
(2) Linear Potentiometer:
Unable to find any linear potentiometer that can slide for 30 inches.
(3) Linear Encoder:
I believe there could be optical or magnetic encoder. Either way, most of what I found are huge in size and custom built for some specific application. I am unable to find off-the-shelf encoder and 30 inches long strip that fits with the rod.

Any idea/suggestion and/or link to products will be greatly appreciated! Thanks.

What moves the rod????? Search for DRO, digital read out. Found some on Ebay for much greater than 30 inches.

What accuracy do you need?

Paul

Thanks! The rod is attached to something that would move back and forth against the stationary tube for up to 30 inches, accuracy or resolution are not important. I am looking into DRO as suggested, those I found are standalone units with a big track, and no way to send data over to a computer... But I will keep looking.

Another direction I am looking into is this guy https://www.digikey.com/product-detail/en/ams/AS5311-TS_EK_AB/AS5311-AB-ND/3828353, maybe I can wire it to an arduino and send serial data to my PC. But the DRO solutions sounds a lot more simple and reliable, if I can find a way to attach the track to the rod (or let the track become the rod itself if the diameter is around 0.75"), and send data over to a PC.

Ultrasound won't work as you'd see the walls of the pipe at a certain distance, rather than the end of the piston.
Laser may work if aimed properly, but it's expensive.
How about placing a wheel against the wall of the piston, with an encoder attached to it? This will allow you to see movement in pretty small steps. You may have to add some form of track with teeth to the piston that lock into a sprocket wheel for best accuracy.