Vacuum motor problem?

The vacuum was not working correctly and I assumed that the motor needed to be replaced.  But it was still working and sparking.  It this okay or does this need to be replaced?  I have no clue so I am still using it.

There was a clog inside the vacuum.  I had to pull the hose out and clean it out.  This has never happened to me before.  I cleaned the vacuum out the other day and it was only half full so it was surprised.