Class TracingContext
java.lang.Object
io.helidon.tracing.jersey.client.internal.TracingContext
Context for outbound tracing.
This is an internal API used from jersey integration
with Tracing (currently MP tracing), to share a ThreadLocal instance.
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.
-
Method Summary
Modifier and TypeMethodDescriptionstatic TracingContextCreate a new tracing context with client tracing enabled.static TracingContextCreate a new tracing context.Map of headers that were received by server for an inbound call, may be used to propagate additional headers fro outbound request.Parent span to use for new spans created.voidparentSpan(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.booleanWhether client (outbound) calls should be traced.tracer()Tracer to be used when creating new spans.
-
Method Details
-
create
Create a new tracing context with client tracing enabled.- Parameters:
tracer- tracer to useinboundHeaders- inbound header to be used for context propagation- Returns:
- a new tracing context (not associated with current thread)
- See Also:
-
create
public static TracingContext create(Tracer tracer, Map<String, List<String>> inboundHeaders, boolean clientEnabled) Create a new tracing context.- Parameters:
tracer- tracer to useinboundHeaders- inbound header to be used for context propagationclientEnabled- whether client tracing should be enabled or not- Returns:
- a new tracing context (not associated with current thread)
- See Also:
-
traceClient
public boolean traceClient()Whether client (outbound) calls should be traced.- Returns:
trueif tracing is enabled for client calls
-
parentSpan
Parent span to use for new spans created.- Returns:
- span context to act as a parent for newly created spans
-
tracer
Tracer to be used when creating new spans.- Returns:
- tracer to use
-
inboundHeaders
Map of headers that were received by server for an inbound call, may be used to propagate additional headers fro outbound request.- Returns:
- map of inbound headers
-
parentSpan
Update the parent span - this may be used by filters that inject a new span between to original parent and the outbound call.- Parameters:
context- new parent span context
-