Skip to content

griffhun/opentracing-playframework

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.DefaultDispatchConfigurator

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
  )
)

About

OpenTracing for the Play Framework

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Scala 100.0%