Skip to content
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

Fix jaxrs annotation instrumentation on openliberty #7890

Merged
merged 1 commit into from
Feb 24, 2023

Conversation

laurit
Copy link
Contributor

@laurit laurit commented Feb 23, 2023

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.

@laurit laurit requested a review from a team as a code owner February 23, 2023 11:27
@laurit laurit force-pushed the jaxrs-annotation-openliberty branch from 4d4a5a1 to 0c53559 Compare February 24, 2023 10:31
@laurit laurit merged commit 64eb586 into open-telemetry:main Feb 24, 2023
@laurit laurit deleted the jaxrs-annotation-openliberty branch February 24, 2023 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing jaxrs span in Open Liberty
3 participants