Measuring the atomic composition of planetary building blocks