Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
月轩居士
SkyWalking
提交
e685ef90
S
SkyWalking
项目概览
月轩居士
/
SkyWalking
与 Fork 源项目一致
Fork自
apache / SkyWalking
通知
4
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
SkyWalking
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e685ef90
编写于
8月 31, 2017
作者:
A
ascrutae
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
support netflix fegin plugin
上级
ab677f20
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
153 addition
and
5 deletion
+153
-5
apm-sniffer/apm-agent/pom.xml
apm-sniffer/apm-agent/pom.xml
+5
-0
apm-sniffer/apm-sdk-plugin/feign-default-http-9.x-plugin/src/main/java/org/skywalking/apm/plugin/feign/http/v9/DefaultHttpClientInterceptor.java
...pm/plugin/feign/http/v9/DefaultHttpClientInterceptor.java
+7
-5
apm-sniffer/apm-sdk-plugin/spring-plugins/pom.xml
apm-sniffer/apm-sdk-plugin/spring-plugins/pom.xml
+1
-0
apm-sniffer/apm-sdk-plugin/spring-plugins/spring-cloud/netflix-plugins/pom.xml
...lugin/spring-plugins/spring-cloud/netflix-plugins/pom.xml
+25
-0
apm-sniffer/apm-sdk-plugin/spring-plugins/spring-cloud/netflix-plugins/spring-cloud-feign-1.x-plugin/pom.xml
...oud/netflix-plugins/spring-cloud-feign-1.x-plugin/pom.xml
+34
-0
apm-sniffer/apm-sdk-plugin/spring-plugins/spring-cloud/netflix-plugins/spring-cloud-feign-1.x-plugin/src/main/java/org/skywalking/apm/plugin/spring/cloud/netflix/feign/v11/define/NetflixFeignInstrumentation.java
...netflix/feign/v11/define/NetflixFeignInstrumentation.java
+55
-0
apm-sniffer/apm-sdk-plugin/spring-plugins/spring-cloud/netflix-plugins/spring-cloud-feign-1.x-plugin/src/main/resources/skywalking-plugin.def
...feign-1.x-plugin/src/main/resources/skywalking-plugin.def
+1
-0
apm-sniffer/apm-sdk-plugin/spring-plugins/spring-cloud/pom.xml
...niffer/apm-sdk-plugin/spring-plugins/spring-cloud/pom.xml
+25
-0
未找到文件。
apm-sniffer/apm-agent/pom.xml
浏览文件 @
e685ef90
...
...
@@ -95,6 +95,11 @@
<artifactId>
apm-springmvc-annotation-4.x-plugin
</artifactId>
<version>
${project.version}
</version>
</dependency>
<dependency>
<groupId>
org.skywalking
</groupId>
<artifactId>
apm-spring-cloud-feign-1.x-plugin
</artifactId>
<version>
${project.version}
</version>
</dependency>
<!-- activation -->
<dependency>
...
...
apm-sniffer/apm-sdk-plugin/feign-default-http-9.x-plugin/src/main/java/org/skywalking/apm/plugin/feign/http/v9/DefaultHttpClientInterceptor.java
浏览文件 @
e685ef90
...
...
@@ -85,12 +85,14 @@ public class DefaultHttpClientInterceptor implements InstanceMethodsAroundInterc
@Override
public
Object
afterMethod
(
EnhancedInstance
objInst
,
Method
method
,
Object
[]
allArguments
,
Class
<?>[]
argumentsTypes
,
Object
ret
)
throws
Throwable
{
Response
response
=
(
Response
)
ret
;
int
statusCode
=
response
.
status
();
if
(
response
!=
null
)
{
int
statusCode
=
response
.
status
();
AbstractSpan
span
=
ContextManager
.
activeSpan
();
if
(
statusCode
>=
400
)
{
span
.
errorOccurred
();
Tags
.
STATUS_CODE
.
set
(
span
,
statusCode
+
""
);
AbstractSpan
span
=
ContextManager
.
activeSpan
();
if
(
statusCode
>=
400
)
{
span
.
errorOccurred
();
Tags
.
STATUS_CODE
.
set
(
span
,
statusCode
+
""
);
}
}
ContextManager
.
stopSpan
();
...
...
apm-sniffer/apm-sdk-plugin/spring-plugins/pom.xml
浏览文件 @
e685ef90
...
...
@@ -14,6 +14,7 @@
<module>
concurrent-util-4.x-plugin
</module>
<module>
resttemplate-4.x-plugin
</module>
<module>
mvc-annotation-4.x-plugin
</module>
<module>
spring-cloud
</module>
</modules>
<packaging>
pom
</packaging>
...
...
apm-sniffer/apm-sdk-plugin/spring-plugins/spring-cloud/netflix-plugins/pom.xml
0 → 100644
浏览文件 @
e685ef90
<?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>
apm-sniffer/apm-sdk-plugin/spring-plugins/spring-cloud/netflix-plugins/spring-cloud-feign-1.x-plugin/pom.xml
0 → 100644
浏览文件 @
e685ef90
<?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>
apm-sniffer/apm-sdk-plugin/spring-plugins/spring-cloud/netflix-plugins/spring-cloud-feign-1.x-plugin/src/main/java/org/skywalking/apm/plugin/spring/cloud/netflix/feign/v11/define/NetflixFeignInstrumentation.java
0 → 100644
浏览文件 @
e685ef90
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
;
}
}
};
}
}
apm-sniffer/apm-sdk-plugin/spring-plugins/spring-cloud/netflix-plugins/spring-cloud-feign-1.x-plugin/src/main/resources/skywalking-plugin.def
0 → 100644
浏览文件 @
e685ef90
spring-cloud-feign-1.x=org.skywalking.apm.plugin.spring.cloud.netflix.feign.v11.define.NetflixFeignInstrumentation
apm-sniffer/apm-sdk-plugin/spring-plugins/spring-cloud/pom.xml
0 → 100644
浏览文件 @
e685ef90
<?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>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录