akka-tracing
akka-tracing copied to clipboard
Akka-http page is missing in Wiki
https://github.com/levkhomich/akka-tracing/wiki There is no page for akka-http. So it is not clear how to trace requests with akka-http and Java.
Nice catch, thank you. I will take care of it.
Generally speaking, it should be used in the same way as Spray tooling from Scala. I do not know anyone who is interested in using it from Java, so there is no support for it yet.
I'm interested :) I use akka-http from Java.
Would love a scala page for akka-http. I'm currently doing
class Routes(sys: ActorSystem) extends BaseTracingDirectives{
override def trace: TracingExtensionImpl = TracingExtension(sys)
//Routes go here
}
I am not using actors explictly and bind like this:
val bindingFuture = Http().bindAndHandle(new Routes(system).routes, "0.0.0.0", 8080)
@raam86 can you provide complete usage example with routes definition and wiring it with tracing support?
can't make it work with json requests as i must provide unmarshaller/marshaller for tracedHandleWith
@tonypizzicato my route looks like this:
val tracedPlaces = (am: ActorMaterializer) => path("tplace") {
get {
implicit val aq = am
tracedHandleWith("place")(processPlace)
}
}
make sure you return the correct types from the handle with function. processPlace
signature:
def processPlace(place: PlaceRequestParameters)(implicit am: ActorMaterializer): Future[JsObject]
I am stuck as well.
I have
get {
import com.mdsol.strategicmonitoring.visits.model.views.ClientViewsJsonProtocol._
path(uri / JavaUUID) { uuid =>
tracedHandleWith(systemName) {
extractUserUUID { userUuid =>
logger.info(s"Get visit")
complete(
visitsService.findByUuid(userUuid, uuid).map {
case visit@Some(_) =>
logger.info(s"Visit retrieved")
OK -> visit
case _ => NotFound -> None
}
)
}
}
}
}
for above route it requires an implicit FromRequestUnmarshaller
. What is the idea? Do I need to provide a class with TracingSupport, e.g. TestMessage
class in the tests, for all of my routes then try to unmarshall something like TestMessage
for each request ?