my initial thought is that it means that if there was anything less in the glass, it would be empty. so it is very nearly at the end—what @Val123 said.
It depends on the context, especially the following lines. It could mean what has been written above, but then it could also be optimistic and the beginning of something new:
My glass was all but empty
I knew that I had to
What with little strength and will left in me
Rise once again from the ashes
And go forth into the welcoming world
Almost empty but not quite. It suggests to me that there is still a little something left and handled with care, it may be possible to get by on it and even grow it. It’s not over until the fat lady sings.