Class AbstractOpenTelemetryTraceInterceptor

java.lang.Object
io.micronaut.tracing.opentelemetry.interceptor.AbstractOpenTelemetryTraceInterceptor
All Implemented Interfaces:
io.micronaut.aop.Interceptor<Object,Object>, io.micronaut.aop.MethodInterceptor<Object,Object>, io.micronaut.core.order.Ordered
Direct Known Subclasses:
ContinueSpanOpenTelemetryTraceInterceptor, NewSpanOpenTelemetryTraceInterceptor

public abstract sealed class AbstractOpenTelemetryTraceInterceptor extends Object implements io.micronaut.aop.MethodInterceptor<Object,Object> permits ContinueSpanOpenTelemetryTraceInterceptor, NewSpanOpenTelemetryTraceInterceptor
Implements tracing logic for ContinueSpan and NewSpan using the Open Telemetry API.
Since:
4.2.0
Author:
Nemanja Mikic
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final io.opentelemetry.instrumentation.api.instrumenter.Instrumenter<io.opentelemetry.instrumentation.api.instrumenter.util.ClassAndMethod,Object>
     

    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

    Constructors
    Modifier
    Constructor
    Description
    protected
    AbstractOpenTelemetryTraceInterceptor(io.opentelemetry.instrumentation.api.instrumenter.Instrumenter<io.opentelemetry.instrumentation.api.instrumenter.util.ClassAndMethod,Object> instrumenter)
    Initialize the interceptor with tracer and conversion service.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
     
    static void
    tagArguments(io.micronaut.aop.MethodInvocationContext<?,?> 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

    • instrumenter

      protected final io.opentelemetry.instrumentation.api.instrumenter.Instrumenter<io.opentelemetry.instrumentation.api.instrumenter.util.ClassAndMethod,Object> instrumenter
  • Constructor Details

    • AbstractOpenTelemetryTraceInterceptor

      protected AbstractOpenTelemetryTraceInterceptor(@Named("micronautCodeTelemetryInstrumenter") io.opentelemetry.instrumentation.api.instrumenter.Instrumenter<io.opentelemetry.instrumentation.api.instrumenter.util.ClassAndMethod,Object> instrumenter)
      Initialize the interceptor with tracer and conversion service.
      Parameters:
      instrumenter - the ClassAndMethod Instrumenter
  • Method Details

    • getOrder

      public int getOrder()
      Specified by:
      getOrder in interface io.micronaut.core.order.Ordered
    • tagArguments

      public static void tagArguments(io.micronaut.aop.MethodInvocationContext<?,?> context)