Masters is currently playing his 201st first-class game of a career in which he has taken 668 wickets, against Glamorgan at Chelmsford.
Having made his first-class debut for Kent in 2000, he has also made 305 limited overs appearances.
"I have been fortunate to spend 20 years at the professional level with three fabulous clubs," said Masters.
He also had a spell with Leicestershire before moving on to Chelmsford.
"After joining Essex in 2008, I feel I found my home. Everyone at the club has treated me brilliantly from the fans, to the coaching staff and the office staff as well," he added.
"To retire after winning the Division Two title is something you can only dream of."
Meanwhile Ryan ten Doeschate, Essex's County Championship captain, has signed a one-year contract extension, keeping him in Chelmsford until the end of the 2018 season.
The 36-year-old all-rounder has scored over 1,000 runs this season, the first Essex captain to do so since Ronnie Irani in 2006.
Essex seam bowler David Masters will retire from cricket at the end of the season at the age of 38.