Automatic OpenTelemetry: Failed to handle <package>.<ClassName> for transformation on classloader #4530
Unanswered
jvaldezwds
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
We are using automatic OpenTelemetry in a Play Framework 1 project. When adding @WithSpan annotations to the functions we could see that some functions do not get traced. This specially happens in classes that references/uses another classes.
We set the application with -Dotel.javaagent.debug=true and we could see errors like this:
[otel.javaagent 2022-06-13 09:25:10:119 +0100] [play-thread-1] DEBUG io.opentelemetry.javaagent.tooling.AgentInstaller$TransformLoggingListener - Failed to handle controllers.ClassTest for transformation on classloader (play) [class models.Tag, class controllers.Posts, class helpers.CheatSheetHelper, class controllers.Secure$Security, class controllers.Secure, class models.Comment, class controllers.CRUD$ObjectType, class controllers.Tags, class models.Post, class controllers.CRUD$ObjectType$ObjectField, class Bootstrap, class controllers.Admin, interface controllers.CRUD$Hidden, interface controllers.CRUD$Exclude, class controllers.EmptyClass, class controllers.Security, class controllers.CRUD, class controllers.Application] net.bytebuddy.pool.TypePool$Resolution$NoSuchTypeException: Cannot resolve type description for controllers.Comments at net.bytebuddy.pool.TypePool$Resolution$Illegal.resolve(TypePool.java:167) at io.opentelemetry.javaagent.tooling.muzzle.AgentCachingPoolStrategy$CachingResolution.resolve(AgentCachingPoolStrategy.java:262) at net.bytebuddy.pool.TypePool$Default$WithLazyResolution$LazyTypeDescription.delegate(TypePool.java:1088) at net.bytebuddy.description.type.TypeDescription$AbstractBase$OfSimpleType$WithDelegation.getModifiers(TypeDescription.java:8464) at net.bytebuddy.description.ModifierReviewable$AbstractBase.matchesMask(ModifierReviewable.java:618) at net.bytebuddy.description.ModifierReviewable$AbstractBase.isPublic(ModifierReviewable.java:336) at net.bytebuddy.description.type.TypeDescription$AbstractBase.isVisibleTo(TypeDescription.java:7921) at net.bytebuddy.matcher.VisibilityMatcher.doMatch(VisibilityMatcher.java:48) at net.bytebuddy.matcher.VisibilityMatcher.doMatch(VisibilityMatcher.java:27) at net.bytebuddy.matcher.ElementMatcher$Junction$ForNonNullValues.matches(ElementMatcher.java:249) at net.bytebuddy.matcher.NegatingMatcher.matches(NegatingMatcher.java:47) at net.bytebuddy.matcher.ErasureMatcher.doMatch(ErasureMatcher.java:50) at net.bytebuddy.matcher.ErasureMatcher.doMatch(ErasureMatcher.java:29) at net.bytebuddy.matcher.ElementMatcher$Junction$ForNonNullValues.matches(ElementMatcher.java:249) at net.bytebuddy.matcher.MethodParameterTypeMatcher.doMatch(MethodParameterTypeMatcher.java:48) at net.bytebuddy.matcher.MethodParameterTypeMatcher.doMatch(MethodParameterTypeMatcher.java:27) at net.bytebuddy.matcher.ElementMatcher$Junction$ForNonNullValues.matches(ElementMatcher.java:249) at net.bytebuddy.matcher.CollectionItemMatcher.doMatch(CollectionItemMatcher.java:48) at net.bytebuddy.matcher.CollectionItemMatcher.doMatch(CollectionItemMatcher.java:26) at net.bytebuddy.matcher.ElementMatcher$Junction$ForNonNullValues.matches(ElementMatcher.java:249) at net.bytebuddy.matcher.NegatingMatcher.matches(NegatingMatcher.java:47) at net.bytebuddy.matcher.MethodParametersMatcher.doMatch(MethodParametersMatcher.java:49) at net.bytebuddy.matcher.MethodParametersMatcher.doMatch(MethodParametersMatcher.java:28) at net.bytebuddy.matcher.ElementMatcher$Junction$ForNonNullValues.matches(ElementMatcher.java:249) at net.bytebuddy.matcher.ElementMatcher$Junction$Conjunction.matches(ElementMatcher.java:146) at net.bytebuddy.dynamic.scaffold.MethodRegistry$Default.prepare(MethodRegistry.java:482) at net.bytebuddy.dynamic.scaffold.inline.RedefinitionDynamicTypeBuilder.make(RedefinitionDynamicTypeBuilder.java:204) at net.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.doTransform(AgentBuilder.java:11757) at net.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.transform(AgentBuilder.java:11692) at net.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.access$1700(AgentBuilder.java:11405) at net.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer$LegacyVmDispatcher.run(AgentBuilder.java:12092) at net.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer$LegacyVmDispatcher.run(AgentBuilder.java:12032) at java.security.AccessController.doPrivileged(Native Method) at net.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.doPrivileged(AgentBuilder.java) at net.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.transform(AgentBuilder.java:11597) at sun.instrument.TransformerManager.transform(TransformerManager.java:188) at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:428) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:763) at play.classloading.ApplicationClassloader.loadApplicationClass(ApplicationClassloader.java:168) at play.classloading.ApplicationClassloader.getAllClasses(ApplicationClassloader.java:431) at play.classloading.ApplicationClassloader.getAssignableClasses(ApplicationClassloader.java:455)
So, we guess that somehow we should tell to the bytebuddy how to resolve our classes, in order to the tracing to our application to work. Could you tell how to do this in OpenTelemetry? We guess that this is done by AgentLocationStrategy class, but we currently do not know how we could, for unresolved classes, how to tell OpenTelemetry how to resolve them.
Beta Was this translation helpful? Give feedback.
All reactions