We demonstrate an ultrahigh resolution optical spectrometry based on Brillouin dynamic grating (BDG). Taking advantage of creating a long grating in an optical fiber, an ultra-narrow bandwidth optical filter is realized by operating a BDG in a long single-mode fiber (SMF), and the optical spectrometry is performed by sweeping the center wavelength of the filter through swept-tuned laser. In experiment, a 4-fm (0.5 MHz) spectral resolution is achieved by operating a BDG in a 400-m SMF, and the wavelength coverage can be readily extended to C+L band with a commercial tunable laser.