Zipkin-futures: Zipkin tracing for Scala Futures and non-Futures

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Zipkin-futures: Zipkin tracing for Scala Futures and non-Futures

Lloyd C
Hi,

Zipkin-Futures (https://github.com/lloydmeta/zipkin-futures) is a lib that allows you to easily send Spans to a Zipkin collector that measure how long a Scala operation (async or sync) has taken to execute.

There is an accompanying zipkin-futures-play project that makes it easy to use w/ Play (so that parent Spans describe via HTTP headers are respected)

It is Mavenised and easy to install:

libraryDependencies ++= Seq(
    "com.beachape" %% "zipkin-futures" % "0.0.9"  // OR
    "com.beachape" %% "zipkin-futures-play" % "0.0.9" // if you are using Play and want to use the filter w/ RequestHeader conversions
)

Example usage:

/*
 A simple new Span that tells us we have no parent here. 
*/
implicit val span = new Span()
// Using a simple LoggingSpanCollectorImpl here as an example, but it can be a ZipkinSpanCollector that actually sends spans
implicit val zipkinService = new BraveZipkinService("localhost", 9000, "testing", new LoggingSpanCollectorImpl("application"))

val myTracedFuture1 = TracedFuture("slowHttpCall") { _ => expensiveOp }

Relevant links:

--
You received this message because you are subscribed to the Google Groups "scala-announce" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.