A hermetic compressor includes a housing which accommodates a motor and a
compressing mechanism, an oil surface sensor mounted to a side wall of
the housing, and refrigerating machine oil. The oil surface sensor is
integrally formed of a detector for detecting a position of the oil
surface of the refrigerating machine oil and a hermetic terminal. The
hermetic terminal is placed at an end of a cylindrical tube having a
smaller diameter than that of the housing, and the detector of the oil
surface sensor is disposed inside the cylindrical tube.