The entry for Shield says that the reaction is triggered by being hit by an attack, which would tend to imply that you can wait to see if your opponent actually succeeds on their attack roll (otherwise they would not be hitting you with their attack) to beat your AC before deciding whether or not to cast the spell. However, wouldn't that be considered meta gaming? After all, my character does not know whether the attack will hit or miss; only that he or she is being attacked.
No. You get to wait to see if the attack would hit you.
It's specifically a reaction to when you were hit and it allows you to rewind and replay the attack as if you'd cast shield before it (using the original attack roll). See the text:
Casting Time: 1 reaction, which you take when you are hit by an attack or targeted by the magic missile spell
An invisible barrier of magical force appears and protects you. Until the start of your next turn, you have a +5 bonus to AC, including against the triggering attack, and you take no damage from magic missile. (Basic D&D p100)
So the clear intent here is the use it after the attack roll so you know whether or not you've been hit.
This is not meta gaming any more than 4e's immediate interrupts were meta gaming (if the action negated the trigger, then the action didn't happen but was expended). This is about modeling quick reaction in a way that's fair. It might be a bit meta, but it's far better than requiring a wizard to use a valuable spell (especially at early levels) for something that wouldn't have affected them anyways.
If you're looking for a simulationist model, this is the wizard waiting to see if the attack would otherwise hit them and only casting shield then.
I think you're reading too far into it. It's still not a guarantee. Just because you're hit by an attack does not mean that the +5 AC will negate, just gives you a chance at it. Your DM does not have to tell you what they rolled to hit.
We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.