@Singleton @Requires(beans=io.opentracing.Tracer.class) public class TraceInterceptor extends Object implements MethodInterceptor<Object,Object>
ContinueSpan and
NewSpan. Using the Open Tracing API.| Modifier and Type | Field and Description |
|---|---|
static String |
CLASS_TAG |
static String |
METHOD_TAG |
HOTSWAP, LAZY, PROXY_TARGETHIGHEST_PRECEDENCE, LOWEST_PRECEDENCE| Constructor and Description |
|---|
TraceInterceptor(io.opentracing.Tracer tracer,
ConversionService<?> conversionService)
Initialize the interceptor with tracer and conversion service.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getOrder() |
Object |
intercept(MethodInvocationContext<Object,Object> context)
Extended version of the
MethodInterceptor.intercept(InvocationContext) method that accepts a MethodInvocationContext. |
static void |
logError(io.opentracing.Span span,
Throwable e)
Logs an error to the span.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinterceptpublic static final String CLASS_TAG
public static final String METHOD_TAG
public TraceInterceptor(io.opentracing.Tracer tracer,
ConversionService<?> conversionService)
tracer - For span creation and propagation across arbitrary transportsconversionService - A service to convert from one type to anotherpublic int getOrder()
public Object intercept(MethodInvocationContext<Object,Object> context)
MethodInterceptorMethodInterceptor.intercept(InvocationContext) method that accepts a MethodInvocationContext.intercept in interface MethodInterceptor<Object,Object>context - The contextpublic static void logError(io.opentracing.Span span,
Throwable e)
span - The spane - The error