opentelemetry-java-contrib/static-instrumenter
Jakub Wach d39d7e596c
moving maven plugin to use agent-instrumeneter (#378)
* moving maven plugin to use agent-instrumeneter

* Better inclusion of agent jar as resource

* Move plugin declaration

Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>
Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2022-08-07 17:08:42 -07:00
..
agent-extension Update otel dependency versions (#400) 2022-07-20 10:09:37 -07:00
agent-instrumenter Update otel dependency versions (#400) 2022-07-20 10:09:37 -07:00
bootstrap Static instrumenter logic - a new agent distro (#319) 2022-05-10 17:27:19 -07:00
gradle-plugin Static instrumenter logic - a new agent distro (#319) 2022-05-10 17:27:19 -07:00
maven-plugin moving maven plugin to use agent-instrumeneter (#378) 2022-08-07 17:08:42 -07:00
test-app small test app for verifying instrumentation (#313) 2022-04-26 16:13:02 -07:00
README.md Update username (#382) 2022-07-05 19:18:00 -07:00
build.gradle.kts Static instrumentation donation - project structure (#199) 2022-01-24 20:26:11 -08:00

README.md

OpenTelemetry Java static instrumenter

Structure

Agent instrumenter

Module enhancing OpenTelemetry Java Agent for static instrumentation. The modified agent is capable of instrumenting and saving a new JAR with all relevant instrumentations applied and necessary helper class-code included.

In order to statically instrument a JAR, modified agent needs to be both attached (-javaagent:) and run as the main method (io.opentelemetry.contrib.staticinstrumenter.agent.main.Main class). :

To instrument you app use opentelemetry-static-agent.jar and pass the main class of the agent:

java -javaagent:opentelemetry-static-agent.jar -cp your-app.jar io.opentelemetry.contrib.staticinstrumenter.agent.main.Main output-folder

To run an instrumented app pass the -Dio.opentelemetry.javaagent.shaded.io.opentelemetry.context.contextStorageProvider=default option and add no-inst-agent.jar to the classpath:

java -Dio.opentelemetry.javaagent.shaded.io.opentelemetry.context.contextStorageProvider=default -cp output-folder/your-app.jar:no-inst-agent.jar org.example.YourMainClass

Gradle plugin

Gradle plugin running static instrumentation agent during the assemble lifecycle task. The assembled archive contains statically instrumened class code.

Maven3 plugin

Maven3 plugin running the static instrumentation agent during the package phase. Packaged archive contains statically instrumened class code.

Component owners

Learn more about component owners in component_owners.yml.