Macro to resolve Companion depending Classpath (Maven-Profile)

I am testing out some Metrics-providers (namely Kamon and Micrometer) which I separated by two dedicated Maven profiles. Depending on the activated profile the corresponding companion object should be resolved (they share the same trait)-

First I tried to resolve the companion via standard Java reflection but this seems to be more difficult than expected. Now, I’ve read that Macros can actually help in situations like this at compile time.
Can someone point me to a documentation for Scala 2.13 which describes Macros? I’ve also read in the past that they are supposed to be deprecated but obviously have returned.

Thanks

I once wrote a little macro for that. I guess it should still work.

Thanks for the gist.
Since I am quite new to Scala, I am a little overwhelmed by the types there. Could you give a little advice how to use the macro?