It's a common (informal) turn of phrase, but I wouldn't call it an interjection. As OP suspects, it's an interrogative sentence. As Tolerance72's revised NGram link suggests, it's somewhat "dated" slang that peaked during the war years for Americans (a couple of decades later for Brits, who often play catchup with American slang).
Note that you can't "transform" it (into "What are you being eaten by?", or "This problem is eating me!", for example), so I guess that in itself makes it an "idiomatic" usage.
So far as "origin" is concerned, I doubt that such a trivial metaphoric usage could really be traced. Here's an instance from 1872 (I imagine there are earlier ones), but it didn't really start to gain traction until the inter-war years.
In the excellent 1993 movie What's Eating Gilbert Grape, Gilbert Grape (Johnny Depp) is trapped in a humdrum smalltown existence, his life dominated by caring for his mentally challenged brother Arnie (Leonardo DiCaprio at his very best), and morbidly obese mother.
In fact, Gilbert never actually complains (because he's too "nice"), and he gives few outward signs of being dissatisfied with his lot in life. But that's a slightly unusual context for the phrase - usually it's a question asked of someone who's obviously discontented (often conveying exasperation, rather than genuine concern).
Also note that there is a similar usage "Eat your heart out!", usually followed by someone's name (who may not actually be present to be directly addressed). That one is an exclamation, implying that the named person is/would be crestfallen on learning of something the speaker has just done or discovered (and which casts the named person in a bad light, or contradicts their stated position, for example). I couldn't say for sure whether they share a common origin, but I suspect not.