Since you frequently have a DSP there just to manage PWM for the filter, you want to digitize and analyze the current waveform in a way the processor can manage it, so you typically have this tool at your disposal. Also - the primary metric for power quality is often the THD - and looked at in the frequency domain - so you are correcting the same thing you are measuring.
Then when sizing the filter - you want to know what the primary causes are; e.g. a 6 pulse rectifier has a particular harmonic signature, and when choosing the filter you take that into consideration.
It is possible to do this all in analog, but today that is more expensive and much harder to configure. I have a client that had a 2MW inverter for solar, wind and energy storage - the original design was analog, and they only designed this out and went to digital about 4 years ago. ( Analog controller ~$1500, digital $90 ). When they had a problem, I had asked for some waveform data - impossible to add that feature in their analog set up without adding hardware.