Search code examples
javascalatwittertracefinagle

What is twitter's Future.trace() method used for?


The class com.twitter.util.Future has a method Future.trace(), return type is com.twitter.util.Future.Tracer (this can be found in the compiled Java class)

However, I couldn't find that method in the original Scala code or in the doc. Do you know where I can find the usage or source code for that method?

Why I'm doing this: I'm trying to implement my own tracing framework using Finagle trace.


Solution

  • Future.trace is actually an old member of the Future object. It was used to enable registration of call stack every time you link two asynchronous computations together with map/flatMap. This feature wasn't very popular, so we just remove it.

    If you want to look at a tracing Framework you should look at zipkin, and finagle-zipkin that's basically an open-source implementation of Google's Dapper (See paper)