Sounds like what's referred to as "happy tail". Not a happy situation for you, though. I haven't had that in any of our dogs, surprisingly, but a neighbor's dog spent months with his tail covered with foam pipe insulation and/or vet wrap last year, trying to heal up a bleeding spot halfway down the length of his tail. I think he had 2 separate episodes requiring treatment. Fortunately his tail seems to be in good working order now, still wagging vigorously. You could look up "happy tail" but here's a start:
What Is Happy Tail Syndrome in Dogs?
https://www.dogingtonpost.com/what-t...tail-syndrome/
I hope you get it healed up! Poor guy!