Jaeger Scala Integrations based on Jaeger Java Client
jaeger-scala-support provide trace feature support for scala frameworks via Jaeger
"io.github.reinno" %% "akka-jaeger-client" % <latest-version>
simple case
import io.github.reinno.AkkaHttpTraceDirectives
trait ExampleRoutes extends AkkaHttpTraceDirectives {
override implicit val exec: ExecutionContext = system.dispatcher
val exampleRoutes: Route = withTrace() {
pathPrefix("hello") {
pathEnd {
get {
complete("hello world")
}
}
}
}
}
complete case
import io.github.reinno.AkkaHttpTraceDirectives
trait ExampleRoutes extends AkkaHttpTraceDirectives {
override implicit val exec: ExecutionContext = system.dispatcher
override protected lazy val tracer: Tracer = TraceSupport.defaultTracer("example")
val exampleRoutes: Route = withTraceContext() {
traceCtx => {
pathPrefix("hellow") {
pathEnd {
get {
complete("hello world")
}
}
}
}
}
}
install docker
docker run -d -e \
COLLECTOR_ZIPKIN_HTTP_PORT=9411 \
-p 5775:5775/udp \
-p 6831:6831/udp \
-p 6832:6832/udp \
-p 5778:5778 \
-p 16686:16686 \
-p 14268:14268 \
-p 9411:9411 \
jaegertracing/all-in-one:latest
sbt "project client" publishLocal
sbt "project akka-http-client" publishLocal
sbt "project spray-client" publishLocal
sbt "project akka-http-example" run
sbt "project spray-example" run
curl localhost:9001/users
curl localhost:9002/users
open http://localhost:16686/search check traces