Class AppServerBridge
java.lang.Object
io.opentelemetry.javaagent.bootstrap.servlet.AppServerBridge
Helper container for Context attributes for transferring certain information between servlet
integration and app-server server handler integrations.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancaptureServletAttributes(io.opentelemetry.context.Context context) Test whether servlet attributes should be captured.static Class<?>Class used as key in CallDepthThreadLocalMap for counting servlet invocation depth in Servlet3Advice and Servlet2Advice.static ThrowablegetException(io.opentelemetry.context.Context context) Get exception that happened during servlet invocation.static voidrecordException(io.opentelemetry.context.Context context, Throwable exception) Record exception that happened during servlet invocation so that app server instrumentation can add it to server span.
-
Method Details
-
recordException
Record exception that happened during servlet invocation so that app server instrumentation can add it to server span.- Parameters:
context- server contextexception- exception that happened during servlet invocation
-
getException
Get exception that happened during servlet invocation.- Parameters:
context- server context- Returns:
- exception that happened during servlet invocation
-
captureServletAttributes
public static boolean captureServletAttributes(io.opentelemetry.context.Context context) Test whether servlet attributes should be captured. This method will return true only on the first call with given context.- Parameters:
context- server context- Returns:
- true when servlet attributes should be captured
-
getCallDepthKey
Class used as key in CallDepthThreadLocalMap for counting servlet invocation depth in Servlet3Advice and Servlet2Advice. We can not use helper classes like Servlet3Advice and Servlet2Advice for determining call depth of server invocation because they can be injected into multiple class loaders.- Returns:
- class used as a key in CallDepthThreadLocalMap for counting servlet invocation depth
-