This study proposes a whispering gallery mode based micro-ring optical resonator with a simple and integrated structure for magnetic field sensing. The performance of the proposed sensor is studied theoretically with the help of the finite element method. Through an in-depth investigation into the sensitivity and reliability of the proposed sensor, the capability to sense a uniform magnetic field is established. In addition to detecting a uniform magnetic field, the sensor is also capable of estimating the spatial inhomogeneity of the applied magnetic field, provided the presence of such inhomogeneity is already known. Furthermore, it possesses the ability to determine the direction of the applied magnetic field. The results highlight the versatility of the proposed sensor in meeting various magnetic field sensing needs, and we anticipate that such a micro-cavity sensor will have promising applications in highly sensitive optical sensing.