The simple answer is technically bonds don't have earnings, hence no P/E.
What I think the OP is really asking how do I compare stock and bond ETFs. Some mature stocks exhibit very similar characteristics to bonds, so at the margin if you are considering investing between 2 such investments that provide stable income in the form of dividends, you might want to use the dividend/price ratio (D/P) of the stock and compare it to the dividend yield of the bond.
If you go down to the basics, both the bond and the stock can be considered
the present value of all future expected cashflows. The cash that accrues to the owner of the stock is future dividends and for the bond is the coupon payments.
If a company were to pay out 100% of its earnings, then the dividend yield D/P would be conveniently E/P. For a company with P/E of 20 that paid out it's entire earnings, one would expect D/P = 1/20 = 5%
This serves as a decent yard stick in the short term ~ 1 year to compare mature stock etfs with stable prospects vs bond funds since the former will have very little expected price growth (think utilities), hence they both compete on the cashflows they throw off to the investor.
This comparison stops being useful for stock ETFs with higher growth prospects since expected future cashflows are much more volatile. This comparison is also not valid in the long term since bond ETFs are highly sensitive to the yield curve (interest rate risk) and they can move substantially from where they are now.