aboutsummaryrefslogtreecommitdiff
path: root/kamon-akka-remote
diff options
context:
space:
mode:
authorIvan Topolnjak <ivantopo@gmail.com>2015-04-17 19:11:41 +0200
committerIvan Topolnjak <ivantopo@gmail.com>2015-04-17 19:11:41 +0200
commiteb07f2f0b583c759e9cfaba27e3bcddeaf05a4cf (patch)
tree57784857799de642dcd76be931027cf04cb56f67 /kamon-akka-remote
parent2731db2910827f0bf22484d0e5603788795b69f9 (diff)
downloadKamon-eb07f2f0b583c759e9cfaba27e3bcddeaf05a4cf.tar.gz
Kamon-eb07f2f0b583c759e9cfaba27e3bcddeaf05a4cf.tar.bz2
Kamon-eb07f2f0b583c759e9cfaba27e3bcddeaf05a4cf.zip
= core: add commodity trace context manipulation methods to the Tracer.
Diffstat (limited to 'kamon-akka-remote')
-rw-r--r--kamon-akka-remote/src/main/scala/kamon/akka/instrumentation/RemotingInstrumentation.scala2
-rw-r--r--kamon-akka-remote/src/test/scala/kamon/akka/instrumentation/RemotingInstrumentationSpec.scala12
2 files changed, 7 insertions, 7 deletions
diff --git a/kamon-akka-remote/src/main/scala/kamon/akka/instrumentation/RemotingInstrumentation.scala b/kamon-akka-remote/src/main/scala/kamon/akka/instrumentation/RemotingInstrumentation.scala
index 50fbc815..7564cfd0 100644
--- a/kamon-akka-remote/src/main/scala/kamon/akka/instrumentation/RemotingInstrumentation.scala
+++ b/kamon-akka-remote/src/main/scala/kamon/akka/instrumentation/RemotingInstrumentation.scala
@@ -88,7 +88,7 @@ class RemotingInstrumentation {
val ctx = tracer.newContext(
remoteTraceContext.getTraceName,
- remoteTraceContext.getTraceToken,
+ Option(remoteTraceContext.getTraceToken),
new MilliTimestamp(remoteTraceContext.getStartMilliTime()).toRelativeNanoTimestamp,
remoteTraceContext.getIsOpen,
isLocal = false)
diff --git a/kamon-akka-remote/src/test/scala/kamon/akka/instrumentation/RemotingInstrumentationSpec.scala b/kamon-akka-remote/src/test/scala/kamon/akka/instrumentation/RemotingInstrumentationSpec.scala
index d8535ff8..e63e06ef 100644
--- a/kamon-akka-remote/src/test/scala/kamon/akka/instrumentation/RemotingInstrumentationSpec.scala
+++ b/kamon-akka-remote/src/test/scala/kamon/akka/instrumentation/RemotingInstrumentationSpec.scala
@@ -61,7 +61,7 @@ class RemotingInstrumentationSpec extends TestKitBase with WordSpecLike with Mat
"The Remoting instrumentation" should {
"propagate the TraceContext when creating a new remote actor" in {
- Tracer.withContext(tracer.newContext("deploy-remote-actor", "deploy-remote-actor-1")) {
+ Tracer.withContext(tracer.newContext("deploy-remote-actor", Some("deploy-remote-actor-1"))) {
system.actorOf(TraceTokenReplier.remoteProps(Some(testActor), RemoteSystemAddress), "remote-deploy-fixture")
}
@@ -71,7 +71,7 @@ class RemotingInstrumentationSpec extends TestKitBase with WordSpecLike with Mat
"propagate the TraceContext when sending a message to a remotely deployed actor" in {
val remoteRef = system.actorOf(TraceTokenReplier.remoteProps(None, RemoteSystemAddress), "remote-message-fixture")
- Tracer.withContext(tracer.newContext("message-remote-actor", "message-remote-actor-1")) {
+ Tracer.withContext(tracer.newContext("message-remote-actor", Some("message-remote-actor-1"))) {
remoteRef ! "reply-trace-token"
}
@@ -83,7 +83,7 @@ class RemotingInstrumentationSpec extends TestKitBase with WordSpecLike with Mat
implicit val askTimeout = Timeout(10 seconds)
val remoteRef = system.actorOf(TraceTokenReplier.remoteProps(None, RemoteSystemAddress), "remote-ask-and-pipe-fixture")
- Tracer.withContext(tracer.newContext("ask-and-pipe-remote-actor", "ask-and-pipe-remote-actor-1")) {
+ Tracer.withContext(tracer.newContext("ask-and-pipe-remote-actor", Some("ask-and-pipe-remote-actor-1"))) {
(remoteRef ? "reply-trace-token") pipeTo (testActor)
}
@@ -95,7 +95,7 @@ class RemotingInstrumentationSpec extends TestKitBase with WordSpecLike with Mat
remoteSystem.actorOf(TraceTokenReplier.props(None), "actor-selection-target-b")
val selection = system.actorSelection(RemoteSystemAddress + "/user/actor-selection-target-*")
- Tracer.withContext(tracer.newContext("message-remote-actor-selection", "message-remote-actor-selection-1")) {
+ Tracer.withContext(tracer.newContext("message-remote-actor-selection", Some("message-remote-actor-selection-1"))) {
selection ! "reply-trace-token"
}
@@ -107,7 +107,7 @@ class RemotingInstrumentationSpec extends TestKitBase with WordSpecLike with Mat
"propagate the TraceContext a remotely supervised child fails" in {
val supervisor = system.actorOf(Props(new SupervisorOfRemote(testActor, RemoteSystemAddress)))
- Tracer.withContext(tracer.newContext("remote-supervision", "remote-supervision-1")) {
+ Tracer.withContext(tracer.newContext("remote-supervision", Some("remote-supervision-1"))) {
supervisor ! "fail"
}
@@ -118,7 +118,7 @@ class RemotingInstrumentationSpec extends TestKitBase with WordSpecLike with Mat
remoteSystem.actorOf(TraceTokenReplier.props(None), "remote-routee")
val router = system.actorOf(RoundRobinGroup(List(RemoteSystemAddress + "/user/actor-selection-target-*")).props(), "router")
- Tracer.withContext(tracer.newContext("remote-routee", "remote-routee-1")) {
+ Tracer.withContext(tracer.newContext("remote-routee", Some("remote-routee-1"))) {
router ! "reply-trace-token"
}