aboutsummaryrefslogtreecommitdiff
path: root/kamon-core/src/main/scala/kamon/trace/SpanContext.scala
diff options
context:
space:
mode:
Diffstat (limited to 'kamon-core/src/main/scala/kamon/trace/SpanContext.scala')
-rw-r--r--kamon-core/src/main/scala/kamon/trace/SpanContext.scala48
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