Skip to content
master
Switch branches/tags
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 

OpenTracing for Play Framework

Build Status Maven Version

Usage

Add dependency

This project is cross-versioned against Play. The Play version appears as a suffix.

// Play 2.3.x-2.4.x
libraryDependencies += "com.lucidchart" % "opentracing-play-active" % "<version>-2.3"
// Play 2.5.x
libraryDependencies += "com.lucidchart" % "opentracing-play-active" % "<version>-2.5"

Configure Akka

This project ThreadContextSpan and GlobalTracer.

To propagate the thread-local span, add akka-thread-context as a dependency and configure Akka to use DispatchConfigurator.

akka.actor.default-dispatcher.type = com.lucidchart.akka.threadcontext.DefaultDispatcherConfigurator

Add filters

Add TracingFilter, specifying the SpanTaggers that you want.

import io.opentracing.play.active

class Filters extends DefaultHttpFilters(
  new DefaultTracingFilter(
    new ContentTagger,               // content headers
    new HttpVersionTagger,           // HTTP version
    new StandardSpanTagger,          // standard OpenTracing tags
    new TagsSpanTagger(_ => true)    // Play request tags
  )
)