diff options
author | Diego <diegolparra@gmail.com> | 2015-08-16 11:33:12 -0300 |
---|---|---|
committer | Diego <diegolparra@gmail.com> | 2015-08-16 11:33:12 -0300 |
commit | c223b5a334037c5ff3d5db026e6178a92706cdb4 (patch) | |
tree | 6da99e470bb572413d927c1833aa0f9086114c90 /kamon-spray/src/main/scala/kamon/spray | |
parent | 863fe5d26cb81f92dd009ff87e7944462dadafd8 (diff) | |
download | Kamon-c223b5a334037c5ff3d5db026e6178a92706cdb4.tar.gz Kamon-c223b5a334037c5ff3d5db026e6178a92706cdb4.tar.bz2 Kamon-c223b5a334037c5ff3d5db026e6178a92706cdb4.zip |
! play: remove diagnostic context data
Diffstat (limited to 'kamon-spray/src/main/scala/kamon/spray')
-rw-r--r-- | kamon-spray/src/main/scala/kamon/spray/instrumentation/ServerRequestInstrumentation.scala | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/kamon-spray/src/main/scala/kamon/spray/instrumentation/ServerRequestInstrumentation.scala b/kamon-spray/src/main/scala/kamon/spray/instrumentation/ServerRequestInstrumentation.scala index d76b9f58..d773ecd8 100644 --- a/kamon-spray/src/main/scala/kamon/spray/instrumentation/ServerRequestInstrumentation.scala +++ b/kamon-spray/src/main/scala/kamon/spray/instrumentation/ServerRequestInstrumentation.scala @@ -15,10 +15,8 @@ * ========================================================== */ package spray.can.server.instrumentation -import kamon.trace.TraceLocal.{ HttpContext, HttpContextKey } import org.aspectj.lang.annotation._ import kamon.trace._ -import spray.can.server.OpenRequest import spray.http.{ HttpResponse, HttpMessagePartWrapper, HttpRequest } import kamon.Kamon import kamon.spray.{ SprayExtension, Spray } @@ -28,8 +26,6 @@ import spray.http.HttpHeaders.RawHeader @Aspect class ServerRequestInstrumentation { - import ServerRequestInstrumentation._ - @DeclareMixin("spray.can.server.OpenRequestComponent.DefaultOpenRequest") def mixinContextAwareToOpenRequest: TraceContextAware = TraceContextAware.default @@ -87,9 +83,6 @@ class ServerRequestInstrumentation { recordHttpServerMetrics(response, incomingContext.name, sprayExtension) - //store in TraceLocal useful data to diagnose errors - storeDiagnosticData(openRequest) - proceedResult } } @@ -116,19 +109,4 @@ class ServerRequestInstrumentation { case response: HttpResponse ⇒ response.withHeaders(response.headers ::: RawHeader(traceTokenHeaderName, token) :: Nil) case other ⇒ other } - - def storeDiagnosticData(currentContext: TraceContextAware): Unit = { - val request = currentContext.asInstanceOf[OpenRequest].request - val headers = request.headers.map(header ⇒ header.name -> header.value).toMap - val agent = headers.getOrElse(UserAgent, Unknown) - val forwarded = headers.getOrElse(XForwardedFor, Unknown) - - TraceLocal.store(HttpContextKey)(HttpContext(agent, request.uri.toRelative.toString(), forwarded)) - } -} - -object ServerRequestInstrumentation { - val UserAgent = "User-Agent" - val XForwardedFor = "X-Forwarded-For" - val Unknown = "unknown" } |