Dogs eat grass for a multitude of reasons.
Most of the time it is not a sign of any illness. No, not even an upset stomach. Only a small percentage of dogs show any illness at all before eating grass so if your pup vomited after eating grass don’t read too much into it.