Class InstrumentationModuleClassLoader

java.lang.Object
java.lang.ClassLoader
io.opentelemetry.javaagent.tooling.instrumentation.indy.InstrumentationModuleClassLoader

public class InstrumentationModuleClassLoader extends ClassLoader
Classloader used to load the helper classes from InstrumentationModules, so that those classes have access to both the agent/extension classes and the instrumented application classes.

This classloader implements the following classloading delegation strategy:

  • First, injected classes are considered (usually the helper classes from the InstrumentationModule)
  • Next, the classloader looks in the agent or extension classloader, depending on where the InstrumentationModule comes from
  • Finally, the instrumented application classloader is checked for the class

In addition, this classloader ensures that the lookup of corresponding .class resources follow the same delegation strategy, so that bytecode inspection tools work correctly.