SAN FRANCISCO — When the Giants signed reliever Mark Melancon in 2017, the intent was for him to be the anchor of a bullpen that would be pitching deep into October every season.

That, of course, has not come to pass.

In the two years prior to signing a four-year, $62 million contract with San Francisco, Melancon saved 98 games. In his two years in San Francisco, he’s saved only 14.

“Obviously it wasn’t the first two years that I envisioned or wanted,” Melancon said. “Bad timing, but you gotta get through it.”

Injury and inconsistency are to blame for Melancon’s precipitous slide, but heading into year three of his Giants tenure, the 33-year-old reliever is optimistic that he can start to re-write his legacy in orange and black.

“I’m feeling great,” Melancon said. “This offseason has been great. I haven’t felt my arm like this in a long time. I feel like I should. I feel normal… Not to feel it — it’s an extremely relieving feeling.”

The “it” Melancon is referring to is his tight right pronator muscle in his forearm.

Melancon was sidelined by that pronator three times in 2017, leading to surgery to relieve pressure in the muscle in September 2017.

But the issues didn’t go away: Last year, a right elbow flexor strain kept him from starting his season until June. He underwent a stem-cell injection into the pronator April 2018 in an effort to alleviate the elbow discomfort.

“Every outing is painful,” Melancon said last May.

Melancon did pitch in 41 games last year. He had a respectable 3.23 ERA but a ghastly 1.59 WHIP. Melancon said Friday that he still felt the pronator injury — and sometimes connected elbow discomfort — when he was pitching.

Melancon isn’t a flamethrower — but before the pronator injury, his fastball sat at 93 miles per hour with the ability to touch 95 at times. There has been a dip in velocity over the last two seasons — the fastest pitch he’s thrown as a Giant was 92.75 miles per hour — backing up his claim that he hasn’t pitched pain-free in San Francisco.

Still, with good movement on his cutter, Melancon has something worthwhile to offer in 2019 and 2020. But while Melancon came to the Giants as the team’s closer — you don’t pay a reliever an average of $15.5 million a season to not finish games — that role is no longer his.

Besides Melancon, the Giants have four — perhaps even five — reliever, who could wind up as their closer on Opening Day:

Will Smith saved 14 games last year, Tony Watson saved 25 games for the Pirates in 2016 and 2017, Sam Dyson has 57 career saves with 17 coming with the Giants, and Reyes Moranta, with his 98 mile-per-hour fastball and wicked slider is a closer in training who might be ready to make the jump in 2019.

Ray Black, with his elite fastball velocity, could enter the fray in Spring Training, too.

The bullpen is — without question — the strength of the Giants as they head into Spring Training in Scottsdale, Ariz.

“We have a lot of experienced guys — a lot of guys with late-inning experience,” Giants manager Bruce Bochy said on Friday. “I’m really excited about our bullpen.”

How a supposedly healthy Melancon fits into that group will begin to determined by how well he pitches in Arizona. Giants pitchers and catchers report to camp Tuesday.