ARLINGTON , Texas — October is a long way away, but there was a valuable lesson to be learned by the Yankees with these three games at Globe Life Park against the Rangers.

The Yankees are in desperate need for more quality starting pitching.

It doesn’t get much uglier than the Yankees’ 12-10 loss to the Rangers Wednesday night, a game in which CC Sabathia was staked to a 4-0 lead. After that advantage turned into a 5-4 Rangers lead, the Yankees went back on top, 10-5, only to see it all disappear by the end of the sixth inning.

This is not just about Sabathia. It’s about all three Yankees starters this series.

There was no chainsaw, but this was a Texas massacre.

None of the starters could make it to the sixth inning. Masahiro Tanaka (4.95 ERA) managed to squeeze out a victory in the first game of the series, but he lasted just five innings in a 10-5 win.

A scout who witnessed two recent starts said Tanaka’s fastball has become so mediocre, it hampers him across the board. The last time out, the fastball was better but his splitter was not effective. There are just too many question marks with Tanaka.

In the second game, Domingo German could not get through the fourth in a 6-4 loss, and Wednesday night, Sabathia was scorched for seven runs over 4 ¹/₃ innings.

Add it all up and this is what you got from the Yankees’ three starters this series: 13 innings, 13 hits, 17 earned runs, 10 walks and six home runs.

The Yankees can hit all the home runs they want, and Wednesday night they blasted four more — the fifth straight game they have hit at least three home runs — but the starting pitching has to be beefed up. On Tuesday, Cole Hamels showed the Yankees the kind of starting pitcher that can be acquired via trade, and the Rangers will be willing to deal Hamels.

The Yankees simply have too good a team to let all this hitting go to waste. Brian Cashman pulled the trigger last year on a Sonny Gray trade and that was an improvement, especially if Gray pitches more like he did Sunday against the Royals in a 10-1 win.

Gray pitched with authority, worked quickly, got ahead of hitters and was much more aggressive. That is what it is going to take for him to continue to do well, especially when he pitches against teams like the Red Sox and Astros.

This series was a good wake-up call for the Yankees. Better the wheels come off the rotation at this point than much later in the season. The Yankees have the merchandise to pick up a quality starter and as much as the Yankees have fallen in love with all their Baby Bombers, it may cost them a top prospect like Clint Frazier.

There is just too much at stake. The firepower is off the charts, but when it comes to postseason time, runs will not be that easy to come by and the Yankees are going to need much more from their starters. Sabathia started the season off well, but over his last three starts, he has surrendered 13 runs.

Yankees starters rank fifth in the AL with a 3.95 ERA, and consider the four teams ahead of them. The champion Astros own a 2.25 ERA, by far the best. The Indians are next at 3.35, followed by the Red Sox (3.54) and Angels (3.65).

Relievers Chasen Shreve and David Robertson each allowed two runs to let the game get away. Jurickson Profar’s three-run double in the sixth against Robertson proved to be the big blow.

It was an ugly night on the mound for the Yankees as they ended a three-city trip with two straight losses. With the Angels and Astros coming to Yankee Stadium, they are going to have to get the starting pitching in gear.

When Hamels’ name was offered up as a possible Yankees trade target late Tuesday, Aaron Boone said, “I don’t think that is very much on our radar right now.’’

It should be a bit more on their radar after these three games.