Is your dog still having discharge from heat? Over 4 weeks seems a little long for her to be in heat. Dogs can be spayed during their heat cycle it is just that complication rates can be higher. The vessels are more dilated and the tissue is more delicate. Usually it is best to wait several weeks after a heat cycle before a spay. However if your dog has been bred have her spayed as soon as possible.