Class InstrumentationModuleClassLoader

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

public class InstrumentationModuleClassLoader extends ClassLoader
Class loader 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 class loader implements the following classloading delegation strategy:

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

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