-
Notifications
You must be signed in to change notification settings - Fork 791
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
Java Agent 1.25 and above not creating span for methods annotated with WithSpan #10159
Comments
@jakub-pomykala does this repro only with the open liberty test harness or is it possible to also repro it by deploying a war to liberty? Does it matter whether opnjdk or openj9 is used? |
Hi @laurit, you will be able to reproduce the issue by deploying a war to liberty and I do not think that openjdk vs openj9 matters. |
@jakub-pomykala I failed to reproduce this. Could you provide a war that reproduces this? Perhaps the version of liberty also matters? |
@laurit I've zipped up a war for JEE7, a war for JEE9 and also the corresponding server.xml files too. The liberty version should not matter. |
@jakub-pomykala I still wasn't able to reproduce. I used
|
@laurit |
@jakub-pomykala I downloaded the
I guess I'm missing whatever it is that provides the opentelemetry api
|
@laurit Could you try using the following for the
Also, did you include the following dependencies in your
Also, what command did you use to run? |
Same error
No, I did not. I uses the war that you provided and it does not include these dependencies. I thought that not including these and relying on
|
@laurit could you please try again by downloading All GA Features variant for 23.0.0.12 (click here to download). And with the following
Sorry about this, we realised that the mpTelemetry-1.1 was not in the |
As far as I understand https://github.com/open-telemetry/opentelemetry-java-instrumentation/tree/main/instrumentation/internal/internal-eclipse-osgi-3.6/javaagent prevents looking into dynamic imports while detecting whether instrumentation dependencies are present. Because of that the |
Hey @laurit we have found a workaround for now which is to add:
To your |
Describe the bug
When using Java Agent 1.25 or above it does not generate an extra span for methods annotated with WithSpan
We have added the following wrapper to
ElementMatcher.Junction<ClassLoader> classLoaderMatcher()
in theAnnotationInstrumentationModule
class:It seems like there is something going wrong in the
AppClassLoader
whilst it is carrying out the matching task. For EE 7 and EE 8 the match returned is “false” whereas we are expectingtrue
in:Steps to reproduce
This method should call this method which should generate an additional span.
Expected behavior
You can see what we are expecting here where we are checking for the spans returned from the application. We have currently implemented a workaround where we are still using Java Agent 1.19 for Java EE 7 and EE 8.
Actual behavior
The additional WithSpan Span is missing.
Javaagent or library instrumentation version
v1.25,v1.26,v1.27,v1.28,v1.29
Environment
JDK: IBM Semeru Runtime Open Edition 17.0.8.0 (build 17.0.8+7)
OS: macOS 14.2.1
Additional context
No response
The text was updated successfully, but these errors were encountered: