Provided is a method of analysing milk components having the steps of: a) collecting a milk sample from a milk stream of a milking system b) ionising the milk sample, and c) using an ion mobility spectrometer to detect components of interest within the ionised milk sample the method characterised in that the ion mobility spectrometer is positioned within the milking system from which the milk sample was taken, and the milk sample is collected in a gaseous form. Further provided is a device configured to perform the method using milk sampled from a headspace above milk liquid in a milking system.