Muzzle servlet-2 Instrumentation
Add muzzle block and remove class loader matcher method.
MODIFY
dd-java-agent/instrumentation/servlet-2/servlet-2.gradle
dd-java-agent/instrumentation/servlet-2/servlet-2.gradle
-apply plugin: 'version-scan'
-
-versionScan {
+muzzle {
+ pass {
group = "javax.servlet"
module = "servlet-api"
versions = "[2.3,)"
- verifyPresent = [
- "javax.servlet.ServletContextEvent": null,
- ]
- // Code should also verify against what servlet-3 instrumentation is using.
+ assertInverse = true
+ }
}
apply from: "${rootDir}/gradle/java.gradle"

MODIFY
dd-java-agent/instrumentation/servlet-2/src/main/java/datadog/trace/instrumentation/servlet2/AbstractServlet2Instrumentation.java
dd-java-agent/instrumentation/servlet-2/src/main/java/datadog/trace/instrumentation/servlet2/AbstractServlet2Instrumentation.java
package datadog.trace.instrumentation.servlet2;
-import static datadog.trace.agent.tooling.ClassLoaderMatcher.classLoaderHasClasses;
-import static net.bytebuddy.matcher.ElementMatchers.not;
-
import datadog.trace.agent.tooling.Instrumenter;
-import net.bytebuddy.matcher.ElementMatcher;
public abstract class AbstractServlet2Instrumentation extends Instrumenter.Default {
@@ -12,12 +8,6 @@ public abstract class AbstractServlet2Instrumentation extends Instrumenter.Defau
super("servlet", "servlet-2");
}
- @Override
- public ElementMatcher<ClassLoader> classLoaderMatcher() {
- return not(classLoaderHasClasses("javax.servlet.AsyncEvent", "javax.servlet.AsyncListener"))
- .and(classLoaderHasClasses("javax.servlet.ServletContextEvent"));
- }
-
@Override
public String[] helperClassNames() {
return new String[] {

Muzzle servlet-2 Instrumentation

Add muzzle block and remove class loader matcher method.