-
Notifications
You must be signed in to change notification settings - Fork 277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't instrument well behaved spring class loaders #1785
Conversation
1f2637c
to
d2bfb3a
Compare
@@ -45,7 +45,12 @@ public ClassloadingInstrumentation() { | |||
return namedNoneOf( | |||
"java.lang.ClassLoader", | |||
"com.ibm.oti.vm.BootstrapClassLoader", | |||
"datadog.trace.bootstrap.AgentClassLoader") | |||
"datadog.trace.bootstrap.AgentClassLoader", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice.
if (name.startsWith("org.springframework.core.task.") | ||
|| name.equals("org.springframework.core.DecoratingClassLoader") | ||
|| name.equals("org.springframework.core.OverridingClassLoader")) { | ||
if (name.startsWith("org.springframework.core.task.")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not new but this bugs me, I think we could implement a trie without much effort and probably do better here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I completely agree.
@@ -45,7 +45,12 @@ public ClassloadingInstrumentation() { | |||
return namedNoneOf( | |||
"java.lang.ClassLoader", | |||
"com.ibm.oti.vm.BootstrapClassLoader", | |||
"datadog.trace.bootstrap.AgentClassLoader") | |||
"datadog.trace.bootstrap.AgentClassLoader", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
datadog.trace.bootstrap.AgentClassLoader
no longer exists. I wonder how long this has been like this for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should be updated to this: datadog.trace.bootstrap.DatadogClassLoader
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also datadog.trace.bootstrap.DatadogClassLoader$DelegateClassLoader
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wonderful
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we change this before merging?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absolutely
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Turns out that they are already taken care of by datadog.trace.agent.tooling.ClassLoaderMatcher.SkipClassLoaderMatcher.canSkipClassLoaderByName
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to rationalise this logic? We seem to match classloaders in so many places.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only count to 3 right now 😉
d2bfb3a
to
fdb5482
Compare
...ng/src/main/java/datadog/trace/instrumentation/classloading/ClassloadingInstrumentation.java
Outdated
Show resolved
Hide resolved
...ooling/src/main/java/datadog/trace/agent/tooling/bytebuddy/matcher/GlobalIgnoresMatcher.java
Outdated
Show resolved
Hide resolved
6c6b7b5
to
d46d7ac
Compare
As part of #1293 we started instrumenting a couple of spring class loaders that all delegate class loading properly. This can have a big impact on application startup time in some cases.