public final class TracingContext extends Object
This class is mutable, to support chains of tracing filters that create additional spans and that need to update the parent span of this context.
| Modifier and Type | Method and Description |
|---|---|
static TracingContext |
create(Tracer tracer,
Map<String,List<String>> inboundHeaders)
Create a new tracing context with client tracing enabled.
|
static TracingContext |
create(Tracer tracer,
Map<String,List<String>> inboundHeaders,
boolean clientEnabled)
Create a new tracing context.
|
Map<String,List<String>> |
inboundHeaders()
Map of headers that were received by server for an inbound call,
may be used to propagate additional headers fro outbound request.
|
SpanContext |
parentSpan()
Parent span to use for new spans created.
|
void |
parentSpan(SpanContext context)
Update the parent span - this may be used by filters that inject
a new span between to original parent and the outbound call.
|
boolean |
traceClient()
Whether client (outbound) calls should be traced.
|
Tracer |
tracer()
Tracer to be used when creating new spans.
|
public static TracingContext create(Tracer tracer, Map<String,List<String>> inboundHeaders)
tracer - tracer to useinboundHeaders - inbound header to be used for context propagationparentSpan(SpanContext)public static TracingContext create(Tracer tracer, Map<String,List<String>> inboundHeaders, boolean clientEnabled)
tracer - tracer to useinboundHeaders - inbound header to be used for context propagationclientEnabled - whether client tracing should be enabled or notparentSpan(SpanContext)public boolean traceClient()
true if tracing is enabled for client callspublic SpanContext parentSpan()
public Tracer tracer()
public Map<String,List<String>> inboundHeaders()
public void parentSpan(SpanContext context)
context - new parent span contextCopyright © 2018–2019 Oracle Corporation. All rights reserved.