jvmbytes inst agent allows you to config once and use Instrumentation for multiple times and in multiple libraries.
jvmbytes inst agent export the Instrumentation instance to multiple bytes libraries, which can be included in application classpath and loaded by AppClassloader, so that it's not need to update java command config, and which is always hard to change in production environment.
- add
inst-loader
dependency in pom.xml:
<dependency>
<groupId>com.jvmbytes.agent</groupId>
<artifactId>inst-loader</artifactId>
<version>1.0.1</version>
</dependency>
-
load Instrumentation instance through
com.jvmbytes.agent.inst.InstLoader.loadInst()
. -
download inst-agent-1.0.1.jar
wget https://search.maven.org/remotecontent?filepath=com/jvmbytes/agent/inst-agent/1.0.1/inst-agent-1.0.1.jar
- add
-javaagent:inst-agent-1.0.1.jar
for java process
java -javaagent:inst-agent-1.0.1.jar -jar app.jar
see demo