When dealing with bonds and constant maturities there are two process that can be used:
Continually rolling the '10Y index' bond
This means that you record the yield for whichever specific bond is classified as the 'on-the-run' 10Y at that point in time. That bond will continue to be sampled for some amount of time, e.g. 2-6mths and then a longer bond will become the on-the-run 10Y and that will be recorded instead.
This causes problems with time-series analysis since the changeover day will correspond to a discrete jump that reflects the 'spread' between the two bonds which is not actually market movement but instead due to the underlying characteristics of the different bonds, high coupon vs low coupon, CAC terms, coupon payment months, issue size, free float etc. etc.
Calculating from a Bond Curve
Another method is to generate a best-fit bond curve which fits all the bonds on the curve for a given day and then sample the YTM of a generic (virtual) bond from it, i.e. a 10Y 2% coupon bond.
This is my preferred way of doing it since it avoids the problem above, but has its own problems. Firstly it requires a good curve building model which takes many things into account (new issues, different bond characteristics) and the numerical solver can be difficult to program. This can be better for countries or credits which have sparse bonds since you interpolate and produce a better 10Y point. It also relies on a defined coupon specification for the 10Y which is arbitrary.
Bloomberg does not use this methods due to its lack of transparency and additional complexity.