Class AbstractTraceInterceptor
java.lang.Object
io.micronaut.tracing.opentracing.interceptor.AbstractTraceInterceptor
- All Implemented Interfaces:
io.micronaut.aop.Interceptor<Object,
,Object> io.micronaut.aop.MethodInterceptor<Object,
,Object> io.micronaut.core.order.Ordered
- Direct Known Subclasses:
ContinueSpanInterceptor
,NewSpanTraceInterceptor
@Internal
@Requires(beans=io.opentracing.Tracer.class)
public abstract sealed class AbstractTraceInterceptor
extends Object
implements io.micronaut.aop.MethodInterceptor<Object,Object>
permits ContinueSpanInterceptor, NewSpanTraceInterceptor
Implements tracing logic for
ContinueSpan
and NewSpan
using the Open Tracing API.- Since:
- 1.0
- Author:
- graemerocher
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
protected final io.micronaut.core.convert.ConversionService
static final String
protected final io.opentracing.Tracer
Fields inherited from interface io.micronaut.aop.Interceptor
ARGUMENT, CACHEABLE_LAZY_TARGET, HOTSWAP, LAZY, PROXY_TARGET
Fields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractTraceInterceptor
(io.opentracing.Tracer tracer, io.micronaut.core.convert.ConversionService conversionService) Initialize the interceptor with tracer and conversion service. -
Method Summary
Modifier and TypeMethodDescriptionint
getOrder()
static void
Logs an error to the span.protected final void
populateTags
(io.micronaut.aop.MethodInvocationContext<Object, Object> context, io.opentracing.Span span) protected final void
tagArguments
(io.opentracing.Span span, io.micronaut.aop.MethodInvocationContext<Object, Object> context) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.aop.MethodInterceptor
intercept, intercept
-
Field Details
-
CLASS_TAG
- See Also:
-
METHOD_TAG
- See Also:
-
tracer
protected final io.opentracing.Tracer tracer -
conversionService
protected final io.micronaut.core.convert.ConversionService conversionService
-
-
Constructor Details
-
AbstractTraceInterceptor
protected AbstractTraceInterceptor(io.opentracing.Tracer tracer, io.micronaut.core.convert.ConversionService conversionService) Initialize the interceptor with tracer and conversion service.- Parameters:
tracer
- for span creation and propagation across arbitrary transportsconversionService
- theConversionService
instance
-
-
Method Details
-
getOrder
public int getOrder()- Specified by:
getOrder
in interfaceio.micronaut.core.order.Ordered
-
populateTags
-
logError
Logs an error to the span.- Parameters:
span
- the spane
- the error
-
tagArguments
-