Many AA groups would consider 10 years sober as being 10 years without any alcohol. Many others would consider it as being 10 years without alcohol OR drugs. Some others would say 10 years with alcohol, drugs or prescribed pain medication. If you speak with someone in OA, they will equate 10 years sober as 10 years eating within your prescribed solution.
At the end of the day, “10 years sober” means “10 years without X”, where X is whatever vice you, and the people you are speaking with about it, have decided fits best.