The contributions from quarks and gluons to the nucleon spin have been a central issue in deep inelastic scattering for the past twenty years. The COMPASS experiment aims at measuring the gluon polarization by scattering high energy muons from the CERN SPS on a polarized target. After an introduction to spin physics, the principle of the measurement is described and the first accurate determination of the gluon polarization is presented.