Package brave.opentracing
Class BraveSpanContext
java.lang.Object
brave.opentracing.BraveSpanContext
- All Implemented Interfaces:
io.opentracing.SpanContext
public abstract class BraveSpanContext
extends java.lang.Object
implements io.opentracing.SpanContext
Holds the TraceContext used by the underlying Tracer, or an {link
TraceContextOrSamplingFlags extraction result if an incoming context}. An
unsampled context results in a noop span.
This type also includes hooks to integrate with the underlying Tracer. Ex
you can access the underlying trace context with unwrap()
-
Method Summary
Modifier and Type Method Description abstract java.lang.Iterable<java.util.Map.Entry<java.lang.String,java.lang.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 Details
-
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. -
baggageItems
public abstract java.lang.Iterable<java.util.Map.Entry<java.lang.String,java.lang.String>> baggageItems()Returns empty unlessBaggagePropagationis in use- Specified by:
baggageItemsin interfaceio.opentracing.SpanContext
-