diff options
Diffstat (limited to 'kamon-trace')
5 files changed, 9 insertions, 9 deletions
diff --git a/kamon-trace/src/main/scala/kamon/trace/Trace.scala b/kamon-trace/src/main/scala/kamon/trace/Trace.scala index fbd4ea8b..ac380cd1 100644 --- a/kamon-trace/src/main/scala/kamon/trace/Trace.scala +++ b/kamon-trace/src/main/scala/kamon/trace/Trace.scala @@ -35,7 +35,7 @@ object Trace extends ExtensionId[TraceExtension] with ExtensionIdProvider { ctx } - def withValue[T](ctx: Option[TraceContext])(thunk: => T): T = traceContext.withValue(ctx)(thunk) + def withContext[T](ctx: Option[TraceContext])(thunk: => T): T = traceContext.withValue(ctx)(thunk) def transformContext(f: TraceContext => TraceContext): Unit = { context.map(f).foreach(set(_)) diff --git a/kamon-trace/src/main/scala/kamon/trace/instrumentation/ActorMessagePassingTracing.scala b/kamon-trace/src/main/scala/kamon/trace/instrumentation/ActorMessagePassingTracing.scala index 9eb0a7f9..7c7c8b12 100644 --- a/kamon-trace/src/main/scala/kamon/trace/instrumentation/ActorMessagePassingTracing.scala +++ b/kamon-trace/src/main/scala/kamon/trace/instrumentation/ActorMessagePassingTracing.scala @@ -22,7 +22,7 @@ class BehaviourInvokeTracing { //safe cast val ctxInMessage = envelope.asInstanceOf[ContextAware].traceContext - Trace.withValue(ctxInMessage) { + Trace.withContext(ctxInMessage) { pjp.proceed() } } diff --git a/kamon-trace/src/main/scala/kamon/trace/instrumentation/FutureTracing.scala b/kamon-trace/src/main/scala/kamon/trace/instrumentation/FutureTracing.scala index 10daa2da..fe32a04c 100644 --- a/kamon-trace/src/main/scala/kamon/trace/instrumentation/FutureTracing.scala +++ b/kamon-trace/src/main/scala/kamon/trace/instrumentation/FutureTracing.scala @@ -32,7 +32,7 @@ class FutureTracing { def around(pjp: ProceedingJoinPoint, runnable: ContextAware): Any = { import pjp._ - Trace.withValue(runnable.traceContext) { + Trace.withContext(runnable.traceContext) { proceed() } } diff --git a/kamon-trace/src/test/scala/kamon/ActorMessagePassingTracingSpec.scala b/kamon-trace/src/test/scala/kamon/ActorMessagePassingTracingSpec.scala index 096ac986..0eaf96db 100644 --- a/kamon-trace/src/test/scala/kamon/ActorMessagePassingTracingSpec.scala +++ b/kamon-trace/src/test/scala/kamon/ActorMessagePassingTracingSpec.scala @@ -18,7 +18,7 @@ class ActorMessagePassingTracingSpec extends TestKit(ActorSystem("actor-message- "the message passing instrumentation" should { "propagate the TraceContext using bang" in new TraceContextEchoFixture { - Trace.withValue(testTraceContext) { + Trace.withContext(testTraceContext) { ctxEchoActor ! "test" } @@ -26,7 +26,7 @@ class ActorMessagePassingTracingSpec extends TestKit(ActorSystem("actor-message- } "propagate the TraceContext using tell" in new TraceContextEchoFixture { - Trace.withValue(testTraceContext) { + Trace.withContext(testTraceContext) { ctxEchoActor.tell("test", testActor) } @@ -35,7 +35,7 @@ class ActorMessagePassingTracingSpec extends TestKit(ActorSystem("actor-message- "propagate the TraceContext using ask" in new TraceContextEchoFixture { implicit val timeout = Timeout(1 seconds) - Trace.withValue(testTraceContext) { + Trace.withContext(testTraceContext) { // The pipe pattern use Futures internally, so FutureTracing test should cover the underpinnings of it. (ctxEchoActor ? "test") pipeTo(testActor) } @@ -44,7 +44,7 @@ class ActorMessagePassingTracingSpec extends TestKit(ActorSystem("actor-message- } "propagate the TraceContext to actors behind a router" in new RoutedTraceContextEchoFixture { - Trace.withValue(testTraceContext) { + Trace.withContext(testTraceContext) { ctxEchoActor ! "test" } diff --git a/kamon-trace/src/test/scala/kamon/FutureTracingSpec.scala b/kamon-trace/src/test/scala/kamon/FutureTracingSpec.scala index 7ff1b96d..1f31d4d2 100644 --- a/kamon-trace/src/test/scala/kamon/FutureTracingSpec.scala +++ b/kamon-trace/src/test/scala/kamon/FutureTracingSpec.scala @@ -20,7 +20,7 @@ class FutureTracingSpec extends WordSpec with Matchers with ScalaFutures with Pa "must be available when executing the future's body" in new TraceContextFixture { var future: Future[Option[TraceContext]] = _ - Trace.withValue(testTraceContext) { + Trace.withContext(testTraceContext) { future = Future(Trace.context) } @@ -32,7 +32,7 @@ class FutureTracingSpec extends WordSpec with Matchers with ScalaFutures with Pa "must be available when executing callbacks on the future" in new TraceContextFixture { var future: Future[Option[TraceContext]] = _ - Trace.withValue(testTraceContext) { + Trace.withContext(testTraceContext) { future = Future("Hello Kamon!") // The TraceContext is expected to be available during all intermediate processing. .map (_.length) |