summaryrefslogtreecommitdiff
path: root/vendor/opentracing/opentracing/src/OpenTracing/SpanContext.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/opentracing/opentracing/src/OpenTracing/SpanContext.php')
-rw-r--r--vendor/opentracing/opentracing/src/OpenTracing/SpanContext.php37
1 files changed, 37 insertions, 0 deletions
diff --git a/vendor/opentracing/opentracing/src/OpenTracing/SpanContext.php b/vendor/opentracing/opentracing/src/OpenTracing/SpanContext.php
new file mode 100644
index 000000000..ca05ff9ac
--- /dev/null
+++ b/vendor/opentracing/opentracing/src/OpenTracing/SpanContext.php
@@ -0,0 +1,37 @@
+<?php
+
+declare(strict_types=1);
+
+namespace OpenTracing;
+
+use IteratorAggregate;
+
+/**
+ * SpanContext must be immutable in order to avoid complicated lifetime
+ * issues around Span finish and references.
+ *
+ * Baggage items are key => value string pairs that apply to the given Span,
+ * its SpanContext, and all Spans which directly or transitively reference
+ * the local Span. That is, baggage items propagate in-band along with the
+ * trace itself.
+ */
+interface SpanContext extends IteratorAggregate
+{
+ /**
+ * Returns the value of a baggage item based on its key. If there is no
+ * value with such key it will return null.
+ *
+ * @param string $key
+ * @return string|null
+ */
+ public function getBaggageItem(string $key): ?string;
+
+ /**
+ * Creates a new SpanContext out of the existing one and the new key => value pair.
+ *
+ * @param string $key
+ * @param string $value
+ * @return SpanContext
+ */
+ public function withBaggageItem(string $key, string $value): SpanContext;
+}