Had similar in my old dog,(about 7 yrs old) sounds similar, his was spondylitis in his back, vet had him on meta-cam at the time and he seemed better, but he suffered with it for years to come, on and off until he died age 11 of liver cancer,.. not saying thats whats wrong with your dog but it could be a possibility, hope your vet finds the root of the problem mate., good luck.