Custom method instrumentation when running .java file "directly" #7820
Unanswered
breedx-splk
asked this question in
Q&A
Replies: 2 comments 3 replies
-
what is this magic? 🛸 |
Beta Was this translation helpful? Give feedback.
1 reply
-
Actually this seems to work on jdk17 and fail on jdk11. This is because there is a class resource presence check in |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I figured this was way too oddball/niche to bring up as an issue, but in doing some testing work today I discovered (the hard way) that the
OTEL_INSTRUMENTATION_METHODS_INCLUDE
setting that leverages theio.opentelemetry.methods
tracer does not seem to be compatible with running.java
files directly.So in my case, something like this:
was failing to actually instrument the method. But if I did an explicit
javac
and instead run the resulting.class
things work ok.Anyway, I assume that there is a lifecycle or race condition with the classloaders, and that a screwball path happens when running
java Whatever.java
directly.I would not expect many users to be impacted by this, but wanted this to be here for posterity. If folks think this is interesting or have insight, feel free to share.
Beta Was this translation helpful? Give feedback.
All reactions