ALT Liver enzyme

And ALT of 31 is elevated, but not extremely so. ALT and AST are used as diagnostic indicators of liver damage. Metformin itself isn’t associated with causing liver damage, but if you have liver damage, Metformin may not be appropriate. If you have an impaired liver then you have an increased risk of lactic acidosis (which is largely zero otherwise).

You were referred to a gastroenterologist, an expert on among other things, the liver. The fact that your ALT enzyme was slightly elevated was apparently enough to warrant the referral, but not serious enough to your doctor for them to stop Metformin, but you should get it checked out.

ps. There are variety of reasons for ALT and AST to be elevated, including just “diabetes.” So this doesn’t necessarily indicate something serious, permanent or necessarily “wrong.”