Intrinsic Josephson junctions in high-temperature superconductor Bi2Sr2CaCu2O8 are known for their capability to emit high-power terahertz photons with widely tunable frequencies. Hotspots, as inhomogeneous temperature distributions across the junctions, are believed to play a critical role in synchronizing the gauge-invariant phase difference among the junctions, so as to achieve coherent strong emission. Previous optical imaging techniques have indirectly suggested that the hotspot temperature can go higher than the superconductor critical temperature. However, such optical approaches often disturb the local temperature profile and are too slow for device applications. In this paper, we demonstrate an on-chip in situ sensing technique that can precisely quantify the local temperature profile. This is achieved by fabricating a series of micro sensor junctions on top of an emitter junction and measuring the critical current on the sensors versus the bias current applied to the emitter. This fully electronic on-chip design could enable efficient close-loop control of hotspots in BSCCO junctions and significantly enhance the functionality of superconducting terahertz emitters.