-
Notifications
You must be signed in to change notification settings - Fork 860
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing jaxrs span in Open Liberty #7870
Comments
OpenLiberty 23 uses Javarta EE 9: https://openliberty.io/docs/latest/jakarta-ee9-feature-updates.html Have you tried running the example above using the |
I was testing the above class with |
@fmhwong if you're able to troubleshoot this and send a PR to fix that would be much appreciated! |
Someone has made a PR. I can test it when the fix is available. |
Hopefully resolves #7870 Jax-rs annotation instrumentation is only enabled when jax-rs api is found in the class loader. This check does a `ClassLoader.getResource` call for the resource name corresponding to class `javax.ws.rs.container.AsyncResponse`. As far as I understand this particular class is used only because it was added in jax-rs 2.0, any other class added in jax-rs 2.0 could be used instead of it. On openliberty we fail to find this class because it should be resolved through bundle dynamic imports but we disable looking into dynamic imports in https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/instrumentation/internal/internal-eclipse-osgi-3.6/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/internal/osgi/EclipseOsgiInstrumentation.java when we do the class presence check. Using a class in `javax.ws.rs.core` package seems to work better as the import for that package is already resolved by the time we make the `getResource` call.
The fix is working. Thanks for the quick turnaround! |
Describe the bug
Running a simple JAX-RS application in both WebSphere Application Server traditional and Open Liberty with the latest version of Agent.
I got 3 spans from WebSphere Application Server traditional version 9.0.5.12 on Java 8.
HTTP GET /properties
JAX-RS getProperties()
@WithSpan SystemResources.sleep()
However, I got 2 spans from Open Liberty version 23.0.0.1 on Java 11.
HTTP GET /properties
@WithSpan SystemResources.sleep()
The JAX-RS span is missing from Open Liberty.
Steps to reproduce
What did you expect to see?
Three spans should be created from Open Liberty.
What did you see instead?
Only two spans were created as described above.
What version are you using?
opentelemetry-javaagent version 1.23.0
Environment
Compiler: OpenJDK 11.0.11
OS: MacOS
Runtime (if different from JDK above): OpenJDK 11.0.17
OS (if different from OS compiled on): Ubuntu 20.04.5 LTS (Focal Fossa) in a container
Additional context
The text was updated successfully, but these errors were encountered: