diff options
author | Ivan Topolnjak <ivantopo@gmail.com> | 2014-12-03 17:31:53 +0100 |
---|---|---|
committer | Ivan Topolnjak <ivantopo@gmail.com> | 2014-12-03 17:31:53 +0100 |
commit | b0077e7f5571a0055b36ddd25e9440163083eb32 (patch) | |
tree | 482ed80de70569e758a452724b6f4ed2b2bc731a /kamon-core/src/main/scala/kamon/trace | |
parent | 216687a130d9f68aacc67d7fe932fb4007288291 (diff) | |
download | Kamon-b0077e7f5571a0055b36ddd25e9440163083eb32.tar.gz Kamon-b0077e7f5571a0055b36ddd25e9440163083eb32.tar.bz2 Kamon-b0077e7f5571a0055b36ddd25e9440163083eb32.zip |
= core: use MetricsOnly contexts for remote contexts
Diffstat (limited to 'kamon-core/src/main/scala/kamon/trace')
-rw-r--r-- | kamon-core/src/main/scala/kamon/trace/TraceExtension.scala | 2 | ||||
-rw-r--r-- | kamon-core/src/main/scala/kamon/trace/TraceRecorder.scala | 12 |
2 files changed, 3 insertions, 11 deletions
diff --git a/kamon-core/src/main/scala/kamon/trace/TraceExtension.scala b/kamon-core/src/main/scala/kamon/trace/TraceExtension.scala index a80a4321..e5fbb15e 100644 --- a/kamon-core/src/main/scala/kamon/trace/TraceExtension.scala +++ b/kamon-core/src/main/scala/kamon/trace/TraceExtension.scala @@ -50,7 +50,7 @@ class TraceExtension(system: ExtendedActorSystem) extends Kamon.Extension { def newTraceContext(traceName: String, token: String, isOpen: Boolean, origin: TraceContextOrigin, nanoTimestamp: Long, system: ActorSystem): TraceContext = { def newMetricsOnlyContext = new MetricsOnlyContext(traceName, token, true, detailLevel, origin, nanoTimestamp, log, metricsExtension, system) - if (detailLevel == LevelOfDetail.MetricsOnly) + if (detailLevel == LevelOfDetail.MetricsOnly || origin == TraceContextOrigin.Remote) newMetricsOnlyContext else { if (!sampler.shouldTrace) diff --git a/kamon-core/src/main/scala/kamon/trace/TraceRecorder.scala b/kamon-core/src/main/scala/kamon/trace/TraceRecorder.scala index 572d94e5..af47bf3c 100644 --- a/kamon-core/src/main/scala/kamon/trace/TraceRecorder.scala +++ b/kamon-core/src/main/scala/kamon/trace/TraceRecorder.scala @@ -40,16 +40,8 @@ object TraceRecorder { Kamon(Trace)(system).newTraceContext(name, token.getOrElse(newToken), true, TraceContextOrigin.Local, System.nanoTime(), system) def joinRemoteTraceContext(traceName: String, traceToken: String, startMilliTime: Long, isOpen: Boolean, system: ActorSystem): TraceContext = { - val equivalentNanotime = System.nanoTime() - ((System.currentTimeMillis() - startMilliTime) * 1000000) - /*new MetricsOnlyContext( - traceName, - traceToken, - isOpen, - LevelOfDetail.MetricsOnly, - TraceContextOrigin.Remote, - equivalentNanotime, - system)*/ - ??? + val equivalentNanoTime = System.nanoTime() - ((System.currentTimeMillis() - startMilliTime) * 1000000) + Kamon(Trace)(system).newTraceContext(traceName, traceToken, isOpen, TraceContextOrigin.Remote, equivalentNanoTime, system) } def setContext(context: TraceContext): Unit = traceContextStorage.set(context) |