Wow, that's amazing and a good bit of sleuthing to find it. Whenever I'm riding a used bike, even if I've checked it over I always have in the back of my mind that there could be a crack or something somewhere that I don't know about. It's sort of scary.
Thank goodness you caught it! So, what ever happens to the derailleur? Get it sorted out?