Add a guard against wrapping the ratpack request action multiple times
MODIFY
dd-java-agent/instrumentation/ratpack-1.4/src/main/java8/datadog/trace/instrumentation/ratpack/impl/RatpackHttpClientAdvice.java
dd-java-agent/instrumentation/ratpack-1.4/src/main/java8/datadog/trace/instrumentation/ratpack/impl/RatpackHttpClientAdvice.java
@@ -28,12 +28,18 @@ public class RatpackHttpClientAdvice {
@Override
public void execute(RequestSpec requestSpec) throws Exception {
- requestAction.execute(
+ WrappedRequestSpec wrappedRequestSpec;
+ if (requestSpec instanceof WrappedRequestSpec) {
+ wrappedRequestSpec = (WrappedRequestSpec) requestSpec;
+ } else {
+ wrappedRequestSpec =
new WrappedRequestSpec(
requestSpec,
GlobalTracer.get(),
GlobalTracer.get().scopeManager().active(),
- spanRef));
+ spanRef);
+ }
+ requestAction.execute(wrappedRequestSpec);
}
}

Add a guard against wrapping the ratpack request action multiple times