Improve consistency of `@Advice.OnMethodExit` params
And ordering of some `helperClassNames`
MODIFY
dd-java-agent/instrumentation/apache-httpclient-4/src/main/java/datadog/trace/instrumentation/apachehttpclient/ApacheHttpClientInstrumentation.java
dd-java-agent/instrumentation/apache-httpclient-4/src/main/java/datadog/trace/instrumentation/apachehttpclient/ApacheHttpClientInstrumentation.java
@@ -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",
};
}

MODIFY
dd-java-agent/instrumentation/couchbase-2.0/src/main/java/datadog/trace/instrumentation/couchbase/client/CouchbaseBucketInstrumentation.java
dd-java-agent/instrumentation/couchbase-2.0/src/main/java/datadog/trace/instrumentation/couchbase/client/CouchbaseBucketInstrumentation.java
@@ -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,

MODIFY
dd-java-agent/instrumentation/couchbase-2.0/src/main/java/datadog/trace/instrumentation/couchbase/client/CouchbaseClusterInstrumentation.java
dd-java-agent/instrumentation/couchbase-2.0/src/main/java/datadog/trace/instrumentation/couchbase/client/CouchbaseClusterInstrumentation.java
@@ -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,

MODIFY
dd-java-agent/instrumentation/dropwizard/src/test/groovy/DropwizardTest.groovy
dd-java-agent/instrumentation/dropwizard/src/test/groovy/DropwizardTest.groovy
@@ -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

MODIFY
dd-java-agent/instrumentation/finatra-2.9/src/main/java/datadog/trace/instrumentation/finatra/FinatraInstrumentation.java
dd-java-agent/instrumentation/finatra-2.9/src/main/java/datadog/trace/instrumentation/finatra/FinatraInstrumentation.java
@@ -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,

MODIFY
dd-java-agent/instrumentation/google-http-client/src/main/java/datadog/trace/instrumentation/googlehttpclient/GoogleHttpClientInstrumentation.java
dd-java-agent/instrumentation/google-http-client/src/main/java/datadog/trace/instrumentation/googlehttpclient/GoogleHttpClientInstrumentation.java
@@ -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"
};
}

MODIFY
dd-java-agent/instrumentation/grizzly-2/src/main/java/datadog/trace/instrumentation/grizzly/GrizzlyHttpHandlerInstrumentation.java
dd-java-agent/instrumentation/grizzly-2/src/main/java/datadog/trace/instrumentation/grizzly/GrizzlyHttpHandlerInstrumentation.java
@@ -86,7 +86,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) {

MODIFY
dd-java-agent/instrumentation/grpc-1.5/src/main/java/datadog/trace/instrumentation/grpc/client/GrpcClientBuilderInstrumentation.java
dd-java-agent/instrumentation/grpc-1.5/src/main/java/datadog/trace/instrumentation/grpc/client/GrpcClientBuilderInstrumentation.java
@@ -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",
};
}

MODIFY
dd-java-agent/instrumentation/grpc-1.5/src/main/java/datadog/trace/instrumentation/grpc/server/GrpcServerBuilderInstrumentation.java
dd-java-agent/instrumentation/grpc-1.5/src/main/java/datadog/trace/instrumentation/grpc/server/GrpcServerBuilderInstrumentation.java
@@ -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",
};
}

MODIFY
dd-java-agent/instrumentation/grpc-1.5/src/main/java/datadog/trace/instrumentation/grpc/server/InProcessServerStreamInstrumentation.java
dd-java-agent/instrumentation/grpc-1.5/src/main/java/datadog/trace/instrumentation/grpc/server/InProcessServerStreamInstrumentation.java
@@ -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);

MODIFY
dd-java-agent/instrumentation/servlet/request-3/src/main/java/datadog/trace/instrumentation/servlet3/AsyncContextInstrumentation.java
dd-java-agent/instrumentation/servlet/request-3/src/main/java/datadog/trace/instrumentation/servlet3/AsyncContextInstrumentation.java
@@ -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);

MODIFY
dd-java-agent/testing/src/main/groovy/datadog/trace/agent/test/base/HttpServerTestAdvice.java
dd-java-agent/testing/src/main/groovy/datadog/trace/agent/test/base/HttpServerTestAdvice.java
@@ -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();

Improve consistency of `@Advice.OnMethodExit` params

And ordering of some `helperClassNames`