Describe the bug
Opentelemetry agent (with latest version 1.20.1) throws exceptions when tracing jax-rs async calls
[INFO] [WARNING ] SRVE8504W: The following uncaught exception was thrown by the AsyncListener: [io.opentelemetry.javaagent.instrumentation.servlet.v3_0.Servlet3Accessor$Listener] during onComplete: [java.lang.NullPointerException
[INFO] at io.opentelemetry.javaagent.instrumentation.servlet.v3_0.Servlet3Accessor.isResponseCommitted(Servlet3Accessor.java:70)
[INFO] at io.opentelemetry.javaagent.instrumentation.servlet.v3_0.Servlet3Accessor.isResponseCommitted(Servlet3Accessor.java:19)
[INFO] at io.opentelemetry.javaagent.instrumentation.servlet.ServletHttpAttributesGetter.statusCode(ServletHttpAttributesGetter.java:72)
[INFO] at io.opentelemetry.javaagent.instrumentation.servlet.ServletHttpAttributesGetter.statusCode(ServletHttpAttributesGetter.java:12)
[INFO] at io.opentelemetry.javaagent.shaded.instrumentation.api.instrumenter.http.HttpCommonAttributesExtractor.onEnd(HttpCommonAttributesExtractor.java:65)
[INFO] at io.opentelemetry.javaagent.shaded.instrumentation.api.instrumenter.http.HttpServerAttributesExtractor.onEnd(HttpServerAttributesExtractor.java:132)
[INFO] at io.opentelemetry.javaagent.shaded.instrumentation.api.instrumenter.Instrumenter.doEnd(Instrumenter.java:224)
[INFO] at io.opentelemetry.javaagent.shaded.instrumentation.api.instrumenter.Instrumenter.end(Instrumenter.java:144)
[INFO] at io.opentelemetry.javaagent.instrumentation.servlet.AsyncRequestCompletionListener.onComplete(AsyncRequestCompletionListener.java:37)
[INFO] at io.opentelemetry.javaagent.instrumentation.servlet.v3_0.Servlet3Accessor$Listener.onComplete(Servlet3Accessor.java:82)
[INFO] at com.ibm.ws.webcontainer.async.AsyncListenerEntry.invokeOnComplete(AsyncListenerEntry.java:87)
[INFO] at [internal classes]
[INFO] ]
Steps to Reproduce
start liberty with jvm option: -javaagent:/opentelemetry-javaagent-1.20.1.jar
Describe the bug
Opentelemetry agent (with latest version 1.20.1) throws exceptions when tracing jax-rs async calls
Steps to Reproduce/opentelemetry-javaagent-1.20.1.jar
start liberty with jvm option: -javaagent:
This jaxrs endpoint reproduces the bug:
Expected behavior
There should be no exception thrown and tracing should work.
It seems the async event passed to AsyncListener does not contain any response.
Diagnostic information:
OpenLiberty Version: 22.0.0.12 and before
Affected feature(s) jaxrs-2.1
Java Version: openjdk 11.0.15-ea 2022-04-19 IBM Semeru Runtime Open Edition 11.0.15.0 (build 11.0.15-ea+10) Eclipse OpenJ9 VM 11.0.15.0 (build openj9-0.32.0, JRE 11 Mac OS X aarch64-64-Bit 20220422_36 (JIT enabled, AOT enabled) OpenJ9 - 9a84ec34e OMR - ab24b6666 JCL - b7b5b42ea6 based on jdk-11.0.15+10)
server.xml configuration