diff options
Diffstat (limited to 'kamon-scala/src')
4 files changed, 18 insertions, 18 deletions
diff --git a/kamon-scala/src/main/scala/kamon/scala/instrumentation/FutureInstrumentation.scala b/kamon-scala/src/main/scala/kamon/scala/instrumentation/FutureInstrumentation.scala index 01514869..18ca58be 100644 --- a/kamon-scala/src/main/scala/kamon/scala/instrumentation/FutureInstrumentation.scala +++ b/kamon-scala/src/main/scala/kamon/scala/instrumentation/FutureInstrumentation.scala @@ -16,7 +16,7 @@ package kamon.scala.instrumentation -import kamon.trace.{ TraceContext, TraceContextAware } +import kamon.trace.{ Tracer, TraceContextAware } import org.aspectj.lang.ProceedingJoinPoint import org.aspectj.lang.annotation._ @@ -40,7 +40,7 @@ class FutureInstrumentation { @Around("futureRelatedRunnableExecution(runnable)") def aroundExecution(pjp: ProceedingJoinPoint, runnable: TraceContextAware): Any = { - TraceContext.withContext(runnable.traceContext) { + Tracer.withContext(runnable.traceContext) { pjp.proceed() } } diff --git a/kamon-scala/src/main/scala/kamon/scalaz/instrumentation/FutureInstrumentation.scala b/kamon-scala/src/main/scala/kamon/scalaz/instrumentation/FutureInstrumentation.scala index b5aadbd3..862d7fdd 100644 --- a/kamon-scala/src/main/scala/kamon/scalaz/instrumentation/FutureInstrumentation.scala +++ b/kamon-scala/src/main/scala/kamon/scalaz/instrumentation/FutureInstrumentation.scala @@ -16,7 +16,7 @@ package kamon.scalaz.instrumentation -import kamon.trace.{ TraceContext, TraceContextAware } +import kamon.trace.{ Tracer, TraceContextAware } import org.aspectj.lang.ProceedingJoinPoint import org.aspectj.lang.annotation._ @@ -40,7 +40,7 @@ class FutureInstrumentation { @Around("futureRelatedCallableExecution(callable)") def aroundExecution(pjp: ProceedingJoinPoint, callable: TraceContextAware): Any = - TraceContext.withContext(callable.traceContext) { + Tracer.withContext(callable.traceContext) { pjp.proceed() } diff --git a/kamon-scala/src/test/scala/kamon/scala/instrumentation/FutureInstrumentationSpec.scala b/kamon-scala/src/test/scala/kamon/scala/instrumentation/FutureInstrumentationSpec.scala index d70e88ae..dd16e83f 100644 --- a/kamon-scala/src/test/scala/kamon/scala/instrumentation/FutureInstrumentationSpec.scala +++ b/kamon-scala/src/test/scala/kamon/scala/instrumentation/FutureInstrumentationSpec.scala @@ -16,7 +16,7 @@ package kamon.scala.instrumentation import kamon.testkit.BaseKamonSpec -import kamon.trace.TraceContext +import kamon.trace.Tracer import org.scalatest.OptionValues import org.scalatest.concurrent.{ PatienceConfiguration, ScalaFutures } @@ -31,10 +31,10 @@ class FutureInstrumentationSpec extends BaseKamonSpec("future-instrumentation-sp "capture the TraceContext available when created" which { "must be available when executing the future's body" in { - val (future, testTraceContext) = TraceContext.withContext(newContext("future-body")) { - val future = Future(TraceContext.currentContext) + val (future, testTraceContext) = Tracer.withContext(newContext("future-body")) { + val future = Future(Tracer.currentContext) - (future, TraceContext.currentContext) + (future, Tracer.currentContext) } whenReady(future)(ctxInFuture ⇒ @@ -43,14 +43,14 @@ class FutureInstrumentationSpec extends BaseKamonSpec("future-instrumentation-sp "must be available when executing callbacks on the future" in { - val (future, testTraceContext) = TraceContext.withContext(newContext("future-body")) { + val (future, testTraceContext) = Tracer.withContext(newContext("future-body")) { val future = Future("Hello Kamon!") // The TraceContext is expected to be available during all intermediate processing. .map(_.length) .flatMap(len ⇒ Future(len.toString)) - .map(s ⇒ TraceContext.currentContext) + .map(s ⇒ Tracer.currentContext) - (future, TraceContext.currentContext) + (future, Tracer.currentContext) } whenReady(future)(ctxInFuture ⇒ diff --git a/kamon-scala/src/test/scala/kamon/scalaz/instrumentation/FutureInstrumentationSpec.scala b/kamon-scala/src/test/scala/kamon/scalaz/instrumentation/FutureInstrumentationSpec.scala index ba8fa18c..c533fd62 100644 --- a/kamon-scala/src/test/scala/kamon/scalaz/instrumentation/FutureInstrumentationSpec.scala +++ b/kamon-scala/src/test/scala/kamon/scalaz/instrumentation/FutureInstrumentationSpec.scala @@ -18,7 +18,7 @@ package kamon.scalaz.instrumentation import java.util.concurrent.Executors import kamon.testkit.BaseKamonSpec -import kamon.trace.TraceContext +import kamon.trace.Tracer import org.scalatest.OptionValues import org.scalatest.concurrent.{ PatienceConfiguration, ScalaFutures } @@ -33,10 +33,10 @@ class FutureInstrumentationSpec extends BaseKamonSpec("future-instrumentation-sp "capture the TraceContext available when created" which { "must be available when executing the future's body" in { - val (future, testTraceContext) = TraceContext.withContext(newContext("future-body")) { - val future = Future(TraceContext.currentContext).start + val (future, testTraceContext) = Tracer.withContext(newContext("future-body")) { + val future = Future(Tracer.currentContext).start - (future, TraceContext.currentContext) + (future, Tracer.currentContext) } val ctxInFuture = future.run @@ -45,14 +45,14 @@ class FutureInstrumentationSpec extends BaseKamonSpec("future-instrumentation-sp "must be available when executing callbacks on the future" in { - val (future, testTraceContext) = TraceContext.withContext(newContext("future-body")) { + val (future, testTraceContext) = Tracer.withContext(newContext("future-body")) { val future = Future("Hello Kamon!") // The TraceContext is expected to be available during all intermediate processing. .map(_.length) .flatMap(len ⇒ Future(len.toString)) - .map(s ⇒ TraceContext.currentContext) + .map(s ⇒ Tracer.currentContext) - (future.start, TraceContext.currentContext) + (future.start, Tracer.currentContext) } val ctxInFuture = future.run |