otel4s
otel4s copied to clipboard
TextMap typeclasses for Java implementations?
Following from #207, would it make sense to have adapters from the Java implementations?
Why:
- Because we can
- There's a wealth of them in the java instrumentation library
Why not:
- Because we can doesn't imply we should
- It's probably usually the Java agent invoking those from the Java SDK for Java types in practice? Wait until someone wants it?
If we do:
- It should be explicit. ~~We don't know what's mutable and what's not from parameter
A~~. [Edit: it's supposed to be mutable in that world, but it might not be canonical. Still better to be explicit.]
Currently, we can convert Java's TextMapGetter and TextMapPropagator to otel4s. And wise-versa:
https://github.com/typelevel/otel4s/blob/main/oteljava/common/src/main/scala/org/typelevel/otel4s/oteljava/context/propagation/PropagatorConverters.scala
It's not a typeclass, but the functionality is somewhat similar.
This seems good to me.