Support context propagation in Cats Effect library (Scala) #10599
Labels
contribution welcome
Request makes sense, maintainers probably won't have time, contribution would be welcome
enhancement
New feature or request
new instrumentation
Is your feature request related to a problem? Please describe.
When trying out auto-instrumentation in a Scala application (Play Framework), I noticed that some of my Play WS Client calls are instrumented but not related to their parent traces. As some others were, I dug a bit and found out it's related to my usage of Cats library (Cats Effect and Cats Retry).
I think the context is not propagated when using Cats Effect library.
Here's a minimal code sample to highlight the behavior I'm talking about:
Note that it also impacts further operations. Let's say I chain a second call without retries: the context is lost event though I don't use Cats in this second call.
Describe the solution you'd like
I'd like the context to be propagated in Cats Effect
IO
usage (and thus in Cats Retry) so that, in my example above, callingcallWithCatsRetry
gives me a span attached to the parent trace rather than a new trace.Describe alternatives you've considered
I'll be looking at not using Cats Effect for this, likely by using a simpler retry library without
IO
type.Additional context
For people not familiar with Scala ecosystem, Cats Effect is kinda similar to ZIO (for which there's some auto instrumentation available): it's a "asynchronous runtime" working with fibers (green threads).
The text was updated successfully, but these errors were encountered: