By directly altering microscopic interactions, pressure provides a powerful tuning knob for the exploration of condensed phases and geophysical phenomena. The megabar regime represents an exciting frontier, where recent discoveries include novel high-temperature superconductors, as well as structural and valence phase transitions. However, at such high pressures, many conventional measurement techniques fail. Here, we demonstrate the ability to perform local magnetometry inside of a diamond anvil cell with sub-micron spatial resolution at megabar pressures. Our approach utilizes a...