modify support spring version
This commit is contained in:
parent
2699a0fe14
commit
78bbfd0f9f
|
|
@ -82,12 +82,12 @@
|
|||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<artifactId>apm-resttemplate-plugin</artifactId>
|
||||
<artifactId>apm-resttemplate-4.3.x-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<artifactId>apm-spring-concurrent-util-plugin</artifactId>
|
||||
<artifactId>apm-spring-concurrent-util-4.x-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +0,0 @@
|
|||
spring-concurrent-util-4.3.8=org.skywalking.apm.plugin.spring.concurrent.define.FailureCallbackInstrumentation
|
||||
spring-concurrent-util-4.3.8=org.skywalking.apm.plugin.spring.concurrent.define.SuccessCallbackInstrumentation
|
||||
spring-concurrent-util-4.3.8=org.skywalking.apm.plugin.spring.concurrent.define.ListenableFutureCallbackInstrumentation
|
||||
|
|
@ -7,17 +7,17 @@
|
|||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>apm-spring-concurrent-util-4.3.x-plugin</artifactId>
|
||||
<artifactId>apm-spring-concurrent-util-4.x-plugin</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>concurrent-util-4.3.x-plugin</name>
|
||||
<name>concurrent-util-4.x-plugin</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-core</artifactId>
|
||||
<version>4.3.8.RELEASE</version>
|
||||
<version>4.3.10.RELEASE</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
spring-concurrent-util-4.x=org.skywalking.apm.plugin.spring.concurrent.define.FailureCallbackInstrumentation
|
||||
spring-concurrent-util-4.x=org.skywalking.apm.plugin.spring.concurrent.define.SuccessCallbackInstrumentation
|
||||
spring-concurrent-util-4.x=org.skywalking.apm.plugin.spring.concurrent.define.ListenableFutureCallbackInstrumentation
|
||||
|
|
@ -11,10 +11,8 @@
|
|||
|
||||
<artifactId>spring-plugins</artifactId>
|
||||
<modules>
|
||||
<!--<module>concurrent-util-4.3.x-plugin</module>
|
||||
<module>resttemplate-4.3.x-plugin</module>-->
|
||||
<module>concurrent-util-4.3.x-plugin</module>
|
||||
<module>resttemplate-4.3.x-plugin</module>
|
||||
<module>concurrent-util-4.x-plugin</module>
|
||||
<module>resttemplate-4.x-plugin</module>
|
||||
</modules>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +0,0 @@
|
|||
spring-resttemplate-4.3.8=org.skywalking.apm.plugin.spring.resttemplate.async.define.RestTemplateInstrumentation
|
||||
spring-resttemplate-4.3.8=org.skywalking.apm.plugin.spring.resttemplate.async.define.ResponseExtractorFutureInstrumentation
|
||||
spring-resttemplate-4.3.8=org.skywalking.apm.plugin.spring.resttemplate.sync.define.RestTemplateInstrumentation
|
||||
|
|
@ -17,7 +17,7 @@
|
|||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-web</artifactId>
|
||||
<version>4.3.8.RELEASE</version>
|
||||
<version>4.3.10.RELEASE</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
|
@ -2,7 +2,6 @@ package org.skywalking.apm.plugin.spring.resttemplate.async;
|
|||
|
||||
import java.lang.reflect.Method;
|
||||
import java.net.URI;
|
||||
import java.util.List;
|
||||
import org.skywalking.apm.agent.core.context.ContextManager;
|
||||
import org.skywalking.apm.agent.core.context.trace.AbstractSpan;
|
||||
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
|
||||
|
|
@ -14,8 +13,8 @@ public class FutureGetInterceptor implements InstanceMethodsAroundInterceptor {
|
|||
@Override
|
||||
public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
|
||||
MethodInterceptResult result) throws Throwable {
|
||||
List<Object> cacheValues = (List<Object>)objInst.getSkyWalkingDynamicField();
|
||||
ContextManager.createLocalSpan("future/get:" + ((URI)cacheValues.get(0)).getPath());
|
||||
Object[] cacheValues = (Object[])objInst.getSkyWalkingDynamicField();
|
||||
ContextManager.createLocalSpan("future/get:" + ((URI)cacheValues[0]).getPath());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -38,8 +38,10 @@ public class RestExecuteInterceptor implements InstanceMethodsAroundInterceptor
|
|||
public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
|
||||
Object ret) throws Throwable {
|
||||
Object[] cacheValues = (Object[])objInst.getSkyWalkingDynamicField();
|
||||
cacheValues[3] = ContextManager.capture();
|
||||
((EnhancedInstance)ret).setSkyWalkingDynamicField(cacheValues);
|
||||
cacheValues[2] = ContextManager.capture();
|
||||
if (ret != null) {
|
||||
((EnhancedInstance)ret).setSkyWalkingDynamicField(cacheValues);
|
||||
}
|
||||
ContextManager.stopSpan();
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -1,7 +1,6 @@
|
|||
package org.springframework.http.client;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.List;
|
||||
import org.skywalking.apm.agent.core.conf.Config;
|
||||
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
|
||||
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
|
||||
|
|
@ -19,7 +18,9 @@ public class RestRequestInterceptor implements InstanceMethodsAroundInterceptor
|
|||
public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
|
||||
Object ret) throws Throwable {
|
||||
AbstractAsyncClientHttpRequest clientHttpRequest = (AbstractAsyncClientHttpRequest)ret;
|
||||
clientHttpRequest.getHeaders().set(Config.Plugin.Propagation.HEADER_NAME, String.valueOf(((List<Object>)objInst.getSkyWalkingDynamicField()).get(1)));
|
||||
if (ret != null) {
|
||||
clientHttpRequest.getHeaders().set(Config.Plugin.Propagation.HEADER_NAME, String.valueOf(((Object[])objInst.getSkyWalkingDynamicField())[1]));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
spring-resttemplate-4.x=org.skywalking.apm.plugin.spring.resttemplate.async.define.RestTemplateInstrumentation
|
||||
spring-resttemplate-4.x=org.skywalking.apm.plugin.spring.resttemplate.async.define.ResponseExtractorFutureInstrumentation
|
||||
spring-resttemplate-4.x=org.skywalking.apm.plugin.spring.resttemplate.sync.define.RestTemplateInstrumentation
|
||||
Loading…
Reference in New Issue