Package brave.opentracing
Class BraveSpanContext
- java.lang.Object
-
- brave.opentracing.BraveSpanContext
-
- All Implemented Interfaces:
io.opentracing.SpanContext
public abstract class BraveSpanContext extends Object implements io.opentracing.SpanContext
Holds the TraceContext used by the underlying Tracer, or an {link TraceContextOrSamplingFlags extraction result if an incoming context}. Anunsampledcontext results in anoop span.This type also includes hooks to integrate with the underlying Tracer. Ex you can access the underlying trace context with
unwrap()
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract Iterable<Map.Entry<String,String>>baggageItems()Returns empty unlessBaggagePropagationis in useabstract brave.propagation.TraceContextunwrap()Returns the underlying trace context for use in Brave apis, or null if this object does not represent a span.
-
-
-
Method Detail
-
unwrap
public abstract brave.propagation.TraceContext unwrap()
Returns the underlying trace context for use in Brave apis, or null if this object does not represent a span.When a span context is returned from
BraveSpan.context(), there's no ambiguity. It represents the current span. However, a span context can be in an intermediate state when extracted from headers. In other words, unwrap might not have aTraceContextto return.Why?
Extraction from headerscan return partial info. For example, in Amazon Web Services, you may be suggested just a trace ID. In other cases, you might just inherit baggage or a sampling hint.
-
-