dd-trace-rb icon indicating copy to clipboard operation
dd-trace-rb copied to clipboard

Add support for `concurrent-ruby` `Concurrent::Promises::Future`

Open benrbrook opened this issue 4 years ago • 5 comments

The concurrent-ruby pattern for using Futures is now contained in Concurrent::Promises::Future, and Concurrent::Future has been deprecated (https://github.com/ruby-concurrency/concurrent-ruby#deprecated). It would be great if we could add support for the new style of Futures so that tracing context is propagated for Concurrent::Promises::Future as well (https://github.com/DataDog/dd-trace-rb/blob/master/lib/ddtrace/contrib/concurrent_ruby/patcher.rb#L23).

benrbrook avatar Jan 20 '21 19:01 benrbrook

Seems like a more than reasonable request, @benrbrook. I'll add it to our roadmap. Given how small the required changes seem to be, I expect that we'll be able to address it without much issue.

marcotc avatar Jan 20 '21 20:01 marcotc

@marcotc This is a bit trickier than expected because of additional indirection in the new Promises::ChainPromise#on_resolvable, but I got something running. I'll clean that up next week and push a PR.

lloeki avatar May 21 '21 16:05 lloeki

Any news on this? This feature would be extremely helpful.

mvastola avatar Sep 07 '21 02:09 mvastola

Good points! @lloeki created a PR for this in #1522 , I'll ping him :)

ivoanjo avatar Sep 07 '21 07:09 ivoanjo

Thanks Ivo! Right now I'm on another goal until October starts, then I should have some time to finalise the PR Ivo mentioned.

lloeki avatar Sep 09 '21 18:09 lloeki

This has been implemented in release 1.16.0.

marcotc avatar Apr 18 '24 21:04 marcotc