aboutsummaryrefslogtreecommitdiff
path: root/kamon-core/src/main/scala/kamon/util
diff options
context:
space:
mode:
authorIvan Topolnjak <ivantopo@gmail.com>2017-07-25 16:21:13 +0200
committerIvan Topolnjak <ivantopo@gmail.com>2017-07-25 16:21:13 +0200
commit0930e36def6ce62c55d30d744b41ef475374a541 (patch)
treeb3699d8932608ad48cdc8e91a16b0d5ee7541e4d /kamon-core/src/main/scala/kamon/util
parent5c8a8d169858b83a059c89e48cb43a41040788b8 (diff)
downloadKamon-0930e36def6ce62c55d30d744b41ef475374a541.tar.gz
Kamon-0930e36def6ce62c55d30d744b41ef475374a541.tar.bz2
Kamon-0930e36def6ce62c55d30d744b41ef475374a541.zip
try an alternative approach to active span management
Diffstat (limited to 'kamon-core/src/main/scala/kamon/util')
-rw-r--r--kamon-core/src/main/scala/kamon/util/Mixin.scala29
1 files changed, 15 insertions, 14 deletions
diff --git a/kamon-core/src/main/scala/kamon/util/Mixin.scala b/kamon-core/src/main/scala/kamon/util/Mixin.scala
index 318679c1..2fd7be24 100644
--- a/kamon-core/src/main/scala/kamon/util/Mixin.scala
+++ b/kamon-core/src/main/scala/kamon/util/Mixin.scala
@@ -16,30 +16,31 @@
package kamon
package util
-import kamon.trace.{ActiveSpan, Continuation}
+import kamon.trace.Span
/**
- * Utility trait that marks objects carrying an ActiveSpan.Continuation.
+ * Utility trait that marks objects carrying a reference to a Span.
+ *
*/
-trait HasContinuation {
- def continuation: Continuation
+trait HasSpan {
+ def span: Span
}
-object HasContinuation {
- private class Default(val continuation: Continuation) extends HasContinuation
+object HasSpan {
+ private case class Default(span: Span) extends HasSpan
/**
- * Construct a HasContinuation instance by capturing a continuation from the provided active span.
+ * Construct a HasSpan instance that references the provided Span.
+ *
*/
- def from(activeSpan: ActiveSpan): HasContinuation = {
- val continuation = if(activeSpan == null) null else activeSpan.capture()
- new Default(continuation)
- }
+ def from(span: Span): HasSpan =
+ Default(span)
/**
- * Constructs a new HasContinuation instance using Kamon's tracer currently active span.
+ * Construct a HasSpan instance that references the currently ActiveSpan in Kamon's tracer.
+ *
*/
- def fromTracerActiveSpan(): HasContinuation =
- new Default(Kamon.activeSpanContinuation())
+ def fromActiveSpan(): HasSpan =
+ Default(Kamon.activeSpan())
}