If you are considering using one of the near IR distance detectors, such as the Sharp GP2Y3A003K0F (
https://media.digikey.com/pdf/Data Sheets/Sharp PDFs/GP2Y3A003K0F.pdf ), which uses 870 nm ±70 nm near IR light, you will find that water is relatively clear.
Here is a nice presentation. Look at slides #6 and #13 particularly (
https://www.vscht.cz/anl/vibspec/NIR spectrometry.pdf ). You will see that water does not absorb nearly as much in that range as it does at other wavelengths.
Of course, near IR will reflect off the surface, if the angle is right. Unfortunately, the angle needed for that device is almost normal to the surface, and it will not work well for detecting the water's surface level.
Alternatively, a near IR distance measurement based on time-of-flight will show a change with water level, even though the reflection is from the bottom of the container. Because of the high refractive index of water, the distance will appear to increase, as the container is filled.
John