Class ServletHttpServerTracer<REQUEST,​RESPONSE>


  • public abstract class ServletHttpServerTracer<REQUEST,​RESPONSE>
    extends io.opentelemetry.instrumentation.api.tracer.HttpServerTracer<REQUEST,​RESPONSE,​REQUEST,​REQUEST>
    • Field Detail

      • ASYNC_LISTENER_ATTRIBUTE

        public static final String ASYNC_LISTENER_ATTRIBUTE
      • ASYNC_LISTENER_RESPONSE_ATTRIBUTE

        public static final String ASYNC_LISTENER_RESPONSE_ATTRIBUTE
    • Method Detail

      • startSpan

        public io.opentelemetry.context.Context startSpan​(REQUEST request,
                                                          String spanName,
                                                          boolean servlet)
      • customizeContext

        protected io.opentelemetry.context.Context customizeContext​(io.opentelemetry.context.Context context,
                                                                    REQUEST request)
        Overrides:
        customizeContext in class io.opentelemetry.instrumentation.api.tracer.HttpServerTracer<REQUEST,​RESPONSE,​REQUEST,​REQUEST>
      • endExceptionally

        public void endExceptionally​(io.opentelemetry.context.Context context,
                                     Throwable throwable,
                                     RESPONSE response,
                                     long timestamp)
        Overrides:
        endExceptionally in class io.opentelemetry.instrumentation.api.tracer.HttpServerTracer<REQUEST,​RESPONSE,​REQUEST,​REQUEST>
      • getServerContext

        public io.opentelemetry.context.Context getServerContext​(REQUEST request)
        Specified by:
        getServerContext in class io.opentelemetry.instrumentation.api.tracer.HttpServerTracer<REQUEST,​RESPONSE,​REQUEST,​REQUEST>
      • attachServerContext

        protected void attachServerContext​(io.opentelemetry.context.Context context,
                                           REQUEST request)
        Specified by:
        attachServerContext in class io.opentelemetry.instrumentation.api.tracer.HttpServerTracer<REQUEST,​RESPONSE,​REQUEST,​REQUEST>
      • responseStatus

        protected int responseStatus​(RESPONSE response)
        Specified by:
        responseStatus in class io.opentelemetry.instrumentation.api.tracer.HttpServerTracer<REQUEST,​RESPONSE,​REQUEST,​REQUEST>
      • getGetter

        protected abstract io.opentelemetry.context.propagation.TextMapGetter<REQUEST> getGetter()
        Specified by:
        getGetter in class io.opentelemetry.instrumentation.api.tracer.HttpServerTracer<REQUEST,​RESPONSE,​REQUEST,​REQUEST>
      • setAsyncListenerResponse

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

        public void attachAsyncListener​(REQUEST request)
      • isAsyncListenerAttached

        public boolean isAsyncListenerAttached​(REQUEST request)
      • addUnwrappedThrowable

        public void addUnwrappedThrowable​(io.opentelemetry.context.Context context,
                                          Throwable throwable)
      • unwrapThrowable

        protected Throwable unwrapThrowable​(Throwable throwable)
        Overrides:
        unwrapThrowable in class io.opentelemetry.instrumentation.api.tracer.BaseTracer
      • setPrincipal

        public void setPrincipal​(io.opentelemetry.context.Context context,
                                 REQUEST request)
      • errorExceptionAttributeName

        protected abstract String errorExceptionAttributeName()
      • updateContext

        public io.opentelemetry.context.Context updateContext​(io.opentelemetry.context.Context context,
                                                              REQUEST request)
        When server spans are managed by app server instrumentation we need to add context path of current request to context if it isn't already added. Servlet instrumentation adds it when it starts server span.
      • updateSpanName

        public void updateSpanName​(REQUEST request)
      • onTimeout

        public void onTimeout​(io.opentelemetry.context.Context context,
                              long timeout)
      • needsRescoping

        public boolean needsRescoping​(io.opentelemetry.context.Context attachedContext)