@Singleton
@Requires(beans=io.opentracing.Tracer.class)
public class TraceInterceptor
extends java.lang.Object
implements io.micronaut.aop.MethodInterceptor<java.lang.Object,java.lang.Object>
ContinueSpan
and NewSpan
using the Open Tracing API.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_TAG |
static java.lang.String |
METHOD_TAG |
Constructor and Description |
---|
TraceInterceptor(io.opentracing.Tracer tracer)
Initialize the interceptor with tracer and conversion service.
|
Modifier and Type | Method and Description |
---|---|
int |
getOrder() |
java.lang.Object |
intercept(io.micronaut.aop.MethodInvocationContext<java.lang.Object,java.lang.Object> context) |
static void |
logError(io.opentracing.Span span,
java.lang.Throwable e)
Logs an error to the span.
|
public static final java.lang.String CLASS_TAG
public static final java.lang.String METHOD_TAG
public TraceInterceptor(io.opentracing.Tracer tracer)
tracer
- for span creation and propagation across arbitrary transportspublic int getOrder()
getOrder
in interface io.micronaut.core.order.Ordered
@Nullable public java.lang.Object intercept(io.micronaut.aop.MethodInvocationContext<java.lang.Object,java.lang.Object> context)
intercept
in interface io.micronaut.aop.MethodInterceptor<java.lang.Object,java.lang.Object>
public static void logError(io.opentracing.Span span, java.lang.Throwable e)
span
- the spane
- the error