Detection of gas entrainment into liquid metals