Class ServletHelper<REQUEST,RESPONSE>

java.lang.Object
io.opentelemetry.javaagent.instrumentation.servlet.BaseServletHelper<REQUEST,RESPONSE>
io.opentelemetry.javaagent.instrumentation.servlet.ServletHelper<REQUEST,RESPONSE>

public class ServletHelper<REQUEST,RESPONSE> extends BaseServletHelper<REQUEST,RESPONSE>
  • Field Details

    • ASYNC_EXCEPTION_ATTRIBUTE

      public static final String ASYNC_EXCEPTION_ATTRIBUTE
    • CONTEXT_ATTRIBUTE

      public static final String CONTEXT_ATTRIBUTE
  • Constructor Details

  • Method Details

    • end

      public void end(ServletRequestContext<REQUEST> requestContext, REQUEST request, RESPONSE response, Throwable throwable, boolean topLevel, io.opentelemetry.context.Context context, io.opentelemetry.context.Scope scope)
    • mustEndOnHandlerMethodExit

      public boolean mustEndOnHandlerMethodExit(REQUEST request)
      Helper method to determine whether the appserver handler/servlet service/servlet filter method that started a span must also end it, even if no error was detected. Extracted as a separate method to avoid duplicating the comments on the logic behind this choice.
    • setAsyncListenerResponse

      public void setAsyncListenerResponse(REQUEST request, RESPONSE response)
      Response object must be attached to a request prior to attachAsyncListener(ServletRequestContext) being called, as otherwise in some environments it is not possible to access response from async event in listeners.
    • getAsyncListenerResponse

      public RESPONSE getAsyncListenerResponse(REQUEST request)
    • attachAsyncListener

      public void attachAsyncListener(REQUEST request)
    • isAsyncListenerAttached

      public boolean isAsyncListenerAttached(REQUEST request)
    • wrapAsyncRunnable

      public Runnable wrapAsyncRunnable(REQUEST request, Runnable runnable)
    • recordAsyncException

      public void recordAsyncException(REQUEST request, Throwable throwable)
    • getAsyncException

      public Throwable getAsyncException(REQUEST request)