In most sports, coaching happens behind the scenes, away from the cameras and fans. But when a pitcher is struggling, as has often been the case for the Mets this season, the pitching coach pops out of the dugout, jogs to the mound and delivers 15 seconds or so of instruction in full view of everyone.

It is not a happy occasion.

“Nobody likes me coming out there,” said Dan Warthen, who fills that job on the Mets. “It’s not ‘Oh, boy, Dan is coming out there. This is great.’”

But out there he keeps going in a 2017 season that has turned sideways for the Mets because of unexpected pitching woes. Normally the team’s strength, and the main reason it reached the postseason in the last two years, the Mets’ pitching staff, because of both injuries and ineffectiveness, ranked last in baseball with a 4.99 earned run average going into Sunday’s games.

For Warthen, 64, who has been in his current job since June 2008 and has served under two managers — Jerry Manuel and now Terry Collins — it has meant an endless trek from the dugout to the mound and back.