diff options
author | Carlos Ferreyra <cferreyra@despegar.com> | 2013-12-26 14:39:36 -0300 |
---|---|---|
committer | Carlos Ferreyra <cferreyra@despegar.com> | 2013-12-26 14:39:36 -0300 |
commit | 5606d35cb9f06ac655ea2abc4f0aa2e53c892b0f (patch) | |
tree | bf7370d3290fef942de875d169db392640fb9db2 /kamon-trace/src/main/scala/kamon/trace/instrumentation/ActorLoggingTracing.scala | |
parent | da5f0b89ab1912c84f948872fa54bef761ffe173 (diff) | |
download | Kamon-5606d35cb9f06ac655ea2abc4f0aa2e53c892b0f.tar.gz Kamon-5606d35cb9f06ac655ea2abc4f0aa2e53c892b0f.tar.bz2 Kamon-5606d35cb9f06ac655ea2abc4f0aa2e53c892b0f.zip |
Added new respondWithUow directive to add the X-UOW header back in the response.
Changed ActorLogging to just propagate the trace context (does not add to the MDC anymore).
Created UowConverter to let logback know where the extract the UOW from.
Diffstat (limited to 'kamon-trace/src/main/scala/kamon/trace/instrumentation/ActorLoggingTracing.scala')
-rw-r--r-- | kamon-trace/src/main/scala/kamon/trace/instrumentation/ActorLoggingTracing.scala | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/kamon-trace/src/main/scala/kamon/trace/instrumentation/ActorLoggingTracing.scala b/kamon-trace/src/main/scala/kamon/trace/instrumentation/ActorLoggingTracing.scala index 783fd6e1..0d06eb2c 100644 --- a/kamon-trace/src/main/scala/kamon/trace/instrumentation/ActorLoggingTracing.scala +++ b/kamon-trace/src/main/scala/kamon/trace/instrumentation/ActorLoggingTracing.scala @@ -17,8 +17,7 @@ package kamon.trace.instrumentation import org.aspectj.lang.annotation.{ Around, Pointcut, DeclareMixin, Aspect } import org.aspectj.lang.ProceedingJoinPoint -import org.slf4j.MDC -import kamon.trace.{ TraceContext, ContextAware, Trace } +import kamon.trace.{ ContextAware, Trace } @Aspect class ActorLoggingTracing { @@ -31,13 +30,8 @@ class ActorLoggingTracing { @Around("withMdcInvocation(logSource, logEvent, logStatement)") def aroundWithMdcInvocation(pjp: ProceedingJoinPoint, logSource: String, logEvent: ContextAware, logStatement: () ⇒ _): Unit = { - logEvent.traceContext match { - case Some(ctx) ⇒ - MDC.put("uow", ctx.uow) - pjp.proceed() - MDC.remove("uow") - - case None ⇒ pjp.proceed() + Trace.withContext(logEvent.traceContext) { + pjp.proceed() } } } |