public class OpentracingClientFilter extends java.lang.Object implements ClientRequestFilter, ClientResponseFilter
In order to inject the tracing information properly, Tracer and an optional parent SpanContext
needs to be resolved. The Tracer gets resolved in following order
TRACER_PROPERTY_NAMEServerConfiguration.tracer() referenced by property SERVER_REQUEST_PROPERTY_NAME where
an instance of ServerRequest is expectedGlobalTracer.get()SpanContext as a parent span is resolved as follows
CURRENT_SPAN_CONTEXT_PROPERTY_NAMEServerRequest.spanContext() ()} referenced by property SERVER_REQUEST_PROPERTY_NAME where
an instance of ServerRequest is expectedSpan with operation name jersey-client-call is created based on the
resolved Tracer and an optional parent Span.
If Tracer doesn't get resolved, a warning is logged.
Opentraceable| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CURRENT_SPAN_CONTEXT_PROPERTY_NAME
The
SpanContext reference property name. |
static java.lang.String |
SERVER_REQUEST_PROPERTY_NAME
The
ServerRequest reference property name. |
static java.lang.String |
TRACER_PROPERTY_NAME
The
Tracer property reference name. |
| Constructor and Description |
|---|
OpentracingClientFilter() |
| Modifier and Type | Method and Description |
|---|---|
void |
filter(ClientRequestContext requestContext) |
void |
filter(ClientRequestContext requestContext,
ClientResponseContext responseContext) |
public static final java.lang.String SERVER_REQUEST_PROPERTY_NAME
ServerRequest reference property name.public static final java.lang.String TRACER_PROPERTY_NAME
Tracer property reference name.public static final java.lang.String CURRENT_SPAN_CONTEXT_PROPERTY_NAME
SpanContext reference property name.public void filter(ClientRequestContext requestContext) throws java.io.IOException
filter in interface ClientRequestFilterjava.io.IOExceptionpublic void filter(ClientRequestContext requestContext, ClientResponseContext responseContext) throws java.io.IOException
filter in interface ClientResponseFilterjava.io.IOExceptionCopyright © 2018, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.