When the whole investing world is feeling unsafe, where will they rush to? Answer: US Treasuries OR may be Gold. But Gold has many other purposes as well, like inflation hedge, Store of value, etc. So let's confine ourselves to the US Treasuries here.
US treasuries are a safe haven at times of distress and when credit crisis prevails in the market. So by measuring the price performance (hence money flow) of the US treasuries against various risky assets, we can get a sense of Risk ON/OFF scenario.
The following chart shows the ratio of S&P 500 over Long term US Treasuries - depicting credit risk in the market.
But when there is interest rate risk in the economy then long term treasuries are susceptible to rising interest rates. To account for the interest rate risk, you need to also look at the ratio of S&P 500 against short term treasuries.
Between the 2 charts, you should be able to get a general assessment of credit risk in the market.
Another way to assess the credit risk in the market is by looking at the ratio of Junk bond yields over investment grade bonds or US treasuries of same duration. (Note that the bond prices are sensitive to duration). High Yield bond ETF (HYG) and Aggregate bond ETF (AGG) has similar weighted Duration and is used in the chart below.