levkhomich / akka-tracing

A distributed tracing extension for Akka. Provides integration with Play framework, Spray and Akka HTTP.
Other
308 stars 32 forks source link

@deprecated asResponseTo #81

Closed mohanpriyadarshi closed 7 years ago

mohanpriyadarshi commented 8 years ago

why are we deprecating asResponseTo ? I can't find equivalent function which can capture response msg and send a ServerSend. def asResponseTo(ts: BaseTracingSupport)(implicit trace: TracingExtensionImpl): T = { trace.record(ts, "response: " + msg) trace.record(ts, TracingAnnotations.ServerSend) msg }

levkhomich commented 8 years ago

Explicit calling of trace methods simplifies tracing instrumentation discoverability. It easier to find all trace usages than look for actor ask pattern overloads, .asResponseTo calls and ActorLogging hooks. That's why all these API will be deprecated at some point (starting with .asResponseTo).

Another important thing is that you do not always want to end parent request's span, or call msg.toString and write it to a trace (because it could hurt performance).

Of course, existing API is subject to change, so some shortcuts may be introduced later according to users feedback. But at this moment, implementing optimized shortcuts for every possible case may easily pollute API. Right now the focus is to provide as much flexibility and functionality as possible (custom annotations, new flags, logging interop, etc.) using minimalistic API.

mohanpriyadarshi commented 8 years ago

I agree with the performance impact writing everything to trace. That's true even with explicit method. "asResponseTo" is a very useful shortcut. Instrumentation looks much cleaner. Please reconsider or provide a equivalent method