Enable and muzzle jsp instrumentation
MODIFY
dd-java-agent/instrumentation/jsp-2.3/jsp-2.3.gradle
dd-java-agent/instrumentation/jsp-2.3/jsp-2.3.gradle
-apply plugin: 'version-scan'
+apply from: "${rootDir}/gradle/java.gradle"
-versionScan {
+muzzle {
+ pass {
group = "org.apache.tomcat"
module = "tomcat-jasper"
- versions = "[7.0.0,)"
- scanDependencies = true
- verifyPresent = [
- "org.apache.jasper.servlet.JspServletWrapper": null,
- ]
+ // range [7.0.0,7.0.19) and version 8.0.9 missing from maven
+ versions = "[7.0.19,8.0.9),(8.0.9,)"
+ }
}
-
-apply from: "${rootDir}/gradle/java.gradle"
apply plugin: 'org.unbroken-dome.test-sets'

MODIFY
dd-java-agent/instrumentation/jsp-2.3/src/main/java/datadog/trace/instrumentation/jsp/JSPInstrumentation.java
dd-java-agent/instrumentation/jsp-2.3/src/main/java/datadog/trace/instrumentation/jsp/JSPInstrumentation.java
@@ -33,11 +33,6 @@ public final class JSPInstrumentation extends Instrumenter.Default {
super("jsp", "jsp-render");
}
- @Override
- protected boolean defaultEnabled() {
- return false;
- }
-
@Override
public ElementMatcher<TypeDescription> typeMatcher() {
return not(isInterface()).and(safeHasSuperType(named("javax.servlet.jsp.HttpJspPage")));

MODIFY
dd-java-agent/instrumentation/jsp-2.3/src/main/java/datadog/trace/instrumentation/jsp/JasperJSPCompilationContextInstrumentation.java
dd-java-agent/instrumentation/jsp-2.3/src/main/java/datadog/trace/instrumentation/jsp/JasperJSPCompilationContextInstrumentation.java
package datadog.trace.instrumentation.jsp;
-import static datadog.trace.agent.tooling.ClassLoaderMatcher.classLoaderHasClasses;
import static io.opentracing.log.Fields.ERROR_OBJECT;
import static net.bytebuddy.matcher.ElementMatchers.isPublic;
import static net.bytebuddy.matcher.ElementMatchers.named;
@@ -29,21 +28,11 @@ public final class JasperJSPCompilationContextInstrumentation extends Instrument
super("jsp", "jsp-compile");
}
- @Override
- protected boolean defaultEnabled() {
- return false;
- }
-
@Override
public ElementMatcher<TypeDescription> typeMatcher() {
return named("org.apache.jasper.JspCompilationContext");
}
- @Override
- public ElementMatcher<ClassLoader> classLoaderMatcher() {
- return classLoaderHasClasses("org.apache.jasper.servlet.JspServletWrapper");
- }
-
@Override
public Map<ElementMatcher, String> transformers() {
final Map<ElementMatcher, String> transformers = new HashMap<>();

MODIFY
dd-java-agent/instrumentation/jsp-2.3/src/test/groovy/JSPInstrumentationBasicTests.groovy
dd-java-agent/instrumentation/jsp-2.3/src/test/groovy/JSPInstrumentationBasicTests.groovy
@@ -20,7 +20,6 @@ import static datadog.trace.agent.test.asserts.ListWriterAssert.assertTraces
class JSPInstrumentationBasicTests extends AgentTestRunner {
static {
- System.setProperty("dd.integration.jsp.enabled", "true")
// skip jar scanning using environment variables:
// http://tomcat.apache.org/tomcat-7.0-doc/config/systemprops.html#JAR_Scanning
// having this set allows us to test with old versions of the tomcat api since

MODIFY
dd-java-agent/instrumentation/jsp-2.3/src/test/groovy/JSPInstrumentationForwardTests.groovy
dd-java-agent/instrumentation/jsp-2.3/src/test/groovy/JSPInstrumentationForwardTests.groovy
@@ -18,7 +18,6 @@ import static datadog.trace.agent.test.asserts.ListWriterAssert.assertTraces
class JSPInstrumentationForwardTests extends AgentTestRunner {
static {
- System.setProperty("dd.integration.jsp.enabled", "true")
// skip jar scanning using environment variables:
// http://tomcat.apache.org/tomcat-7.0-doc/config/systemprops.html#JAR_Scanning
// having this set allows us to test with old versions of the tomcat api since

Enable and muzzle jsp instrumentation