diff options
author | Ivan Topolnjak <ivantopo@gmail.com> | 2014-11-09 17:13:08 +0100 |
---|---|---|
committer | Ivan Topolnjak <ivantopo@gmail.com> | 2014-11-09 18:01:45 +0100 |
commit | a736b7c2a946f9bd270dae07ecc079f307633482 (patch) | |
tree | a26ff081861a86cd1caab53c67450c031e793641 /kamon-spray/src/main/scala/spray/can/server | |
parent | f498749274bc9f25ede7221d6bd8b3f0c3822dda (diff) | |
download | Kamon-a736b7c2a946f9bd270dae07ecc079f307633482.tar.gz Kamon-a736b7c2a946f9bd270dae07ecc079f307633482.tar.bz2 Kamon-a736b7c2a946f9bd270dae07ecc079f307633482.zip |
= spray: fix a incorrect trace token mismatch warning introduced by a recent refactor
Diffstat (limited to 'kamon-spray/src/main/scala/spray/can/server')
-rw-r--r-- | kamon-spray/src/main/scala/spray/can/server/ServerRequestInstrumentation.scala | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/kamon-spray/src/main/scala/spray/can/server/ServerRequestInstrumentation.scala b/kamon-spray/src/main/scala/spray/can/server/ServerRequestInstrumentation.scala index eb25412b..66774e84 100644 --- a/kamon-spray/src/main/scala/spray/can/server/ServerRequestInstrumentation.scala +++ b/kamon-spray/src/main/scala/spray/can/server/ServerRequestInstrumentation.scala @@ -90,10 +90,12 @@ class ServerRequestInstrumentation { def verifyTraceContextConsistency(incomingTraceContext: TraceContext, storedTraceContext: TraceContext, system: ActorSystem): Unit = { def publishWarning(text: String, system: ActorSystem): Unit = - system.eventStream.publish(Warning("", classOf[ServerRequestInstrumentation], text)) + system.eventStream.publish(Warning("ServerRequestInstrumentation", classOf[ServerRequestInstrumentation], text)) - if (incomingTraceContext.nonEmpty && incomingTraceContext.token != storedTraceContext.token) - publishWarning(s"Different trace token found when trying to close a trace, original: [${storedTraceContext.token}] - incoming: [${incomingTraceContext.token}]", system) + if (incomingTraceContext.nonEmpty) { + if(incomingTraceContext.token != storedTraceContext.token) + publishWarning(s"Different trace token found when trying to close a trace, original: [${storedTraceContext.token}] - incoming: [${incomingTraceContext.token}]", system) + } else publishWarning(s"EmptyTraceContext present while closing the trace with token [${storedTraceContext.token}]", system) } |