Skip to content

Agent class loader is not loading custom instrumentation classes #7769

Answered by laurit
srinusanduri asked this question in Q&A
Discussion options

You must be logged in to vote

At runtime these classes are injected into application class loader so it is not agent class loader but application class loader that fails loading your class. We use a custom gradle plugin named muzzle that among other things adds https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/muzzle/src/main/java/io/opentelemetry/javaagent/tooling/muzzle/InstrumentationModuleMuzzle.java to InstrumentationModule classes and also implement the methods from that interface. One of these methods returns a list of classes that need to be defined in application class loader for this instrumentation. If you add a new class to the instrumentation that is not in this list it can't …

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@srinusanduri
Comment options

@laurit
Comment options

@srinusanduri
Comment options

Answer selected by srinusanduri
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants