Remove Glassfish instrumentation
DELETE
instrumentation/glassfish-3.0/src/main/java/io/opentelemetry/auto/instrumentation/glassfish/GlassFishInstrumentation.java
-package io.opentelemetry.auto.instrumentation.glassfish;
-
-import static java.util.Collections.singletonMap;
-import static net.bytebuddy.matcher.ElementMatchers.isMethod;
-import static net.bytebuddy.matcher.ElementMatchers.named;
-import static net.bytebuddy.matcher.ElementMatchers.takesArguments;
-
-import com.google.auto.service.AutoService;
-import io.opentelemetry.auto.tooling.Constants;
-import io.opentelemetry.auto.tooling.Instrumenter;
-import java.util.Map;
-import lombok.extern.slf4j.Slf4j;
-import net.bytebuddy.asm.Advice;
-import net.bytebuddy.description.method.MethodDescription;
-import net.bytebuddy.description.type.TypeDescription;
-import net.bytebuddy.matcher.ElementMatcher;
-import net.bytebuddy.matcher.ElementMatchers;
-
-/**
- * This instrumenter prevents a mechanism from GlassFish classloader to produces a class not found
- * exception in our tracer. Link to the GH issue:
- * https://github.com/eclipse-ee4j/glassfish/issues/22566 If a class loading is attempted, as an
- * example, as a resource and is it not found, then it is blacklisted. Successive attempts to load a
- * class as a class (not a resource) will fail because the class is not even tried. We hook into the
- * blacklisting method to avoid specific namespaces to be blacklisted.
- */
-@Slf4j
-@AutoService(Instrumenter.class)
-public final class GlassFishInstrumentation extends Instrumenter.Default {
-
- public GlassFishInstrumentation() {
- super("glassfish");
- }
-
- @Override
- public String[] helperClassNames() {
- return new String[] {Constants.class.getName()};
- }
-
- @Override
- public ElementMatcher<? super TypeDescription> typeMatcher() {
- return ElementMatchers.named(
- "com.sun.enterprise.v3.server.APIClassLoaderServiceImpl$APIClassLoader");
- }
-
- @Override
- public Map<? extends ElementMatcher<? super MethodDescription>, String> transformers() {
- return singletonMap(
- isMethod().and(named("addToBlackList")).and(takesArguments(1)),
- GlassFishInstrumentation.class.getName() + "$AvoidGlassFishBlacklistAdvice");
- }
-
- public static class AvoidGlassFishBlacklistAdvice {
-
- @Advice.OnMethodEnter(suppress = Throwable.class)
- public static void preventBlacklistingOfTracerClasses(
- @Advice.Argument(value = 0, readOnly = false) String name) {
- for (final String prefix : Constants.BOOTSTRAP_PACKAGE_PREFIXES) {
- if (name.startsWith(prefix)) {
- name = "__opentelemetry_auto_no_blacklist." + name;
- break;
- }
- }
- }
- }
-}

RENAME
instrumentation/glassfish-3.0/glassfish-3.0.gradle
instrumentation/servlet/glassfish-testing/glassfish-testing.gradle
@@ -2,15 +2,6 @@ ext {
maxJavaVersionForTests = JavaVersion.VERSION_1_8
}
-muzzle {
- pass {
- group = 'org.glassfish.main.extras'
- module = 'glassfish-embedded-all'
- versions = "[3.0,)"
- assertInverse = true
- }
-}
-
apply from: "${rootDir}/gradle/java.gradle"
apply plugin: 'org.unbroken-dome.test-sets'

RENAME
instrumentation/glassfish-3.0/src/test/groovy/GlassFishServerTest.groovy
instrumentation/servlet/glassfish-testing/src/test/groovy/GlassFishServerTest.groovy
RENAME
instrumentation/glassfish-3.0/src/test/groovy/GrizzlyTestInstrumentation.java
instrumentation/servlet/glassfish-testing/src/test/groovy/GrizzlyTestInstrumentation.java
RENAME
instrumentation/glassfish-3.0/src/test/groovy/TestServlets.java
instrumentation/servlet/glassfish-testing/src/test/groovy/TestServlets.java
RENAME
instrumentation/glassfish-3.0/src/test/resources/WEB-INF/web.xml
instrumentation/servlet/glassfish-testing/src/test/resources/WEB-INF/web.xml
RENAME
instrumentation/glassfish-3.0/src/test/resources/error.jsp
instrumentation/servlet/glassfish-testing/src/test/resources/error.jsp
MODIFY
settings.gradle
settings.gradle
@@ -65,7 +65,6 @@ include ':instrumentation:elasticsearch:transport-5.0'
include ':instrumentation:elasticsearch:transport-5.3'
include ':instrumentation:elasticsearch:transport-6.0'
include ':instrumentation:finatra-2.9'
-include ':instrumentation:glassfish-3.0'
include ':instrumentation:google-http-client-1.19'
include ':instrumentation:grizzly-2.0'
include ':instrumentation:grpc-1.5'
@@ -122,6 +121,7 @@ include ':instrumentation:reactor-core-3.1'
include ':instrumentation:rmi'
include ':instrumentation:rxjava-1.0'
include ':instrumentation:servlet'
+include ':instrumentation:servlet:glassfish-testing'
include ':instrumentation:servlet:request-2.3'
include ':instrumentation:servlet:request-3.0'
// FIXME this instrumentation relied on scope listener

Remove Glassfish instrumentation (#176)