It is certainly not fun and happy song, but I would go as far as claim it is ultimately uplifting. After all it says "I'll stand before the lord of song with nothing on my tongue but hallelujah" - past all the suffering and brokenness the author is ultimately thankful for his lot. And in many philosophical traditions, including the Judaic one, the happy man is one who is satisfied with his lot.