Muzzle Spring Web Instrumentation
Add muzzle block and remove class loader matcher methods.
MODIFY
dd-java-agent/instrumentation/spring-web/spring-web.gradle
dd-java-agent/instrumentation/spring-web/spring-web.gradle
-//apply plugin: 'version-scan'
-//
-//versionScan {
-// group = 'org.springframework'
-// module = 'spring-webmvc'
-// legacyModule = "servlet-api"
-// versions = "[3.0,)"
-// verifyPresent = [
-// "javax.servlet.AsyncEvent" : null,
-// "javax.servlet.AsyncListener": null,
-// ]
-//}
+muzzle {
+ pass {
+ group = 'org.springframework'
+ module = 'javax.servlet.api'
+ versions = "[3.0.0.RELEASE,)"
+ extraDependency "javax.servlet:javax.servlet.api:3.0.0"
+ }
+}
apply from: "${rootDir}/gradle/java.gradle"

MODIFY
dd-java-agent/instrumentation/spring-web/src/main/java/datadog/trace/instrumentation/springweb/HandlerAdapterInstrumentation.java
dd-java-agent/instrumentation/spring-web/src/main/java/datadog/trace/instrumentation/springweb/HandlerAdapterInstrumentation.java
package datadog.trace.instrumentation.springweb;
import static datadog.trace.agent.tooling.ByteBuddyElementMatchers.safeHasSuperType;
-import static datadog.trace.agent.tooling.ClassLoaderMatcher.classLoaderHasClassWithField;
import static io.opentracing.log.Fields.ERROR_OBJECT;
import static net.bytebuddy.matcher.ElementMatchers.isInterface;
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
@@ -46,12 +45,6 @@ public final class HandlerAdapterInstrumentation extends Instrumenter.Default {
.and(safeHasSuperType(named("org.springframework.web.servlet.HandlerAdapter")));
}
- @Override
- public ElementMatcher<ClassLoader> classLoaderMatcher() {
- return classLoaderHasClassWithField(
- "org.springframework.web.servlet.HandlerMapping", "BEST_MATCHING_PATTERN_ATTRIBUTE");
- }
-
@Override
public Map<ElementMatcher, String> transformers() {
return Collections.<ElementMatcher, String>singletonMap(

Muzzle Spring Web Instrumentation

Add muzzle block and remove class loader matcher methods.