Merge pull request #1307 from DataDog/tyler/onmethodexit
Improve consistency of `@Advice.OnMethodExit` params
This commit is contained in:
commit
e4ca33d487
|
@ -56,14 +56,14 @@ public class ApacheHttpClientInstrumentation extends Instrumenter.Default {
|
|||
@Override
|
||||
public String[] helperClassNames() {
|
||||
return new String[] {
|
||||
getClass().getName() + "$HelperMethods",
|
||||
packageName + ".HttpHeadersInjectAdapter",
|
||||
getClass().getName() + "$WrappingStatusSettingResponseHandler",
|
||||
"datadog.trace.agent.decorator.BaseDecorator",
|
||||
"datadog.trace.agent.decorator.ClientDecorator",
|
||||
"datadog.trace.agent.decorator.HttpClientDecorator",
|
||||
packageName + ".ApacheHttpClientDecorator",
|
||||
packageName + ".HttpHeadersInjectAdapter",
|
||||
packageName + ".HostAndRequestAsHttpUriRequest",
|
||||
getClass().getName() + "$HelperMethods",
|
||||
getClass().getName() + "$WrappingStatusSettingResponseHandler",
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ public class CouchbaseBucketInstrumentation extends Instrumenter.Default {
|
|||
return CallDepthThreadLocalMap.incrementCallDepth(CouchbaseCluster.class);
|
||||
}
|
||||
|
||||
@Advice.OnMethodExit(onThrowable = Throwable.class)
|
||||
@Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class)
|
||||
public static void subscribeResult(
|
||||
@Advice.Enter final int callDepth,
|
||||
@Advice.Origin final Method method,
|
||||
|
|
|
@ -61,7 +61,7 @@ public class CouchbaseClusterInstrumentation extends Instrumenter.Default {
|
|||
return CallDepthThreadLocalMap.incrementCallDepth(CouchbaseCluster.class);
|
||||
}
|
||||
|
||||
@Advice.OnMethodExit(onThrowable = Throwable.class)
|
||||
@Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class)
|
||||
public static void subscribeResult(
|
||||
@Advice.Enter final int callDepth,
|
||||
@Advice.Origin final Method method,
|
||||
|
|
|
@ -12,11 +12,13 @@ import io.dropwizard.setup.Bootstrap
|
|||
import io.dropwizard.setup.Environment
|
||||
import io.dropwizard.testing.ConfigOverride
|
||||
import io.dropwizard.testing.DropwizardTestSupport
|
||||
import org.eclipse.jetty.servlet.ServletHandler
|
||||
import spock.lang.Retry
|
||||
|
||||
import javax.ws.rs.GET
|
||||
import javax.ws.rs.Path
|
||||
import javax.ws.rs.QueryParam
|
||||
import javax.ws.rs.core.Response
|
||||
import org.eclipse.jetty.servlet.ServletHandler
|
||||
|
||||
import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.ERROR
|
||||
import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.EXCEPTION
|
||||
|
@ -24,6 +26,8 @@ import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.QUERY_
|
|||
import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.REDIRECT
|
||||
import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.SUCCESS
|
||||
|
||||
// Work around for: address already in use
|
||||
@Retry
|
||||
class DropwizardTest extends HttpServerTest<DropwizardTestSupport, Servlet3Decorator> {
|
||||
|
||||
@Override
|
||||
|
|
|
@ -95,7 +95,7 @@ public class FinatraInstrumentation extends Instrumenter.Default {
|
|||
return scope;
|
||||
}
|
||||
|
||||
@Advice.OnMethodExit(onThrowable = Throwable.class)
|
||||
@Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class)
|
||||
public static void setupCallback(
|
||||
@Advice.Enter final AgentScope scope,
|
||||
@Advice.Thrown final Throwable throwable,
|
||||
|
|
|
@ -55,8 +55,6 @@ public class GoogleHttpClientInstrumentation extends Instrumenter.Default {
|
|||
"datadog.trace.agent.decorator.HttpClientDecorator",
|
||||
packageName + ".GoogleHttpClientDecorator",
|
||||
packageName + ".RequestState",
|
||||
getClass().getName() + "$GoogleHttpClientAdvice",
|
||||
getClass().getName() + "$GoogleHttpClientAsyncAdvice",
|
||||
packageName + ".HeadersInjectAdapter"
|
||||
};
|
||||
}
|
||||
|
|
|
@ -90,7 +90,7 @@ public class GrizzlyHttpHandlerInstrumentation extends Instrumenter.Default {
|
|||
return scope;
|
||||
}
|
||||
|
||||
@Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class)
|
||||
@Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class)
|
||||
public static void methodExit(
|
||||
@Advice.Enter final AgentScope scope, @Advice.Thrown final Throwable throwable) {
|
||||
if (scope == null) {
|
||||
|
|
|
@ -29,13 +29,13 @@ public class GrpcClientBuilderInstrumentation extends Instrumenter.Default {
|
|||
@Override
|
||||
public String[] helperClassNames() {
|
||||
return new String[] {
|
||||
"datadog.trace.instrumentation.grpc.client.GrpcInjectAdapter",
|
||||
"datadog.trace.instrumentation.grpc.client.TracingClientInterceptor",
|
||||
"datadog.trace.instrumentation.grpc.client.TracingClientInterceptor$TracingClientCall",
|
||||
"datadog.trace.instrumentation.grpc.client.TracingClientInterceptor$TracingClientCallListener",
|
||||
"datadog.trace.agent.decorator.BaseDecorator",
|
||||
"datadog.trace.agent.decorator.ClientDecorator",
|
||||
packageName + ".GrpcClientDecorator",
|
||||
packageName + ".GrpcInjectAdapter",
|
||||
packageName + ".TracingClientInterceptor",
|
||||
packageName + ".TracingClientInterceptor$TracingClientCall",
|
||||
packageName + ".TracingClientInterceptor$TracingClientCallListener",
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -29,13 +29,13 @@ public class GrpcServerBuilderInstrumentation extends Instrumenter.Default {
|
|||
@Override
|
||||
public String[] helperClassNames() {
|
||||
return new String[] {
|
||||
"datadog.trace.instrumentation.grpc.server.TracingServerInterceptor",
|
||||
"datadog.trace.instrumentation.grpc.server.TracingServerInterceptor$TracingServerCall",
|
||||
"datadog.trace.instrumentation.grpc.server.TracingServerInterceptor$TracingServerCallListener",
|
||||
"datadog.trace.agent.decorator.BaseDecorator",
|
||||
"datadog.trace.agent.decorator.ServerDecorator",
|
||||
packageName + ".GrpcServerDecorator",
|
||||
packageName + ".GrpcExtractAdapter"
|
||||
packageName + ".GrpcExtractAdapter",
|
||||
packageName + ".TracingServerInterceptor",
|
||||
packageName + ".TracingServerInterceptor$TracingServerCall",
|
||||
packageName + ".TracingServerInterceptor$TracingServerCallListener",
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ public class InProcessServerStreamInstrumentation extends Instrumenter.Default {
|
|||
return null;
|
||||
}
|
||||
|
||||
@Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class)
|
||||
@Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class)
|
||||
public static void exit(@Advice.Enter final TraceScope scopeToReenable) {
|
||||
if (scopeToReenable != null) {
|
||||
scopeToReenable.setAsyncPropagation(true);
|
||||
|
|
|
@ -91,7 +91,7 @@ public final class AsyncContextInstrumentation extends Instrumenter.Default {
|
|||
return true;
|
||||
}
|
||||
|
||||
@Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class)
|
||||
@Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class)
|
||||
public static void exit(@Advice.Enter final boolean topLevel) {
|
||||
if (topLevel) {
|
||||
CallDepthThreadLocalMap.reset(AsyncContext.class);
|
||||
|
|
|
@ -32,7 +32,7 @@ public abstract class HttpServerTestAdvice {
|
|||
}
|
||||
}
|
||||
|
||||
@Advice.OnMethodExit(onThrowable = Throwable.class)
|
||||
@Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class)
|
||||
public static void methodExit(@Advice.Enter final AgentScope scope) {
|
||||
if (scope != null) {
|
||||
scope.close();
|
||||
|
|
Loading…
Reference in New Issue