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

Runtime attach enhancements for JDK 21+ #798

Open
breedx-splk opened this issue Mar 28, 2023 · 8 comments
Open

Runtime attach enhancements for JDK 21+ #798

breedx-splk opened this issue Mar 28, 2023 · 8 comments

Comments

@breedx-splk
Copy link
Contributor

Reference: https://mail.openjdk.org/pipermail/jigsaw-dev/2023-March/014816.html

The intention is to disable allowing dynamic attach of agents by default starting with Java 21. The runtime attach component should at a minimum enhance the README to mention the newly required JVM commandline arg. It would also be great to have a test/example to cover this use and demonstrate that it [still] works after 21.

@trask
Copy link
Member

trask commented Apr 6, 2023

I'm curious if Launcher-Agent-Class works (or if we can get it to work).

@breedx-splk
Copy link
Contributor Author

I've never used that mechanism, but having spent 41 seconds reading about it it sounds like Launcher-Agent-Class is still something that happens at "startup time" or something early in the lifecycle, vs. a much later dynamic attach. I can't reckon how it's related to dynamic attach. What am I missing?

@trask
Copy link
Member

trask commented Apr 6, 2023

our use of dynamic attach is already limited to "very early in the lifecycle".

so I'm thinking in our case, they both seem to address the same use case "how do I bundle up the OTel Javaagent inside of my application"

(I also only just learned about Launcher-Agent-Class when reading the link above)

@tylerbenson
Copy link
Member

Related: https://openjdk.org/jeps/451

@jeanbisutti
Copy link
Member

The runtime attachment of the Java agent still works with Java 21 with this warning:

WARNING: A Java agent has been loaded dynamically (C:\..\Temp\otel-agent6673307005713919434\agent.jar)
WARNING: If a serviceability tool is in use, please run with -XX:+EnableDynamicAgentLoading to hide this warning
WARNING: If a serviceability tool is not in use, please run with -Djdk.instrument.traceUsage for more information
WARNING: Dynamic loading of agents will be disallowed by default in a future release

@jeanbisutti
Copy link
Member

It would also be great to have a test/example to cover this use and demonstrate that it [still] works after 21.

The smoke tests of the OTel Java instrumentation repo seem well suited to do this. Could the runtime attach component be moved to the instrumentation repo?

@trask
Copy link
Member

trask commented Oct 19, 2023

It looks like we've discussed this in the past 😄

2022/7/8 meeting:

  • “Top-level deployment options” could all live in instrumentation repo
    • Javaagent
    • Spring boot starters
    • Runtime attach
    • Static instrumentation

2022/10/13 meeting:

I'm supportive of this.

Can you open an issue in the opentelemetry-java-instrumentation repo to propose this?

@jeanbisutti
Copy link
Member

It looks like we've discussed this in the past 😄

2022/7/8 meeting:

  • “Top-level deployment options” could all live in instrumentation repo

    • Javaagent
    • Spring boot starters
    • Runtime attach
    • Static instrumentation

2022/10/13 meeting:

I'm supportive of this.

Can you open an issue in the opentelemetry-java-instrumentation repo to propose this?

Issue created in the Java instrumenation repository: open-telemetry/opentelemetry-java-instrumentation#9745

@jeanbisutti jeanbisutti removed their assignment Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants