Metformin issues

K❤A | C.M.W. 9/26/19

My OB put me on metformin at bedtime. I took it at 9, and woke up at 1 unable to sleep and have been up for an hour and a half feeling nauseated and weak. I thought my sugar might be low so I checked it, it was 138. How is that possible? I ate dinner at 6, tested at 7 and it was 121 and did not eat or drink anything else and then took metformin at 9. Is the metformin not working?