As others have noted, consistent treatment of capitalization rate extraction is very important.
The "absolute" or "bonded" national-credit very long term leases (e.g., Walgreens) make up a specialty investor market. A teasingly stereotype it as the little old lady who wants to retire to Florida and play golf and doesn't want to be bothered with property management headaches. She also doesn't want to incur capital gains taxes so she 1031-exchanges out of the active management generic properties. These investors don't seem to subtract a vacancy factor but rather load tenant credit risk, default risk, term structure, and renewal option risk into the cap rate.
For the more generic local credit office/warehouse/retail 10 year lease, I would take out a vacancy factor. At the end of year 10 there will be a period of vacancy. The vacancy will depend on the property type, building's condition, market conditions, etc. Such a vacancy might be 3, 6, 12, 15, 18, 24 months, etc. CoStar Analytic reports can provide a guide to how long comparable space has sat on the market. You can also simply be observant of how long similar buildings remain vacant.
For example, say a building following the 10 year lease would be vacant for 0.5 years. A simple guide is 4.8% (=10 yrs / 10.5 yrs).
However, because of the impact of the present value of the dollar, it overstates the vacancy. A DCF will handle this by itself, but as I rely on direct cap for my client's assignments, I have a little Excel sheet that let's me play with this.
The present value (PV) of 10 years of cash flow (an EGI) can be divided by PV of 10.5 years (=10+0.5) of the PGI (as if it was fully occupied). At a 10% discount rate, this example would compute 6.3059 PV factor of the EGI occupancy. Because the occupancy-vacancy process is chained a reversion factor has to be computed as a sinking fund factor. In this example it is 0.3515 PV of the reversion divided by of the occupancy divided by 6.8368 (compounded monthly). It would be occupied 97.38% of the 10.5 years or vacant 2.62% years. Depending on how investors/brokers see things, then it could be rounded to 0% or 5% or 3%, and whatever. As a PV calculation, the model reflects a chain of this occupancy pattern, i.e., years 1-10 occupied, year 10.0 to 10.5 yr vacant, years 10.5 to 20.5 occupied, 1/2 yr vacant, years 21-31 occupied, etc.
Obviously this is not the only way to observe vacancy but it has been a handy tool to "picture" the implications of different market conditions. When I use 12 months of vacancy at end of 10 years, the imputed vacancy rate rises to 5.0%. It helps me appreciate vacancy rates between a good retail location with quick lease up times vs. a blighted location with lingering vacant space.
Default risk is slightly different attribute than the physical vacancy. Default risk could be loaded into the physical vacancy rate or loaded into the capitalization rate, just mirror the market and don't over/under count.