otel4s icon indicating copy to clipboard operation
otel4s copied to clipboard

TextMap typeclasses for Java implementations?

Open rossabaker opened this issue 2 years ago • 2 comments

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.]

rossabaker avatar May 10 '23 20:05 rossabaker

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

iRevive avatar Apr 05 '24 11:04 iRevive

It's not a typeclass, but the functionality is somewhat similar.

iRevive avatar Apr 05 '24 11:04 iRevive

This seems good to me.

rossabaker avatar Jun 06 '24 20:06 rossabaker