A key predictor of the health of the American economy is inching closer to signaling a recession.

The indicator in question is the US Treasury yield curve, a measure of the gap between short- and long-term interest rates. When it is steep — meaning it costs more to borrow money for the long term — that's a good sign investors expect a quickly growing economy.

A flattening one suggests a slowing one. That's what's occurring now.

The spread between the yields on two-year and 10-year Treasurys fell to 79 basis points, or 0.79%, after Wednesday's disappointing consumer-price and retail-sales data. The spread is currently within a few hundredths of a percentage point of being the tightest it has been since 2007.

Perhaps more notably, it is on a path to "inverting" — meaning it would cost more to borrow for the short term than the long term — for the first time since the months leading up to the financial crisis.

An inversion would most likely be a signal that a recession is imminent. An inverted yield curve has a perfect track record of predicting recessions, according to RBC's Jonathan Golub. You can see this in the chart below — the shaded areas are recessions.

On Wednesday, in an indication that policy could tighten further, the Federal Reserve raised its benchmark interest rate for the fourth time since the financial crisis and laid out its plan to unwind its massive $4.5 trillion balance sheet.

The Fed also signaled that it remains committed to its plan for gradual interest-rate increases. The Federal Open Market Committee said on Wednesday that it "continues to expect that, with gradual adjustments in the stance of monetary policy, economic activity will expand at a moderate pace, and labor market conditions will strengthen somewhat further."

A further tightening of policy would most likely cause the yield curve to flatten even more, and possibly invert. That's because Fed rate hikes cause the front end of the curve to rise faster than the long end.

So where is the yield curve going from here?

A basic technical analysis shows that a double top has formed over the past six years or so and suggests the yield curve could flatten to about -9 basis points.

And if history is any guide, this would seem to set up the next recession.