otel4s
otel4s copied to clipboard
IO(doStuff).trace("", Attributes(...)) syntax
trace4cats has this nice extension syntax that allows to introduce tracing into a code base without adding much clutter:
IO(doStuff).trace("", Attributes(...))
I would love for something like this to be in otel4s but it would add another way to do things.
That could be useful.
@NthPortal what do you think? Do you have similar use cases at work?
I guess we can make extension syntax available via imports:
import org.typelevel.otel4s.metrics.syntax._ // metrics only syntax
import org.typelevel.otel4s.trace.syntax._ // trace only syntax
import org.typelevel.otel4s.syntax._ // metrics and trace syntax
originally I was going to say that I don't object particularly, but I realised that it would require another set of macros (or lose the optimisation), so I'm not sure if it's a great idea
Maybe a scala-3-only inline def?
We already have macro definitions for both Scala 2 and Scala 3. With some refactoring, we can make it work.
As I mentioned here, perhaps we can launch experimental modules with no guarantee of binary compatibility.