Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
山不在高_有仙则灵
SkyWalking
提交
257af0bd
S
SkyWalking
项目概览
山不在高_有仙则灵
/
SkyWalking
与 Fork 源项目一致
Fork自
apache / SkyWalking
通知
12
Star
0
Fork
2
代码
文件
提交
分支
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,发现更多精彩内容 >>
提交
257af0bd
编写于
3月 17, 2019
作者:
B
Brandon Fergerson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
moved accepted method types to beginning of url
上级
9a1518a6
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
52 addition
and
26 deletion
+52
-26
apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-commons/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/commons/interceptor/AbstractMethodInterceptor.java
...ng/mvc/commons/interceptor/AbstractMethodInterceptor.java
+2
-1
apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-commons/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/commons/interceptor/RequestMappingMethodInterceptor.java
.../commons/interceptor/RequestMappingMethodInterceptor.java
+18
-11
apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-commons/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/commons/interceptor/RestMappingMethodInterceptor.java
...mvc/commons/interceptor/RestMappingMethodInterceptor.java
+5
-0
apm-sniffer/apm-sdk-plugin/spring-plugins/webflux-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/webflux/v5/AbstractMethodInterceptor.java
...m/plugin/spring/webflux/v5/AbstractMethodInterceptor.java
+4
-3
apm-sniffer/apm-sdk-plugin/spring-plugins/webflux-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/webflux/v5/RequestMappingMethodInterceptor.java
...in/spring/webflux/v5/RequestMappingMethodInterceptor.java
+18
-11
apm-sniffer/apm-sdk-plugin/spring-plugins/webflux-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/webflux/v5/RestMappingMethodInterceptor.java
...lugin/spring/webflux/v5/RestMappingMethodInterceptor.java
+5
-0
未找到文件。
apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-commons/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/commons/interceptor/AbstractMethodInterceptor.java
浏览文件 @
257af0bd
...
...
@@ -44,6 +44,7 @@ import static org.apache.skywalking.apm.plugin.spring.mvc.commons.Constants.RESP
*/
public
abstract
class
AbstractMethodInterceptor
implements
InstanceMethodsAroundInterceptor
{
public
abstract
String
getRequestURL
(
Method
method
);
public
abstract
String
getAcceptedMethodTypes
(
Method
method
);
@Override
public
void
beforeMethod
(
EnhancedInstance
objInst
,
Method
method
,
Object
[]
allArguments
,
Class
<?>[]
argumentsTypes
,
...
...
@@ -67,7 +68,7 @@ public abstract class AbstractMethodInterceptor implements InstanceMethodsAround
if
(
requestURL
==
null
)
{
requestURL
=
getRequestURL
(
method
);
pathMappingCache
.
addPathMapping
(
method
,
requestURL
);
requestURL
=
pathMappingCache
.
findPathMapping
(
method
);
requestURL
=
getAcceptedMethodTypes
(
method
)
+
pathMappingCache
.
findPathMapping
(
method
);
}
operationName
=
requestURL
;
}
...
...
apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-commons/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/commons/interceptor/RequestMappingMethodInterceptor.java
浏览文件 @
257af0bd
...
...
@@ -31,23 +31,30 @@ import java.lang.reflect.Method;
public
class
RequestMappingMethodInterceptor
extends
AbstractMethodInterceptor
{
@Override
public
String
getRequestURL
(
Method
method
)
{
String
Builder
requestURL
=
new
StringBuilder
()
;
String
requestURL
=
""
;
RequestMapping
methodRequestMapping
=
method
.
getAnnotation
(
RequestMapping
.
class
);
if
(
methodRequestMapping
.
value
().
length
>
0
)
{
requestURL
=
methodRequestMapping
.
value
()[
0
];
}
else
if
(
methodRequestMapping
.
path
().
length
>
0
)
{
requestURL
=
methodRequestMapping
.
path
()[
0
];
}
return
requestURL
;
}
@Override
public
String
getAcceptedMethodTypes
(
Method
method
)
{
RequestMapping
methodRequestMapping
=
method
.
getAnnotation
(
RequestMapping
.
class
);
StringBuilder
methodTypes
=
new
StringBuilder
();
if
(
methodRequestMapping
.
method
().
length
>
0
)
{
requestURL
.
append
(
"{"
);
methodTypes
.
append
(
"{"
);
for
(
int
i
=
0
;
i
<
methodRequestMapping
.
method
().
length
;
i
++)
{
requestURL
.
append
(
methodRequestMapping
.
method
()[
i
].
toString
());
methodTypes
.
append
(
methodRequestMapping
.
method
()[
i
].
toString
());
if
(
methodRequestMapping
.
method
().
length
>
(
i
+
1
))
{
requestURL
.
append
(
","
);
methodTypes
.
append
(
","
);
}
}
requestURL
.
append
(
"}"
);
}
if
(
methodRequestMapping
.
value
().
length
>
0
)
{
requestURL
.
append
(
methodRequestMapping
.
value
()[
0
]);
}
else
if
(
methodRequestMapping
.
path
().
length
>
0
)
{
requestURL
.
append
(
methodRequestMapping
.
path
()[
0
]);
methodTypes
.
append
(
"}"
);
}
return
requestURL
.
toString
();
return
methodTypes
.
toString
();
}
}
apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-commons/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/commons/interceptor/RestMappingMethodInterceptor.java
浏览文件 @
257af0bd
...
...
@@ -73,4 +73,9 @@ public class RestMappingMethodInterceptor extends AbstractMethodInterceptor {
}
return
requestURL
;
}
@Override
public
String
getAcceptedMethodTypes
(
Method
method
)
{
return
""
;
}
}
apm-sniffer/apm-sdk-plugin/spring-plugins/webflux-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/webflux/v5/AbstractMethodInterceptor.java
浏览文件 @
257af0bd
...
...
@@ -35,10 +35,11 @@ import static org.apache.skywalking.apm.plugin.spring.mvc.commons.Constants.FORW
import
static
org
.
apache
.
skywalking
.
apm
.
plugin
.
spring
.
mvc
.
commons
.
Constants
.
WEBFLUX_REQUEST_KEY
;
/**
* the abstract method inteceptor
* the abstract method inte
r
ceptor
*/
public
abstract
class
AbstractMethodInterceptor
implements
InstanceMethodsAroundInterceptor
{
public
abstract
String
getRequestURL
(
Method
method
);
public
abstract
String
getAcceptedMethodTypes
(
Method
method
);
@Override
public
void
beforeMethod
(
EnhancedInstance
objInst
,
Method
method
,
Object
[]
allArguments
,
Class
<?>[]
argumentsTypes
,
...
...
@@ -58,7 +59,7 @@ public abstract class AbstractMethodInterceptor implements InstanceMethodsAround
if
(
requestURL
==
null
)
{
requestURL
=
getRequestURL
(
method
);
pathMappingCache
.
addPathMapping
(
method
,
requestURL
);
requestURL
=
pathMappingCache
.
findPathMapping
(
method
);
requestURL
=
getAcceptedMethodTypes
(
method
)
+
pathMappingCache
.
findPathMapping
(
method
);
}
HttpRequest
request
=
(
HttpRequest
)
ContextManager
.
getRuntimeContext
().
get
(
WEBFLUX_REQUEST_KEY
);
...
...
@@ -71,7 +72,7 @@ public abstract class AbstractMethodInterceptor implements InstanceMethodsAround
}
AbstractSpan
span
=
ContextManager
.
createEntrySpan
(
requestURL
,
contextCarrier
);
Tags
.
URL
.
set
(
span
,
request
.
uri
()
.
toString
()
);
Tags
.
URL
.
set
(
span
,
request
.
uri
());
Tags
.
HTTP
.
METHOD
.
set
(
span
,
request
.
method
().
name
());
span
.
setComponent
(
ComponentsDefine
.
SPRING_MVC_ANNOTATION
);
SpanLayer
.
asHttp
(
span
);
...
...
apm-sniffer/apm-sdk-plugin/spring-plugins/webflux-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/webflux/v5/RequestMappingMethodInterceptor.java
浏览文件 @
257af0bd
...
...
@@ -29,23 +29,30 @@ import org.springframework.web.bind.annotation.RequestMapping;
public
class
RequestMappingMethodInterceptor
extends
AbstractMethodInterceptor
{
@Override
public
String
getRequestURL
(
Method
method
)
{
String
Builder
requestURL
=
new
StringBuilder
()
;
String
requestURL
=
""
;
RequestMapping
methodRequestMapping
=
method
.
getAnnotation
(
RequestMapping
.
class
);
if
(
methodRequestMapping
.
value
().
length
>
0
)
{
requestURL
=
methodRequestMapping
.
value
()[
0
];
}
else
if
(
methodRequestMapping
.
path
().
length
>
0
)
{
requestURL
=
methodRequestMapping
.
path
()[
0
];
}
return
requestURL
;
}
@Override
public
String
getAcceptedMethodTypes
(
Method
method
)
{
RequestMapping
methodRequestMapping
=
method
.
getAnnotation
(
RequestMapping
.
class
);
StringBuilder
methodTypes
=
new
StringBuilder
();
if
(
methodRequestMapping
.
method
().
length
>
0
)
{
requestURL
.
append
(
"{"
);
methodTypes
.
append
(
"{"
);
for
(
int
i
=
0
;
i
<
methodRequestMapping
.
method
().
length
;
i
++)
{
requestURL
.
append
(
methodRequestMapping
.
method
()[
i
].
toString
());
methodTypes
.
append
(
methodRequestMapping
.
method
()[
i
].
toString
());
if
(
methodRequestMapping
.
method
().
length
>
(
i
+
1
))
{
requestURL
.
append
(
","
);
methodTypes
.
append
(
","
);
}
}
requestURL
.
append
(
"}"
);
}
if
(
methodRequestMapping
.
value
().
length
>
0
)
{
requestURL
.
append
(
methodRequestMapping
.
value
()[
0
]);
}
else
if
(
methodRequestMapping
.
path
().
length
>
0
)
{
requestURL
.
append
(
methodRequestMapping
.
path
()[
0
]);
methodTypes
.
append
(
"}"
);
}
return
requestURL
.
toString
();
return
methodTypes
.
toString
();
}
}
apm-sniffer/apm-sdk-plugin/spring-plugins/webflux-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/webflux/v5/RestMappingMethodInterceptor.java
浏览文件 @
257af0bd
...
...
@@ -74,4 +74,9 @@ public class RestMappingMethodInterceptor extends AbstractMethodInterceptor {
}
return
requestURL
;
}
@Override
public
String
getAcceptedMethodTypes
(
Method
method
)
{
return
""
;
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录