Integrated contamination detection