Chemical pressure generated through ion doping into crystal lattices has been proven to be conducive to exploration of new matter, development of novel functionalities, and realization of unprecedented performances. However, studies are focusing on one-time doping, and there is a lack of both advanced investigations for multiple doping and sophisticated strategies to precisely and quantitatively track the gradual functionality evolution along with progressive chemical pressure implementation. Herein, high-valent Y3+ and equal-valent Mg2+ is successively doped to replace multiple Ca sites in Ca10.5(PO4)7:Eu2+. The luminescence evolution of Eu2+ serves as an optical probe, allowing step-by-step and atomic-level tracking of the site occupation of Y3+ and Mg2+, interassociation of Ca sites, and ultimately functionality improvement. The resulting Ca8MgY(PO4)7:Eu2+ displays a record-high relative sensitivity for optical thermometry. Utilization of the environment-sensitive emission of Eu2+ as a luminescent probe has offered a unique approach to monitoring structure-functionality evolution in vivo with atomic precision, which shall also be extended to optimization of other functionalities such as ferroelectricity, conductivity, thermoelectricity, and catalytic activity through precise control over atomic diffusion in other types of substances.