Add comment about extension shading
MODIFY
examples/distro/instrumentation/build.gradle
examples/distro/instrumentation/build.gradle
@@ -53,7 +53,9 @@ shadowJar {
relocate "io.opentelemetry.spi", "io.opentelemetry.javaagent.shaded.io.opentelemetry.spi"
relocate "io.opentelemetry.context", "io.opentelemetry.javaagent.shaded.io.opentelemetry.context"
- // relocate OpenTelemetry extensions
+ // relocate the OpenTelemetry extensions that are used by instrumentation modules
+ // these extensions live in the AgentClassLoader, and are injected into the user's class loader
+ // by the instrumentation modules that use them
relocate "io.opentelemetry.extension.aws", "io.opentelemetry.javaagent.shaded.io.opentelemetry.extension.aws"
relocate "io.opentelemetry.extension.kotlin", "io.opentelemetry.javaagent.shaded.io.opentelemetry.extension.kotlin"
}
\ No newline at end of file

MODIFY
gradle/instrumentation.gradle
gradle/instrumentation.gradle
@@ -96,7 +96,9 @@ shadowJar {
relocate "io.opentelemetry.spi", "io.opentelemetry.javaagent.shaded.io.opentelemetry.spi"
relocate "io.opentelemetry.context", "io.opentelemetry.javaagent.shaded.io.opentelemetry.context"
- // relocate OpenTelemetry extensions
+ // relocate the OpenTelemetry extensions that are used by instrumentation modules
+ // these extensions live in the AgentClassLoader, and are injected into the user's class loader
+ // by the instrumentation modules that use them
relocate "io.opentelemetry.extension.aws", "io.opentelemetry.javaagent.shaded.io.opentelemetry.extension.aws"
relocate "io.opentelemetry.extension.kotlin", "io.opentelemetry.javaagent.shaded.io.opentelemetry.extension.kotlin"

MODIFY
instrumentation/instrumentation.gradle
instrumentation/instrumentation.gradle
@@ -74,7 +74,9 @@ shadowJar {
relocate "io.opentelemetry.spi", "io.opentelemetry.javaagent.shaded.io.opentelemetry.spi"
relocate "io.opentelemetry.context", "io.opentelemetry.javaagent.shaded.io.opentelemetry.context"
- // relocate OpenTelemetry extensions
+ // relocate the OpenTelemetry extensions that are used by instrumentation modules
+ // these extensions live in the AgentClassLoader, and are injected into the user's class loader
+ // by the instrumentation modules that use them
relocate "io.opentelemetry.extension.aws", "io.opentelemetry.javaagent.shaded.io.opentelemetry.extension.aws"
relocate "io.opentelemetry.extension.kotlin", "io.opentelemetry.javaagent.shaded.io.opentelemetry.extension.kotlin"

MODIFY
javaagent/javaagent.gradle
javaagent/javaagent.gradle
@@ -87,7 +87,9 @@ tasks.withType(ShadowJar).configureEach {
relocate "io.opentelemetry.spi", "io.opentelemetry.javaagent.shaded.io.opentelemetry.spi"
relocate "io.opentelemetry.context", "io.opentelemetry.javaagent.shaded.io.opentelemetry.context"
- // relocate OpenTelemetry extensions
+ // relocate the OpenTelemetry extensions that are used by instrumentation modules
+ // these extensions live in the AgentClassLoader, and are injected into the user's class loader
+ // by the instrumentation modules that use them
relocate "io.opentelemetry.extension.aws", "io.opentelemetry.javaagent.shaded.io.opentelemetry.extension.aws"
relocate "io.opentelemetry.extension.kotlin", "io.opentelemetry.javaagent.shaded.io.opentelemetry.extension.kotlin"
}

MODIFY
testing/agent-exporter/agent-exporter.gradle
testing/agent-exporter/agent-exporter.gradle
@@ -55,7 +55,9 @@ shadowJar {
relocate "io.opentelemetry.spi", "io.opentelemetry.javaagent.shaded.io.opentelemetry.spi"
relocate "io.opentelemetry.context", "io.opentelemetry.javaagent.shaded.io.opentelemetry.context"
- // relocate OpenTelemetry extensions
+ // relocate the OpenTelemetry extensions that are used by instrumentation modules
+ // these extensions live in the AgentClassLoader, and are injected into the user's class loader
+ // by the instrumentation modules that use them
relocate "io.opentelemetry.extension.aws", "io.opentelemetry.javaagent.shaded.io.opentelemetry.extension.aws"
relocate "io.opentelemetry.extension.kotlin", "io.opentelemetry.javaagent.shaded.io.opentelemetry.extension.kotlin"

Add comment about extension shading (#2235)