diff options
Diffstat (limited to 'kamon-core/src')
-rw-r--r-- | kamon-core/src/main/scala/kamon/context/Mixin.scala | 6 | ||||
-rw-r--r-- | kamon-core/src/main/scala/kamon/trace/Tracer.scala | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/kamon-core/src/main/scala/kamon/context/Mixin.scala b/kamon-core/src/main/scala/kamon/context/Mixin.scala index 64e03748..3445cc31 100644 --- a/kamon-core/src/main/scala/kamon/context/Mixin.scala +++ b/kamon-core/src/main/scala/kamon/context/Mixin.scala @@ -19,7 +19,7 @@ import kamon.Kamon /** - * Utility trait that marks objects carrying a reference to a Span. + * Utility trait that marks objects carrying a reference to a Context instance. * */ trait HasContext { @@ -30,14 +30,14 @@ object HasContext { private case class Default(context: Context) extends HasContext /** - * Construct a HasSpan instance that references the provided Span. + * Construct a HasSpan instance that references the provided Context. * */ def from(context: Context): HasContext = Default(context) /** - * Construct a HasSpan instance that references the currently ActiveSpan in Kamon's tracer. + * Construct a HasContext instance with the current Kamon from Kamon's default context storage. * */ def fromCurrentContext(): HasContext = diff --git a/kamon-core/src/main/scala/kamon/trace/Tracer.scala b/kamon-core/src/main/scala/kamon/trace/Tracer.scala index 84cb1899..f2f1918c 100644 --- a/kamon-core/src/main/scala/kamon/trace/Tracer.scala +++ b/kamon-core/src/main/scala/kamon/trace/Tracer.scala @@ -93,7 +93,7 @@ object Tracer { private var startTimestamp = 0L private var initialSpanTags = Map.empty[String, Span.TagValue] private var initialMetricTags = Map.empty[String, String] - private var useActiveSpanAsParent = true + private var useParentFromContext = true def asChildOf(parent: Span): SpanBuilder = { if(parent != Span.Empty) this.parentSpan = parent @@ -132,8 +132,8 @@ object Tracer { this } - def ignoreActiveSpan(): SpanBuilder = { - this.useActiveSpanAsParent = false + def ignoreParentFromContext(): SpanBuilder = { + this.useParentFromContext = false this } @@ -141,7 +141,7 @@ object Tracer { val startTimestampMicros = if(startTimestamp != 0L) startTimestamp else Clock.microTimestamp() val parentSpan: Option[Span] = Option(this.parentSpan) - .orElse(if(useActiveSpanAsParent) Some(Kamon.currentContext().get(Span.ContextKey)) else None) + .orElse(if(useParentFromContext) Some(Kamon.currentContext().get(Span.ContextKey)) else None) .filter(span => span != Span.Empty) val nonRemoteParent = parentSpan.filter(s => s.isLocal() && s.nonEmpty()) |