diff options
Diffstat (limited to 'kamon-spray/src')
4 files changed, 6 insertions, 6 deletions
diff --git a/kamon-spray/src/main/resources/reference.conf b/kamon-spray/src/main/resources/reference.conf index c5270ef5..1a900fea 100644 --- a/kamon-spray/src/main/resources/reference.conf +++ b/kamon-spray/src/main/resources/reference.conf @@ -19,7 +19,7 @@ kamon { # Fully qualified name of the implementation of kamon.spray.SprayNameGenerator that will be used for assigning names # to traces and client http segments. - name-generator = kamon.spray.DefaultSprayNameGenerator + name-generator = kamon.spray.DefaultNameGenerator client { # Strategy used for automatic trace segment generation when issue requests with spray-client. The possible values diff --git a/kamon-spray/src/main/scala/kamon/spray/SprayExtension.scala b/kamon-spray/src/main/scala/kamon/spray/SprayExtension.scala index 37e12702..ebf79496 100644 --- a/kamon-spray/src/main/scala/kamon/spray/SprayExtension.scala +++ b/kamon-spray/src/main/scala/kamon/spray/SprayExtension.scala @@ -60,13 +60,13 @@ class SprayExtensionImpl(system: ExtendedActorSystem) extends SprayExtension { settings.nameGenerator.generateHostLevelApiSegmentName(request) } -trait SprayNameGenerator { +trait NameGenerator { def generateTraceName(request: HttpRequest): String def generateRequestLevelApiSegmentName(request: HttpRequest): String def generateHostLevelApiSegmentName(request: HttpRequest): String } -class DefaultSprayNameGenerator extends SprayNameGenerator { +class DefaultNameGenerator extends NameGenerator { def generateRequestLevelApiSegmentName(request: HttpRequest): String = { val uriAddress = request.uri.authority.host.address diff --git a/kamon-spray/src/main/scala/kamon/spray/SprayExtensionSettings.scala b/kamon-spray/src/main/scala/kamon/spray/SprayExtensionSettings.scala index 44c71eaf..627d5176 100644 --- a/kamon-spray/src/main/scala/kamon/spray/SprayExtensionSettings.scala +++ b/kamon-spray/src/main/scala/kamon/spray/SprayExtensionSettings.scala @@ -5,7 +5,7 @@ import akka.actor.ExtendedActorSystem case class SprayExtensionSettings( includeTraceTokenHeader: Boolean, traceTokenHeaderName: String, - nameGenerator: SprayNameGenerator, + nameGenerator: NameGenerator, clientInstrumentationLevel: ClientInstrumentationLevel.Level) object SprayExtensionSettings { @@ -16,7 +16,7 @@ object SprayExtensionSettings { val traceTokenHeaderName: String = config.getString("trace-token-header-name") val nameGeneratorFQN = config.getString("name-generator") - val nameGenerator: SprayNameGenerator = system.dynamicAccess.createInstanceFor[SprayNameGenerator](nameGeneratorFQN, Nil).get // let's bubble up any problems. + val nameGenerator: NameGenerator = system.dynamicAccess.createInstanceFor[NameGenerator](nameGeneratorFQN, Nil).get // let's bubble up any problems. val clientInstrumentationLevel: ClientInstrumentationLevel.Level = config.getString("client.instrumentation-level") match { case "request-level" ⇒ ClientInstrumentationLevel.RequestLevelAPI diff --git a/kamon-spray/src/test/scala/kamon/spray/ClientRequestInstrumentationSpec.scala b/kamon-spray/src/test/scala/kamon/spray/ClientRequestInstrumentationSpec.scala index 4b99022e..a72c4e5e 100644 --- a/kamon-spray/src/test/scala/kamon/spray/ClientRequestInstrumentationSpec.scala +++ b/kamon-spray/src/test/scala/kamon/spray/ClientRequestInstrumentationSpec.scala @@ -294,7 +294,7 @@ class ClientRequestInstrumentationSpec extends BaseKamonSpec("client-request-ins } } -class TestSprayNameGenerator extends SprayNameGenerator { +class TestNameGenerator extends NameGenerator { def generateTraceName(request: HttpRequest): String = request.uri.path.toString() def generateRequestLevelApiSegmentName(request: HttpRequest): String = "request-level " + request.uri.path.toString() def generateHostLevelApiSegmentName(request: HttpRequest): String = "host-level " + request.uri.path.toString() |