There are many constructions to produce a compact metric space from an arbitrary metric space (sometimes extra conditions are imposed).
But is it possible to compactify a metric space M into M* such that M can be isometrically embedded into M*. Moreover is there a canonical one?
A compact metric space is totally bounded. Inasmuch as total boundedness is hereditary, a metric space which is isometrically embeddable in a compact space must be totally bounded.
Conversely, if a metric space is totally bounded, then its completion is totally bounded and (of course) complete; and a totally bounded complete metric space is compact. (This is because, in a totally bounded metric space, every sequence has a Cauchy subsequence.)