diff options
Diffstat (limited to 'kamon-play/src')
-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 } |