diff options
author | Ivan Topolnjak <ivantopo@gmail.com> | 2017-08-14 23:08:14 +0200 |
---|---|---|
committer | Ivan Topolnjak <ivantopo@gmail.com> | 2017-08-14 23:08:35 +0200 |
commit | 407d74e89acdd4dff5a887c1ae5793d63e9e7a2e (patch) | |
tree | 677f0a573dfe028f31826748609e315a4bfa36dd /kamon-core/src/main/scala/kamon/trace/SpanContext.scala | |
parent | 3a8c0fa25f12230b27e943d1fffe07f814c650fe (diff) | |
download | Kamon-407d74e89acdd4dff5a887c1ae5793d63e9e7a2e.tar.gz Kamon-407d74e89acdd4dff5a887c1ae5793d63e9e7a2e.tar.bz2 Kamon-407d74e89acdd4dff5a887c1ae5793d63e9e7a2e.zip |
expose the identity provider through the Tracer
Diffstat (limited to 'kamon-core/src/main/scala/kamon/trace/SpanContext.scala')
-rw-r--r-- | kamon-core/src/main/scala/kamon/trace/SpanContext.scala | 48 |
1 files changed, 8 insertions, 40 deletions
diff --git a/kamon-core/src/main/scala/kamon/trace/SpanContext.scala b/kamon-core/src/main/scala/kamon/trace/SpanContext.scala index e8b239ba..4d013881 100644 --- a/kamon-core/src/main/scala/kamon/trace/SpanContext.scala +++ b/kamon-core/src/main/scala/kamon/trace/SpanContext.scala @@ -34,64 +34,32 @@ case class SpanContext(traceID: Identifier, spanID: Identifier, parentID: Identi object SpanContext { val EmptySpanContext = SpanContext( - traceID = IdentityProvider.NoIdentifier, - spanID = IdentityProvider.NoIdentifier, - parentID = IdentityProvider.NoIdentifier, + traceID = IdentityProvider.NoIdentifier, + spanID = IdentityProvider.NoIdentifier, + parentID = IdentityProvider.NoIdentifier, samplingDecision = SamplingDecision.DoNotSample ) sealed trait SamplingDecision + object SamplingDecision { /** - * The Trace is sampled, all child Spans should be sampled as well. + * The Trace is sampled, all child Spans should be sampled as well. */ case object Sample extends SamplingDecision /** - * The Trace is not sampled, none of the child Spans should be sampled. + * The Trace is not sampled, none of the child Spans should be sampled. */ case object DoNotSample extends SamplingDecision /** - * The sampling decision has not been taken yet, the Tracer is free to decide when creating a Span. + * The sampling decision has not been taken yet, the Tracer is free to decide when creating a Span. */ case object Unknown extends SamplingDecision - } - - /** - * - */ - sealed trait Baggage { - def add(key: String, value:String): Unit - def get(key: String): Option[String] - def getAll(): Map[String, String] } - object Baggage { - def apply(): Baggage = new DefaultBaggage() - - case object EmptyBaggage extends Baggage { - override def add(key: String, value: String): Unit = {} - override def get(key: String): Option[String] = None - override def getAll: Map[String, String] = Map.empty - } - - - final class DefaultBaggage extends Baggage { - private var baggage: Map[String, String] = Map.empty - - def add(key: String, value: String): Unit = synchronized { - baggage = baggage + (key -> value) - } - - def get(key: String): Option[String] = - baggage.get(key) - - def getAll: Map[String, String] = - baggage - } - } -} +}
\ No newline at end of file |