Poop from your goldfish can reveal much about its health. Recognizing what constitutes healthy poop will allow you to identify potential problems early on and also help prevent you from overfeeding - which is all too common.
Your goldfish's long and stringy poop may be due to an unhealthy diet. This could include subpar quality flakes or pellets, live food such as bloodworms or blanched vegetables; plant matter such as blanched vegetables may even contribute. In extreme cases, long and stringy poop could indicate tapeworms, roundworms or Hexamita parasites have infested your goldfish and cause intestinal parasites (tapeworms and roundworms may even exist!). It could also indicate parasite infestation (tapeworms, roundworms or Hexamita).
Stringy poop may also be caused by underfeeding. Because goldfish are grazers, it's best to provide small meals several times daily that they can finish within two minutes - though this could become difficult in an overcrowded or too warm aquarium, where oxygen levels decrease rapidly.
At another sign of illness is when your goldfish eats its own poop or feces - an act known as "kingyo no fun". It can be caused by various things including bacteria infections, poor water quality, an injury or new tankmate; to identify this behaviour simply look at its anus for swelling which could indicate roundworms/tapworms and/or flagellates in its digestive system. To diagnose, watch whether its anus becomes inflamed as this could point towards health issues within its digestive tracts or check its anus for inflammation - if not see if flagellates are present within its digestive tracts if this behaviour continues unattractably then more action needs to be taken immediately in terms of water quality improvement, new tankmates, injuries sustained while new tankmates could potentially affect health; to ascertain why this situation. To identify why this occurs check its anus for inflamed signs and if present look closely at its Anus for inflammation as this could indicate roundworm or tapeworm infestation within its digestive tracts while other reasons include bacteria infections or poor water quality issues within its digestive tract. To determine the root cause, take note if its anus becomes inflamed then flagellates within its digestive tract as it could indicate illness within its digestive tract causing it all or any new tankmates in its tankmates introduced soon enough.