Hi !
I am type2 diet and exercise controlled - so I am not familiar with metformin or any side effects it might carry. Maybe someone else could inform you about whether or not metformin could be the culprit. As far as I have been aware, headaches have not been an issue for me, but others may be different. Headaches can be associated with so many things, like PMT, constipation ! , stress, dehydration ...... Food allergies. You name it.
One thing I do know though, is that if I was having headaches that last a week I would go to the doctor.
Hope this helps a bit.