Description
👋 Hi! I'm coming here by way of a bug report in graphql-ruby: rmosolgo/graphql-ruby#3366
A recent GraphQL-Ruby release included a Fiber-based batch loading plugin: it takes little "jobs" during GraphQL execution, then uses a bunch of Fibers to run the jobs concurrently. (Hopefully, it'll leverage the Ruby 3 scheduler soon so that I/O in those fibers happens in parallel, but that's not done yet.)
A user noticed that code run inside Fibers doesn't show up in DataDog APM, and that it's likely due to the use of Thread.current
for storing DataDog state:
dd-trace-rb/lib/ddtrace/opentracer/thread_local_scope_manager.rb
Lines 35 to 37 in 079f18f
(Inside a new Fiber, Thread.current
is empty.)
I'm sorry to say I don't have an idea for how to address this, but I thought I'd open an issue in case y'all have any suggestions. This certainly seems related to #1136 , since both are about using Fibers.
Does anyone have a suggestion for how this issue might be addressed?