diff --git a/spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/instrument/web/client/feign/FeignResponseHeadersHolder.java b/spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/instrument/web/client/feign/FeignResponseHeadersHolder.java deleted file mode 100644 index 7e5620f0d..000000000 --- a/spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/instrument/web/client/feign/FeignResponseHeadersHolder.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2013-2018 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.cloud.sleuth.instrument.web.client.feign; - -import java.util.Collection; -import java.util.Map; - -/** - * Mutable holder for Feign Response headers - * - * @author Marcin Grzejszczak - * - * @since 1.0.0 - */ -class FeignResponseHeadersHolder { - final Map> responseHeaders; - - FeignResponseHeadersHolder(Map> responseHeaders) { - this.responseHeaders = responseHeaders; - } -} diff --git a/spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/instrument/web/client/feign/LazyTracingFeignClient.java b/spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/instrument/web/client/feign/LazyTracingFeignClient.java index 349a82d9d..f25bde744 100644 --- a/spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/instrument/web/client/feign/LazyTracingFeignClient.java +++ b/spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/instrument/web/client/feign/LazyTracingFeignClient.java @@ -22,6 +22,8 @@ import brave.http.HttpTracing; import feign.Client; import feign.Request; import feign.Response; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.BeanFactory; /** @@ -32,6 +34,8 @@ import org.springframework.beans.factory.BeanFactory; */ class LazyTracingFeignClient implements Client { + private static final Log log = LogFactory.getLog(LazyTracingFeignClient.class); + private Client tracingFeignClient; private HttpTracing httpTracing; private final BeanFactory beanFactory; @@ -44,6 +48,9 @@ class LazyTracingFeignClient implements Client { @Override public Response execute(Request request, Request.Options options) throws IOException { + if (log.isDebugEnabled()) { + log.debug("Sending a request via tracing feign client"); + } return tracingFeignClient().execute(request, options); } diff --git a/spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/instrument/web/client/feign/TraceFeignAspect.java b/spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/instrument/web/client/feign/TraceFeignAspect.java index ab3ec6f25..41037e30e 100644 --- a/spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/instrument/web/client/feign/TraceFeignAspect.java +++ b/spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/instrument/web/client/feign/TraceFeignAspect.java @@ -20,6 +20,8 @@ import java.io.IOException; import feign.Client; import feign.Request; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Aspect; @@ -34,6 +36,8 @@ import org.springframework.beans.factory.BeanFactory; @Aspect class TraceFeignAspect { + private static final Log log = LogFactory.getLog(TraceFeignAspect.class); + private final BeanFactory beanFactory; TraceFeignAspect(BeanFactory beanFactory) { @@ -44,6 +48,9 @@ class TraceFeignAspect { public Object feignClientWasCalled(final ProceedingJoinPoint pjp) throws Throwable { Object bean = pjp.getTarget(); Object wrappedBean = new TraceFeignObjectWrapper(this.beanFactory).wrap(bean); + if (log.isDebugEnabled()) { + log.debug("Executing feign client via TraceFeignAspect"); + } if (bean != wrappedBean) { return executeTraceFeignClient(bean, pjp); }