A method of analyzing milk components having the steps of collecting a milk sample, ionizing the milk sample, and using an ion mobility spectrometer to detect predetermined components within the ionized milk sample, wherein the ion mobility spectrometer is positioned within a milking system from which the milk sample is taken.