Instrumenting classes that are created through Reflection (ie - Spring XML Beans) #8912
-
I'm attempting to instrument a class that is instantiated through Spring XML Beans. However, no matter what I do, the advice I'm attempting to inject is never being injected.
I've tried turning on the debug logging to see if any exceptions are being thrown, but I see nothing. My instrumentation is enabled, because I do see the "Installing instrumentation" debug message. My suspicion is that, because I'm using Spring XML configuration, SRSSPFB isn't actually directly referenced anywhere. It's instantiated at runtime through reflection. Is the auto-instrumentation unable to instrument classes instantiated this way? And if that is the case, is there a way around it? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Most likely the problem is that by default agent excludes some classes from instrumentation. See IgnoredTypesConfigurer like
|
Beta Was this translation helpful? Give feedback.
Most likely the problem is that by default agent excludes some classes from instrumentation. See
opentelemetry-java-instrumentation/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/ignore/AdditionalLibraryIgnoredTypesConfigurer.java
Line 58 in 164358d
IgnoredTypesConfigurer
likeopentelemetry-java-instrumentation/instrumentation/internal/internal-application-logger/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/internal/logging/ApplicationLoggingIgnoredTypesConfigurer.java
Line 18 in 164358d