Remove payara debugging instrumentation (#9342)
This commit is contained in:
parent
d140cf91f2
commit
91dce58dc5
|
@ -1,37 +0,0 @@
|
|||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package io.opentelemetry.javaagent.instrumentation.payara.debug;
|
||||
|
||||
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
|
||||
import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation;
|
||||
import io.opentelemetry.javaagent.extension.instrumentation.TypeTransformer;
|
||||
import java.lang.reflect.Method;
|
||||
import net.bytebuddy.asm.Advice;
|
||||
import net.bytebuddy.description.type.TypeDescription;
|
||||
import net.bytebuddy.matcher.ElementMatcher;
|
||||
|
||||
@SuppressWarnings("SystemOut")
|
||||
public class AsyncContextImplInstrumentation implements TypeInstrumentation {
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return named("org.apache.catalina.connector.AsyncContextImpl");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void transform(TypeTransformer transformer) {
|
||||
transformer.applyAdviceToMethod(isMethod(), this.getClass().getName() + "$TraceAdvice");
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public static class TraceAdvice {
|
||||
@Advice.OnMethodEnter(suppress = Throwable.class)
|
||||
public static void onEnter(@Advice.Origin Method method) {
|
||||
System.err.println("Calling " + method);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,38 +0,0 @@
|
|||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package io.opentelemetry.javaagent.instrumentation.payara.debug;
|
||||
|
||||
import static net.bytebuddy.matcher.ElementMatchers.any;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
|
||||
import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation;
|
||||
import io.opentelemetry.javaagent.extension.instrumentation.TypeTransformer;
|
||||
import java.lang.reflect.Executable;
|
||||
import net.bytebuddy.asm.Advice;
|
||||
import net.bytebuddy.description.type.TypeDescription;
|
||||
import net.bytebuddy.matcher.ElementMatcher;
|
||||
|
||||
@SuppressWarnings("SystemOut")
|
||||
public class HandlerInstrumentation implements TypeInstrumentation {
|
||||
@Override
|
||||
public ElementMatcher<TypeDescription> typeMatcher() {
|
||||
return named("org.apache.catalina.connector.AsyncContextImpl$Handler");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void transform(TypeTransformer transformer) {
|
||||
transformer.applyAdviceToMethod(any(), this.getClass().getName() + "$TraceAdvice");
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public static class TraceAdvice {
|
||||
@Advice.OnMethodEnter(suppress = Throwable.class)
|
||||
public static void onEnter(@Advice.Origin Executable executable) {
|
||||
System.err.println("Calling " + executable);
|
||||
new Exception().printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,33 +0,0 @@
|
|||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package io.opentelemetry.javaagent.instrumentation.payara.debug;
|
||||
|
||||
import static java.util.Arrays.asList;
|
||||
|
||||
import com.google.auto.service.AutoService;
|
||||
import io.opentelemetry.javaagent.extension.instrumentation.InstrumentationModule;
|
||||
import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation;
|
||||
import io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties;
|
||||
import java.util.List;
|
||||
|
||||
/** This module is only intended for debugging flaky payara async request smoke test. */
|
||||
@AutoService(InstrumentationModule.class)
|
||||
public class PayaraDebugInstrumentationModule extends InstrumentationModule {
|
||||
|
||||
public PayaraDebugInstrumentationModule() {
|
||||
super("payara-debug", "payara");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean defaultEnabled(ConfigProperties config) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TypeInstrumentation> typeInstrumentations() {
|
||||
return asList(new AsyncContextImplInstrumentation(), new HandlerInstrumentation());
|
||||
}
|
||||
}
|
|
@ -15,7 +15,7 @@ abstract class PayaraSmokeTest extends AppServerTest {
|
|||
|
||||
@Override
|
||||
protected Map<String, String> getExtraEnv() {
|
||||
return ["HZ_PHONE_HOME_ENABLED": "false", "OTEL_INSTRUMENTATION_PAYARA_DEBUG_ENABLED": "true"]
|
||||
return ["HZ_PHONE_HOME_ENABLED": "false"]
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue