Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into feature/365
- Loading branch information
Showing
10 changed files
with
160 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
apm-sniffer/apm-sdk-plugin/spring-plugins/spring-cloud/netflix-plugins/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>org.skywalking</groupId> | ||
<artifactId>spring-cloud</artifactId> | ||
<version>3.2-2017</version> | ||
</parent> | ||
|
||
<artifactId>netflix-plugins</artifactId> | ||
<modules> | ||
<module>spring-cloud-feign-1.x-plugin</module> | ||
</modules> | ||
<packaging>pom</packaging> | ||
|
||
<name>netflix-plugins</name> | ||
<url>http://maven.apache.org</url> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
</properties> | ||
|
||
</project> |
34 changes: 34 additions & 0 deletions
34
...-plugin/spring-plugins/spring-cloud/netflix-plugins/spring-cloud-feign-1.x-plugin/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>org.skywalking</groupId> | ||
<artifactId>netflix-plugins</artifactId> | ||
<version>3.2-2017</version> | ||
</parent> | ||
|
||
<artifactId>apm-spring-cloud-feign-1.x-plugin</artifactId> | ||
<packaging>jar</packaging> | ||
|
||
<!-- only support spring cloud feign 1.1.x, 1.2.x, 1.3.x --> | ||
<name>spring-cloud-feign-1.x-plugin</name> | ||
<url>http://maven.apache.org</url> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.springframework.cloud</groupId> | ||
<artifactId>spring-cloud-starter-feign</artifactId> | ||
<version>1.1.0.RELEASE</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.skywalking</groupId> | ||
<artifactId>apm-feign-default-http-9.x-plugin</artifactId> | ||
<version>${project.version}</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
</project> |
55 changes: 55 additions & 0 deletions
55
...walking/apm/plugin/spring/cloud/netflix/feign/v11/define/NetflixFeignInstrumentation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package org.skywalking.apm.plugin.spring.cloud.netflix.feign.v11.define; | ||
|
||
import net.bytebuddy.description.method.MethodDescription; | ||
import net.bytebuddy.matcher.ElementMatcher; | ||
import org.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint; | ||
import org.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint; | ||
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine; | ||
import org.skywalking.apm.agent.core.plugin.match.ClassMatch; | ||
|
||
import static net.bytebuddy.matcher.ElementMatchers.named; | ||
import static org.skywalking.apm.agent.core.plugin.match.NameMatch.byName; | ||
|
||
/** | ||
* {@link NetflixFeignInstrumentation} presents that skywalking intercepts {@link org.springframework.cloud.netflix.feign.ribbon.LoadBalancerFeignClient#execute(feign.Request, | ||
* feign.Request.Options)} by using {@link org.skywalking.apm.plugin.feign.http.v9.DefaultHttpClientInterceptor}. | ||
* | ||
* @author zhangxin | ||
*/ | ||
public class NetflixFeignInstrumentation extends ClassInstanceMethodsEnhancePluginDefine { | ||
/** | ||
* Enhance class. | ||
*/ | ||
private static final String ENHANCE_CLASS = "org.springframework.cloud.netflix.feign.ribbon.LoadBalancerFeignClient"; | ||
|
||
/** | ||
* Intercept class. | ||
*/ | ||
private static final String INTERCEPT_CLASS = "org.skywalking.apm.plugin.feign.http.v9.DefaultHttpClientInterceptor"; | ||
|
||
@Override protected ClassMatch enhanceClass() { | ||
return byName(ENHANCE_CLASS); | ||
} | ||
|
||
@Override protected ConstructorInterceptPoint[] getConstructorsInterceptPoints() { | ||
return new ConstructorInterceptPoint[0]; | ||
} | ||
|
||
@Override protected InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints() { | ||
return new InstanceMethodsInterceptPoint[] { | ||
new InstanceMethodsInterceptPoint() { | ||
@Override public ElementMatcher<MethodDescription> getMethodsMatcher() { | ||
return named("execute"); | ||
} | ||
|
||
@Override public String getMethodsInterceptor() { | ||
return INTERCEPT_CLASS; | ||
} | ||
|
||
@Override public boolean isOverrideArgs() { | ||
return false; | ||
} | ||
} | ||
}; | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
...ud/netflix-plugins/spring-cloud-feign-1.x-plugin/src/main/resources/skywalking-plugin.def
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
spring-cloud-feign-1.x=org.skywalking.apm.plugin.spring.cloud.netflix.feign.v11.define.NetflixFeignInstrumentation |
25 changes: 25 additions & 0 deletions
25
apm-sniffer/apm-sdk-plugin/spring-plugins/spring-cloud/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>org.skywalking</groupId> | ||
<artifactId>spring-plugins</artifactId> | ||
<version>3.2-2017</version> | ||
</parent> | ||
|
||
<artifactId>spring-cloud</artifactId> | ||
<modules> | ||
<module>netflix-plugins</module> | ||
</modules> | ||
<packaging>pom</packaging> | ||
|
||
<name>spring-cloud</name> | ||
<url>http://maven.apache.org</url> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
</properties> | ||
|
||
</project> |