Uses of Class
brave.propagation.TraceContext
-
Packages that use TraceContext Package Description brave brave.baggage brave.handler brave.propagation -
-
Uses of TraceContext in brave
Methods in brave that return TraceContext Modifier and Type Method Description abstract TraceContext
ScopedSpan. context()
Returns the trace context associated with this spanabstract TraceContext
Span. context()
Methods in brave with parameters of type TraceContext Modifier and Type Method Description Clock
Tracing. clock(TraceContext context)
This exposes the microsecond clock used by operations such asSpan.finish()
.Span
Tracer. joinSpan(TraceContext context)
Joining is re-using the same trace and span ids extracted from an incoming RPC request.Span
Tracer. newChild(TraceContext parent)
Explicitly creates a child within an existing trace.<T> Span
Tracer. nextSpanWithParent(SamplerFunction<T> samplerFunction, T arg, TraceContext parent)
LikeTracer.nextSpan(SamplerFunction, Object)
except this controls the parent context explicitly.protected String
ErrorParser. parseValue(Throwable input, TraceContext context)
Deprecated.protected abstract String
Tag. parseValue(I input, TraceContext context)
Override to change what data from the input are parsed into the span modeling it.ScopedSpan
Tracer. startScopedSpanWithParent(String name, TraceContext parent)
Same asTracer.startScopedSpan(String)
, except ignores the current trace context.void
Tag. tag(I input, TraceContext context, MutableSpan span)
Tags the value parsed from theinput
.void
Tag. tag(I input, TraceContext context, SpanCustomizer span)
Tags the value parsed from theinput
.Span
Tracer. toSpan(TraceContext context)
Converts the context to a Span object after decorating it for propagation.String
Tag. value(I input, TraceContext context)
Returns the value that would be tagged to the span ornull
. -
Uses of TraceContext in brave.baggage
Methods in brave.baggage with parameters of type TraceContext Modifier and Type Method Description static List<BaggageField>
BaggageField. getAll(TraceContext context)
Deprecated.Since 5.12 useBaggageField.getAllValues(TraceContext)
static Map<String,String>
BaggageField. getAllValues(TraceContext context)
static BaggageField
BaggageField. getByName(TraceContext context, String name)
Looks up the field byname
, useful for when you do not have a reference to it.String
BaggageField. getValue(TraceContext context)
Returns the most recent value for this field in the context or null if unavailable.boolean
BaggageField. updateValue(TraceContext context, String value)
Updates the value of this field, or ignores if read-only or not configured. -
Uses of TraceContext in brave.handler
Methods in brave.handler with parameters of type TraceContext Modifier and Type Method Description boolean
SpanHandler. begin(TraceContext context, MutableSpan span, TraceContext parent)
This is called when a span is sampled, but before it is started.boolean
FinishedSpanHandler. end(TraceContext context, MutableSpan span, SpanHandler.Cause cause)
Deprecated.boolean
SpanHandler. end(TraceContext context, MutableSpan span, SpanHandler.Cause cause)
Called when data collection complete.abstract boolean
FinishedSpanHandler. handle(TraceContext context, MutableSpan span)
Deprecated.Since 5.12 useSpanHandler.end(TraceContext, MutableSpan, Cause)
withSpanHandler.Cause.FINISHED
Constructors in brave.handler with parameters of type TraceContext Constructor Description MutableSpan(TraceContext context, MutableSpan defaults)
Creates a new instance from the given context, and defaults in the span. -
Uses of TraceContext in brave.propagation
Methods in brave.propagation that return TraceContext Modifier and Type Method Description TraceContext
TraceContext.Builder. build()
TraceContext
TraceContextOrSamplingFlags. context()
TraceContext
ExtraFieldPropagation.Factory. decorate(TraceContext context)
Deprecated.TraceContext
Propagation.Factory. decorate(TraceContext context)
Decorates the input such that it can propagate extra state, such as a timestamp or baggage.abstract TraceContext
CurrentTraceContext. get()
Returns the current span in scope or null if there isn't one.TraceContext
StrictCurrentTraceContext. get()
TraceContext
ThreadLocalCurrentTraceContext. get()
Methods in brave.propagation with parameters of type TraceContext Modifier and Type Method Description TraceContextOrSamplingFlags.Builder
TraceContextOrSamplingFlags.Builder. context(TraceContext context)
Deprecated.Since 5.12, useTraceContextOrSamplingFlags.newBuilder(TraceIdContext)
static TraceContextOrSamplingFlags
TraceContextOrSamplingFlags. create(TraceContext context)
Used to implementTraceContext.Extractor.extract(Object)
for a format that can extract a completeTraceContext
, including a trace ID and span ID.TraceContext
ExtraFieldPropagation.Factory. decorate(TraceContext context)
Deprecated.TraceContext
Propagation.Factory. decorate(TraceContext context)
Decorates the input such that it can propagate extra state, such as a timestamp or baggage.protected CurrentTraceContext.Scope
CurrentTraceContext. decorateScope(TraceContext context, CurrentTraceContext.Scope scope)
When implementing CurrentTraceContext.newScope(TraceContext), decorate the result before returning it.CurrentTraceContext.Scope
CurrentTraceContext.ScopeDecorator. decorateScope(TraceContext context, CurrentTraceContext.Scope scope)
CurrentTraceContext.Scope
StrictScopeDecorator. decorateScope(TraceContext context, CurrentTraceContext.Scope scope)
Identifies problems by throwingIllegalStateException
when a scope is closed on a different thread.static String
ExtraFieldPropagation. get(TraceContext context, String name)
Deprecated.Since 5.11 useBaggageField.getByName(TraceContext, String)
andBaggageField.getValue(TraceContext)
static Map<String,String>
ExtraFieldPropagation. getAll(TraceContext context)
Deprecated.Since 5.11 useBaggageField.getAll(TraceContext)
void
TraceContext.Injector. inject(TraceContext traceContext, R request)
Usually calls a setter for each propagation field to send downstream.CurrentTraceContext.Scope
CurrentTraceContext. maybeScope(TraceContext context)
LikeCurrentTraceContext.newScope(TraceContext)
, except returnsCurrentTraceContext.Scope.NOOP
if the given context is already in scope.CurrentTraceContext.Scope
StrictCurrentTraceContext. maybeScope(TraceContext context)
static TraceContextOrSamplingFlags.Builder
TraceContextOrSamplingFlags. newBuilder(TraceContext context)
Use when implementingTraceContext.Extractor.extract(Object)
requiresTraceContextOrSamplingFlags.Builder.sampledLocal()
orTraceContextOrSamplingFlags.Builder.addExtra(Object)
.abstract CurrentTraceContext.Scope
CurrentTraceContext. newScope(TraceContext context)
Sets the current span in scope until the returned object is closed.CurrentTraceContext.Scope
StrictCurrentTraceContext. newScope(TraceContext context)
CurrentTraceContext.Scope
ThreadLocalCurrentTraceContext. newScope(TraceContext currentSpan)
static void
ExtraFieldPropagation. set(TraceContext context, String name, String value)
Deprecated.Since 5.11 useBaggageField.getByName(TraceContext, String)
andBaggageField.updateValue(String)
static String
B3SingleFormat. writeB3SingleFormat(TraceContext context)
Writes all B3 defined fields in the trace context to a hyphen delimited string.static byte[]
B3SingleFormat. writeB3SingleFormatAsBytes(TraceContext context)
LikeB3SingleFormat.writeB3SingleFormat(TraceContext)
, but for requests with byte array or byte buffer values.static String
B3SingleFormat. writeB3SingleFormatWithoutParentId(TraceContext context)
Writes all B3 defined fields in the trace context, exceptparent ID
, to a hyphen delimited string.static byte[]
B3SingleFormat. writeB3SingleFormatWithoutParentIdAsBytes(TraceContext context)
LikeB3SingleFormat.writeB3SingleFormatWithoutParentId(TraceContext)
, but for requests with byte array or byte buffer values.
-