A compact diffracting grating based laser wavemeter is constructed in this paper. Wavelength is the length unit of laser interferometers, it must be very accurate and stable during the length measurement. An air sensor, which is employed to correct the air refractive index through an empirical equation, is essential in laser interferometers. However, the empirical equation is suffered from indirect measurement, the correction accuracy is depended on the measurement accuracy of the air sensor. Slow response is other disadvantages of the empirical equation. Additional, the empirical equation is not applicable to correct the laser diode wavelength. Therefore, a direct measurement method of laser diode wavelength, based on the diffraction principle, is proposed and a compact, low-cost and simple wavemeter is constructed in this paper. Laser beam drift is recognized as one of critical error source in laser measurement. Therefore, a novel laser beam drift active compensation method is thus proposed in this study that integrates the functions of automatic type angle turning and PID controlled fine angle motion. After introducing the principles of wavelength measurement and laser beam drift compensation, the effectiveness of the wavemeter in real-time wavelength measurement is well verified by the experimental results.