A planar defect spin sensor in a two-dimensional material susceptible to strain and electric fields