"Attendant said it is probably a bad sensor so at next service will get it replaced."
Oxygen sensor? Mass air flow? EGR valve? These sensors can be very difficult to diagnose correctly the first time. Especially with an intermittent check engine light. Some codes may not be stored in history.
Has your MPG gone down recently?
Keeping an accurate log can be very helpful in determining engine performance.
First thing I would do....check for a partially blocked fuel & air filter,replace. Also if the engine has been running rich for an extended period,(02,MAF,EGR), the CAT converter may be restricting the exhaust flow.
The newer sensors are much more reliable now, so care is needed in the diagnoses.