What? All of this has been solved for a long time. How do you think hyperscalers do this?
Search keyword: "Adaptive sampling"
Search keyword: "Adaptive sampling"
Tracing traces a particular event.
I'm quite aware of the difference between sampling, tracing and profiling.
It can be applied to tracing, metrics, logging ("sampling") and profiling.