diff options
author | Ivan Topolnjak <ivantopo@gmail.com> | 2015-05-04 23:01:55 +0200 |
---|---|---|
committer | Ivan Topolnjak <ivantopo@gmail.com> | 2015-05-04 23:01:55 +0200 |
commit | 6d4cc924e965fc013533826bdff73ba8335f749b (patch) | |
tree | d1e52699e67a63757d57e3cadc51c23b89338729 /kamon-play/src/main | |
parent | 15a686559261470adeea26be5edef702a2a3729d (diff) | |
download | Kamon-6d4cc924e965fc013533826bdff73ba8335f749b.tar.gz Kamon-6d4cc924e965fc013533826bdff73ba8335f749b.tar.bz2 Kamon-6d4cc924e965fc013533826bdff73ba8335f749b.zip |
! play: change PlayNameGenerator to plain NameGenerator.
Diffstat (limited to 'kamon-play/src/main')
-rw-r--r-- | kamon-play/src/main/resources/reference.conf | 2 | ||||
-rw-r--r-- | kamon-play/src/main/scala/kamon/play/Play.scala | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/kamon-play/src/main/resources/reference.conf b/kamon-play/src/main/resources/reference.conf index 88f1de26..7f6e651f 100644 --- a/kamon-play/src/main/resources/reference.conf +++ b/kamon-play/src/main/resources/reference.conf @@ -19,7 +19,7 @@ kamon { # Fully qualified name of the implementation of kamon.play.PlayNameGenerator that will be used for assigning names # to traces and client http segments. - name-generator = kamon.play.DefaultPlayNameGenerator + name-generator = kamon.play.DefaultNameGenerator } diff --git a/kamon-play/src/main/scala/kamon/play/Play.scala b/kamon-play/src/main/scala/kamon/play/Play.scala index 92f0dc74..072ea436 100644 --- a/kamon-play/src/main/scala/kamon/play/Play.scala +++ b/kamon-play/src/main/scala/kamon/play/Play.scala @@ -42,18 +42,18 @@ class PlayExtension(private val system: ExtendedActorSystem) extends Kamon.Exten val traceTokenHeaderName: String = config.getString("trace-token-header-name") private val nameGeneratorFQN = config.getString("name-generator") - private val nameGenerator: PlayNameGenerator = system.dynamicAccess.createInstanceFor[PlayNameGenerator](nameGeneratorFQN, Nil).get + private val nameGenerator: NameGenerator = system.dynamicAccess.createInstanceFor[NameGenerator](nameGeneratorFQN, Nil).get def generateTraceName(requestHeader: RequestHeader): String = nameGenerator.generateTraceName(requestHeader) def generateHttpClientSegmentName(request: WSRequest): String = nameGenerator.generateHttpClientSegmentName(request) } -trait PlayNameGenerator { +trait NameGenerator { def generateTraceName(requestHeader: RequestHeader): String def generateHttpClientSegmentName(request: WSRequest): String } -class DefaultPlayNameGenerator extends PlayNameGenerator { +class DefaultNameGenerator extends NameGenerator { def generateTraceName(requestHeader: RequestHeader): String = s"${requestHeader.method}: ${requestHeader.uri}" def generateHttpClientSegmentName(request: WSRequest): String = request.url } |