I think the question suggests you are thinking of space-time as if it were e.g. a substance, like a fluid, that we move through. That's not how we view space-time, at least in pure general relativity.
But the question you ask is a deceptively simple one and it raises some complex questions. And I don't think we actually can answer them exactly because I'm not sure we have a definitive answer to the most basic question hidden in your answer: What is space-time?
is there some kind of 'friction' with space time of the planets?
There is a "kind" of friction, but perhaps "interaction" would be a better choice of word, as I'd prefer to avoid the notion of classical friction forces.
We say that when an object moves through space time it distorts space time - stretches it, compresses it. Mass creates distortions we describe as gravity.
It's a little deeper than that.
We also know, thanks to the wonderful LIGO experiments, that these gravitational effects do distort space in a wave-like way. And an object can lose energy (has to, in fact) when it creates such waves.
Which leads us to this:
if a planet loses energy due to friction can this energy loss be measured?
No (I suppose I should say, not at our technological level). It's tiny.
The gravitational waves we have measured (which represent the closest thing to your friction loss) are due to the collisions of huge black holes, and the disturbance they make is so small that LIGO scientists are pushing the boundaries of measurement to detect them at all. A planet is a tiny thing compared to those black holes and it barely makes a dent, as it were, in space time by comparison.
But it's worth saying that our current understanding of space-time is a little basic. We don't have a clear idea of how the quantum world fits into the grand scale of relativistic space-time. At present we have two models, one of a small scale space-time filled with a sea of virtual particles and the other of a pure, clean empty space time with the odd idealized gravitational mass in it. We don't have a single theory connecting them, so we don't really have a proper theory of space-time (or perhaps something deeper than that is needed - no one knows).
Best Answer
First some background: There is a lowest energy equilibrium distance for each bond between molecules in the spring. When a string is stretched or compressed, the molecules are pulled or pushed (respectively) to distances of separation other than this equilibrium distance. This stores chemical potential energy in the bonds between the molecules of the spring. The restorative force of the spring is caused by the sum of all the restorative forces of the individual bonds between molecules in the spring. See the answer by "Farcher" in this thread for a more detailed treatment: Why is the restoring force directly proportional to extension?
As to your question. While the sum of all the restorative forces between molecules in the spring is directed opposite the spring's displacement from equilibrium, the restorative force of each individual bond that is stretched points in a direction determined by the molecular structure of the spring, not necessarily the exact opposite direction of the spring's overall displacement. Therefore some of the chemical potential energy stored in the bonds of the spring fails to be returned as kinetic energy and instead causes vibrations on the molecular scale not associated with the macroscopic oscillations of the spring. Temperature is a measure of the "random" vibrations on a molecular scale in a medium, therefore some of the chemical potential energy stored in the spring increases the spring's temperature when it is released. This corresponds to a lessening of the spring's amplitude of oscillation by conservation of energy.
In addition to this, as you mentioned, the spring may lose energy to drag as it passes through a medium (such as air), but even in a system with negligible drag, the above process still accounts for a loss of mechanical energy as the spring oscillates.
The rate of this loss of mechanical energy depends on the molecular structure of the spring. In fact, any solid has this property, but the things we call "springs" have molecular structures such that a significant portion of the chemical energy stored in its bonds as a result of stretching or compressing is returned as mechanical energy upon returning to equilibrium.
If the spring moves "more" unit per time (greater amplitude or frequency), then you will lose more mechanical energy. I am not sure how changes in the spring constant would effect the rate of loss of mechanical energy because the way to change the spring constant is to change the molecular structure of the spring.
This is basically the same question / answer and cites a paper which probably goes into more detail (that I haven't read):
Friction between atoms in spring
Hope that makes sense!