Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
SkyWalking
提交
705f97f2
S
SkyWalking
项目概览
apache
/
SkyWalking
上一次同步 1 年多
通知
302
Star
21345
Fork
6091
代码
文件
提交
分支
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,体验更适合开发者的 AI 搜索 >>
未验证
提交
705f97f2
编写于
6月 01, 2020
作者:
B
Brandon Fergerson
提交者:
GitHub
6月 01, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Increased Vert.x support (#4840)
上级
deccc262
变更
42
隐藏空白更改
内联
并排
Showing
42 changed file
with
1399 addition
and
129 deletion
+1399
-129
.github/workflows/plugins-test.3.yaml
.github/workflows/plugins-test.3.yaml
+2
-2
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/pom.xml
...pm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/pom.xml
+13
-1
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/ClusteredEventBusSendRemoteInterceptor.java
...plugin/vertx3/ClusteredEventBusSendRemoteInterceptor.java
+1
-1
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/EventBusImplDeliverToHandlerInterceptor.java
...lugin/vertx3/EventBusImplDeliverToHandlerInterceptor.java
+1
-1
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HandlerRegistrationInterceptor.java
...ing/apm/plugin/vertx3/HandlerRegistrationInterceptor.java
+1
-1
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpClientRequestImplHandleExceptionInterceptor.java
...rtx3/HttpClientRequestImplHandleExceptionInterceptor.java
+0
-1
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpClientRequestImplHandleResponseInterceptor.java
...ertx3/HttpClientRequestImplHandleResponseInterceptor.java
+15
-8
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpClientRequestImplInterceptor.java
...g/apm/plugin/vertx3/HttpClientRequestImplInterceptor.java
+36
-18
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpContextHandleDispatchResponseInterceptor.java
.../vertx3/HttpContextHandleDispatchResponseInterceptor.java
+66
-0
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpContextSendRequestInterceptor.java
.../apm/plugin/vertx3/HttpContextSendRequestInterceptor.java
+50
-0
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpServerRequestImplConstructorInterceptor.java
...n/vertx3/HttpServerRequestImplConstructorInterceptor.java
+30
-0
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpServerRequestWrapperConstructorInterceptor.java
...ertx3/HttpServerRequestWrapperConstructorInterceptor.java
+30
-0
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpServerResponseImplHandleExceptionInterceptor.java
...tx3/HttpServerResponseImplHandleExceptionInterceptor.java
+0
-1
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpServerResponseImplInterceptor.java
.../apm/plugin/vertx3/HttpServerResponseImplInterceptor.java
+62
-0
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/RouteStateInterceptor.java
...e/skywalking/apm/plugin/vertx3/RouteStateInterceptor.java
+91
-0
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/RouterImplHandlerInterceptor.java
...lking/apm/plugin/vertx3/RouterImplHandlerInterceptor.java
+4
-7
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/RoutingContextImplBaseConstructorInterceptor.java
.../vertx3/RoutingContextImplBaseConstructorInterceptor.java
+32
-0
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/RoutingContextWrapperConstructorInterceptor.java
...n/vertx3/RoutingContextWrapperConstructorInterceptor.java
+30
-0
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/ServerConnectionHandleMessageInterceptor.java
...ugin/vertx3/ServerConnectionHandleMessageInterceptor.java
+21
-19
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/HttpClientRequestImplHandleResponseInstrumentation.java
...e/HttpClientRequestImplHandleResponseInstrumentation.java
+3
-1
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/HttpClientRequestImplInstrumentation.java
...n/vertx3/define/HttpClientRequestImplInstrumentation.java
+7
-6
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/HttpContextHandleDispatchResponseInstrumentation.java
...ine/HttpContextHandleDispatchResponseInstrumentation.java
+75
-0
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/HttpContextSendRequestInstrumentation.java
.../vertx3/define/HttpContextSendRequestInstrumentation.java
+73
-0
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/HttpServerRequestImplConstructorInstrumentation.java
...fine/HttpServerRequestImplConstructorInstrumentation.java
+67
-0
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/HttpServerRequestWrapperConstructorInstrumentation.java
...e/HttpServerRequestWrapperConstructorInstrumentation.java
+67
-0
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/HttpServerResponseImplHandleExceptionInstrumentation.java
...HttpServerResponseImplHandleExceptionInstrumentation.java
+1
-1
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/HttpServerResponseImplInstrumentation.java
.../vertx3/define/HttpServerResponseImplInstrumentation.java
+18
-5
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/RouteStateInstrumentation.java
...g/apm/plugin/vertx3/define/RouteStateInstrumentation.java
+24
-9
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/RouterContextImplBaseConstructorInstrumentation.java
...fine/RouterContextImplBaseConstructorInstrumentation.java
+67
-0
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/RouterImplHandlerInstrumentation.java
...lugin/vertx3/define/RouterImplHandlerInstrumentation.java
+7
-7
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/RouterImplInstrumentation.java
...g/apm/plugin/vertx3/define/RouterImplInstrumentation.java
+88
-0
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/RoutingContextWrapperConstructorInstrumentation.java
...fine/RoutingContextWrapperConstructorInstrumentation.java
+69
-0
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/ServerConnectionHandleMessageInstrumentation.java
.../define/ServerConnectionHandleMessageInstrumentation.java
+77
-0
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/resources/skywalking-plugin.def
...-core-3.x-plugin/src/main/resources/skywalking-plugin.def
+12
-5
test/plugin/scenarios/vertx-eventbus-3.x-scenario/config/expectedData.yaml
...rios/vertx-eventbus-3.x-scenario/config/expectedData.yaml
+16
-4
test/plugin/scenarios/vertx-eventbus-3.x-scenario/support-version.list
...cenarios/vertx-eventbus-3.x-scenario/support-version.list
+1
-0
test/plugin/scenarios/vertx-web-3.54minus-scenario/config/expectedData.yaml
...ios/vertx-web-3.54minus-scenario/config/expectedData.yaml
+105
-12
test/plugin/scenarios/vertx-web-3.54minus-scenario/src/main/java/org/apache/skywalking/apm/testcase/vertxweb/controller/VertxWebController.java
.../apm/testcase/vertxweb/controller/VertxWebController.java
+13
-3
test/plugin/scenarios/vertx-web-3.6plus-scenario/config/expectedData.yaml
...arios/vertx-web-3.6plus-scenario/config/expectedData.yaml
+105
-12
test/plugin/scenarios/vertx-web-3.6plus-scenario/pom.xml
test/plugin/scenarios/vertx-web-3.6plus-scenario/pom.xml
+1
-1
test/plugin/scenarios/vertx-web-3.6plus-scenario/src/main/java/org/apache/skywalking/apm/testcase/vertxweb/controller/VertxWebController.java
.../apm/testcase/vertxweb/controller/VertxWebController.java
+17
-3
test/plugin/scenarios/vertx-web-3.6plus-scenario/support-version.list
...scenarios/vertx-web-3.6plus-scenario/support-version.list
+1
-0
未找到文件。
.github/workflows/plugins-test.3.yaml
浏览文件 @
705f97f2
...
...
@@ -41,9 +41,9 @@ jobs:
-
{
name
:
'
spring-4.1.x-scenario'
,
title
:
'
Spring
4.1.x-4.2.x
(20)'
}
-
{
name
:
'
spring-4.3.x-scenario'
,
title
:
'
Spring
4.3.x-5.2.x
(54)'
}
-
{
name
:
'
spring-async-scenario'
,
title
:
'
Spring
Async
4.3.x-5.1.x
(35)'
}
-
{
name
:
'
vertx-eventbus-3.x-scenario'
,
title
:
'
Vert.x
EventBus
3.2.0-3.9.
0
(27
)'
}
-
{
name
:
'
vertx-eventbus-3.x-scenario'
,
title
:
'
Vert.x
EventBus
3.2.0-3.9.
1
(28
)'
}
-
{
name
:
'
vertx-web-3.54minus-scenario'
,
title
:
'
Vert.x
Web
3.0.0-3.5.4
(16)'
}
-
{
name
:
'
vertx-web-3.6plus-scenario'
,
title
:
'
Vert.x
Web
3.6.0-3.9.
0
(13
)'
}
-
{
name
:
'
vertx-web-3.6plus-scenario'
,
title
:
'
Vert.x
Web
3.6.0-3.9.
1
(14
)'
}
-
{
name
:
'
mariadb-scenario'
,
title
:
'
Mariadb
2.x
(8)'
}
steps
:
-
uses
:
actions/checkout@v2
...
...
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/pom.xml
浏览文件 @
705f97f2
...
...
@@ -31,7 +31,7 @@
<url>
http://maven.apache.org
</url>
<properties>
<vertx.version>
3.9.
0
</vertx.version>
<vertx.version>
3.9.
1
</vertx.version>
</properties>
<dependencies>
...
...
@@ -41,5 +41,17 @@
<version>
${vertx.version}
</version>
<scope>
provided
</scope>
</dependency>
<dependency>
<groupId>
io.vertx
</groupId>
<artifactId>
vertx-web
</artifactId>
<version>
${vertx.version}
</version>
<scope>
provided
</scope>
</dependency>
<dependency>
<groupId>
io.vertx
</groupId>
<artifactId>
vertx-web-client
</artifactId>
<version>
${vertx.version}
</version>
<scope>
provided
</scope>
</dependency>
</dependencies>
</project>
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/ClusteredEventBusSendRemoteInterceptor.java
浏览文件 @
705f97f2
...
...
@@ -35,7 +35,7 @@ import java.lang.reflect.Method;
public
class
ClusteredEventBusSendRemoteInterceptor
implements
InstanceMethodsAroundInterceptor
{
@Override
@SuppressWarnings
(
"
unchecked
"
)
@SuppressWarnings
(
"
rawtypes
"
)
public
void
beforeMethod
(
EnhancedInstance
objInst
,
Method
method
,
Object
[]
allArguments
,
Class
<?>[]
argumentsTypes
,
MethodInterceptResult
result
)
throws
Throwable
{
ContextManager
.
getRuntimeContext
().
remove
(
VertxContext
.
STOP_SPAN_NECESSARY
+
"."
+
getClass
().
getName
());
...
...
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/EventBusImplDeliverToHandlerInterceptor.java
浏览文件 @
705f97f2
...
...
@@ -32,7 +32,7 @@ import org.apache.skywalking.apm.network.trace.component.ComponentsDefine;
public
class
EventBusImplDeliverToHandlerInterceptor
implements
InstanceMethodsAroundInterceptor
{
@Override
@SuppressWarnings
(
"
unchecked
"
)
@SuppressWarnings
(
"
rawtypes
"
)
public
void
beforeMethod
(
EnhancedInstance
objInst
,
Method
method
,
Object
[]
allArguments
,
Class
<?>[]
argumentsTypes
,
MethodInterceptResult
result
)
throws
Throwable
{
ContextManager
.
getRuntimeContext
().
remove
(
VertxContext
.
STOP_SPAN_NECESSARY
+
"."
+
getClass
().
getName
());
...
...
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HandlerRegistrationInterceptor.java
浏览文件 @
705f97f2
...
...
@@ -34,7 +34,7 @@ import org.apache.skywalking.apm.network.trace.component.ComponentsDefine;
public
class
HandlerRegistrationInterceptor
implements
InstanceMethodsAroundInterceptor
{
@Override
@SuppressWarnings
(
"
unchecked
"
)
@SuppressWarnings
(
"
rawtypes
"
)
public
void
beforeMethod
(
EnhancedInstance
objInst
,
Method
method
,
Object
[]
allArguments
,
Class
<?>[]
argumentsTypes
,
MethodInterceptResult
result
)
throws
Throwable
{
ContextManager
.
getRuntimeContext
().
remove
(
VertxContext
.
STOP_SPAN_NECESSARY
+
"."
+
getClass
().
getName
());
...
...
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpClientRequestImplHandleExceptionInterceptor.java
浏览文件 @
705f97f2
...
...
@@ -28,7 +28,6 @@ import java.lang.reflect.Method;
public
class
HttpClientRequestImplHandleExceptionInterceptor
implements
InstanceMethodsAroundInterceptor
{
@Override
@SuppressWarnings
(
"unchecked"
)
public
void
beforeMethod
(
EnhancedInstance
objInst
,
Method
method
,
Object
[]
allArguments
,
Class
<?>[]
argumentsTypes
,
MethodInterceptResult
result
)
throws
Throwable
{
VertxContext
context
=
(
VertxContext
)
objInst
.
getSkyWalkingDynamicField
();
...
...
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpClientRequestImplHandleResponseInterceptor.java
浏览文件 @
705f97f2
...
...
@@ -27,6 +27,7 @@ import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedI
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult
;
import
org.apache.skywalking.apm.network.trace.component.ComponentsDefine
;
import
org.apache.skywalking.apm.plugin.vertx3.HttpClientRequestImplInterceptor.HttpClientRequestContext
;
import
java.lang.reflect.Method
;
...
...
@@ -36,14 +37,17 @@ public class HttpClientRequestImplHandleResponseInterceptor implements InstanceM
public
void
beforeMethod
(
EnhancedInstance
objInst
,
Method
method
,
Object
[]
allArguments
,
Class
<?>[]
argumentsTypes
,
MethodInterceptResult
result
)
throws
Throwable
{
if
(
VertxContext
.
VERTX_VERSION
<
38
||
allArguments
.
length
==
2
)
{
VertxContext
context
=
(
VertxContext
)
objInst
.
getSkyWalkingDynamicField
();
Tags
.
STATUS_CODE
.
set
(
context
.
getSpan
(),
Integer
.
toString
(((
HttpClientResponse
)
allArguments
[
0
]).
statusCode
()));
context
.
getSpan
().
asyncFinish
();
HttpClientRequestContext
requestContext
=
(
HttpClientRequestContext
)
objInst
.
getSkyWalkingDynamicField
();
if
(!
requestContext
.
usingWebClient
)
{
VertxContext
context
=
requestContext
.
vertxContext
;
Tags
.
STATUS_CODE
.
set
(
context
.
getSpan
(),
Integer
.
toString
(((
HttpClientResponse
)
allArguments
[
0
]).
statusCode
()));
context
.
getSpan
().
asyncFinish
();
AbstractSpan
span
=
ContextManager
.
createLocalSpan
(
"#"
+
context
.
getSpan
().
getOperationName
());
span
.
setComponent
(
ComponentsDefine
.
VERTX
);
SpanLayer
.
asHttp
(
span
);
ContextManager
.
continued
(
context
.
getContextSnapshot
());
AbstractSpan
span
=
ContextManager
.
createLocalSpan
(
"#"
+
context
.
getSpan
().
getOperationName
());
span
.
setComponent
(
ComponentsDefine
.
VERTX
);
SpanLayer
.
asHttp
(
span
);
ContextManager
.
continued
(
context
.
getContextSnapshot
());
}
}
}
...
...
@@ -51,7 +55,10 @@ public class HttpClientRequestImplHandleResponseInterceptor implements InstanceM
public
Object
afterMethod
(
EnhancedInstance
objInst
,
Method
method
,
Object
[]
allArguments
,
Class
<?>[]
argumentsTypes
,
Object
ret
)
throws
Throwable
{
if
(
VertxContext
.
VERTX_VERSION
<
38
||
allArguments
.
length
==
2
)
{
ContextManager
.
stopSpan
();
HttpClientRequestContext
requestContext
=
(
HttpClientRequestContext
)
objInst
.
getSkyWalkingDynamicField
();
if
(!
requestContext
.
usingWebClient
)
{
ContextManager
.
stopSpan
();
}
}
return
ret
;
}
...
...
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpClientRequestImpl
End
Interceptor.java
→
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpClientRequestImplInterceptor.java
浏览文件 @
705f97f2
...
...
@@ -33,14 +33,25 @@ import org.apache.skywalking.apm.network.trace.component.ComponentsDefine;
import
java.lang.reflect.Method
;
public
class
HttpClientRequestImplEndInterceptor
implements
InstanceMethodsAroundInterceptor
{
public
class
HttpClientRequestImplInterceptor
implements
InstanceMethodsAroundInterceptor
{
static
class
HttpClientRequestContext
{
String
remotePeer
;
boolean
usingWebClient
;
VertxContext
vertxContext
;
boolean
sent
;
HttpClientRequestContext
(
String
remotePeer
)
{
this
.
remotePeer
=
remotePeer
;
}
}
public
static
class
Version30XTo33XConstructorInterceptor
implements
InstanceConstructorInterceptor
{
@Override
public
void
onConstruct
(
EnhancedInstance
objInst
,
Object
[]
allArguments
)
{
String
host
=
(
String
)
allArguments
[
2
];
int
port
=
(
Integer
)
allArguments
[
3
];
objInst
.
setSkyWalkingDynamicField
(
host
+
":"
+
port
);
objInst
.
setSkyWalkingDynamicField
(
new
HttpClientRequestContext
(
host
+
":"
+
port
)
);
}
}
...
...
@@ -49,7 +60,7 @@ public class HttpClientRequestImplEndInterceptor implements InstanceMethodsAroun
public
void
onConstruct
(
EnhancedInstance
objInst
,
Object
[]
allArguments
)
{
String
host
=
(
String
)
allArguments
[
3
];
int
port
=
(
Integer
)
allArguments
[
4
];
objInst
.
setSkyWalkingDynamicField
(
host
+
":"
+
port
);
objInst
.
setSkyWalkingDynamicField
(
new
HttpClientRequestContext
(
host
+
":"
+
port
)
);
}
}
...
...
@@ -58,34 +69,41 @@ public class HttpClientRequestImplEndInterceptor implements InstanceMethodsAroun
public
void
onConstruct
(
EnhancedInstance
objInst
,
Object
[]
allArguments
)
{
String
host
=
(
String
)
allArguments
[
4
];
int
port
=
(
Integer
)
allArguments
[
5
];
objInst
.
setSkyWalkingDynamicField
(
host
+
":"
+
port
);
objInst
.
setSkyWalkingDynamicField
(
new
HttpClientRequestContext
(
host
+
":"
+
port
)
);
}
}
@Override
public
void
beforeMethod
(
EnhancedInstance
objInst
,
Method
method
,
Object
[]
allArguments
,
Class
<?>[]
argumentsTypes
,
MethodInterceptResult
result
)
{
HttpClientRequest
request
=
(
HttpClientRequest
)
objInst
;
ContextCarrier
contextCarrier
=
new
ContextCarrier
();
AbstractSpan
span
=
ContextManager
.
createExitSpan
(
toPath
(
request
.
uri
()),
contextCarrier
,
(
String
)
objInst
.
getSkyWalkingDynamicField
());
span
.
setComponent
(
ComponentsDefine
.
VERTX
);
SpanLayer
.
asHttp
(
span
);
Tags
.
HTTP
.
METHOD
.
set
(
span
,
request
.
method
().
toString
());
Tags
.
URL
.
set
(
span
,
request
.
uri
());
HttpClientRequestContext
requestContext
=
(
HttpClientRequestContext
)
objInst
.
getSkyWalkingDynamicField
();
if
(!
requestContext
.
sent
)
{
HttpClientRequest
request
=
(
HttpClientRequest
)
objInst
;
ContextCarrier
contextCarrier
=
new
ContextCarrier
();
AbstractSpan
span
=
ContextManager
.
createExitSpan
(
toPath
(
request
.
uri
()),
contextCarrier
,
requestContext
.
remotePeer
);
span
.
setComponent
(
ComponentsDefine
.
VERTX
);
SpanLayer
.
asHttp
(
span
);
Tags
.
HTTP
.
METHOD
.
set
(
span
,
request
.
method
().
toString
());
Tags
.
URL
.
set
(
span
,
request
.
uri
());
CarrierItem
next
=
contextCarrier
.
items
();
while
(
next
.
hasNext
())
{
next
=
next
.
next
();
request
.
headers
().
add
(
next
.
getHeadKey
(),
next
.
getHeadValue
());
CarrierItem
next
=
contextCarrier
.
items
();
while
(
next
.
hasNext
())
{
next
=
next
.
next
();
request
.
headers
().
add
(
next
.
getHeadKey
(),
next
.
getHeadValue
());
}
requestContext
.
vertxContext
=
new
VertxContext
(
ContextManager
.
capture
(),
span
.
prepareForAsync
());
}
objInst
.
setSkyWalkingDynamicField
(
new
VertxContext
(
ContextManager
.
capture
(),
span
.
prepareForAsync
()));
}
@Override
public
Object
afterMethod
(
EnhancedInstance
objInst
,
Method
method
,
Object
[]
allArguments
,
Class
<?>[]
argumentsTypes
,
Object
ret
)
{
ContextManager
.
stopSpan
();
HttpClientRequestContext
requestContext
=
(
HttpClientRequestContext
)
objInst
.
getSkyWalkingDynamicField
();
if
(!
requestContext
.
sent
)
{
requestContext
.
sent
=
true
;
ContextManager
.
stopSpan
();
}
return
ret
;
}
...
...
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpContextHandleDispatchResponseInterceptor.java
0 → 100644
浏览文件 @
705f97f2
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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.apache.skywalking.apm.plugin.vertx3
;
import
io.vertx.core.http.HttpClientRequest
;
import
io.vertx.ext.web.client.impl.HttpContext
;
import
org.apache.skywalking.apm.agent.core.context.ContextManager
;
import
org.apache.skywalking.apm.agent.core.context.tag.Tags
;
import
org.apache.skywalking.apm.agent.core.context.trace.AbstractSpan
;
import
org.apache.skywalking.apm.agent.core.context.trace.SpanLayer
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult
;
import
org.apache.skywalking.apm.network.trace.component.ComponentsDefine
;
import
org.apache.skywalking.apm.plugin.vertx3.HttpClientRequestImplInterceptor.HttpClientRequestContext
;
import
java.lang.reflect.Method
;
public
class
HttpContextHandleDispatchResponseInterceptor
implements
InstanceMethodsAroundInterceptor
{
@Override
@SuppressWarnings
(
"rawtypes"
)
public
void
beforeMethod
(
EnhancedInstance
objInst
,
Method
method
,
Object
[]
allArguments
,
Class
<?>[]
argumentsTypes
,
MethodInterceptResult
result
)
throws
Throwable
{
HttpContext
httpContext
=
(
HttpContext
)
objInst
;
HttpClientRequest
clientRequest
=
httpContext
.
clientRequest
();
VertxContext
context
=
((
HttpClientRequestContext
)
((
EnhancedInstance
)
clientRequest
)
.
getSkyWalkingDynamicField
()).
vertxContext
;
Tags
.
STATUS_CODE
.
set
(
context
.
getSpan
(),
Integer
.
toString
(
httpContext
.
clientResponse
().
statusCode
()));
context
.
getSpan
().
asyncFinish
();
AbstractSpan
span
=
ContextManager
.
createLocalSpan
(
"#"
+
context
.
getSpan
().
getOperationName
());
span
.
setComponent
(
ComponentsDefine
.
VERTX
);
SpanLayer
.
asHttp
(
span
);
ContextManager
.
continued
(
context
.
getContextSnapshot
());
}
@Override
public
Object
afterMethod
(
EnhancedInstance
objInst
,
Method
method
,
Object
[]
allArguments
,
Class
<?>[]
argumentsTypes
,
Object
ret
)
throws
Throwable
{
ContextManager
.
stopSpan
();
return
ret
;
}
@Override
public
void
handleMethodException
(
EnhancedInstance
objInst
,
Method
method
,
Object
[]
allArguments
,
Class
<?>[]
argumentsTypes
,
Throwable
t
)
{
ContextManager
.
activeSpan
().
errorOccurred
().
log
(
t
);
}
}
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpContextSendRequestInterceptor.java
0 → 100644
浏览文件 @
705f97f2
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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.apache.skywalking.apm.plugin.vertx3
;
import
org.apache.skywalking.apm.agent.core.context.ContextManager
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult
;
import
org.apache.skywalking.apm.plugin.vertx3.HttpClientRequestImplInterceptor.HttpClientRequestContext
;
import
java.lang.reflect.Method
;
public
class
HttpContextSendRequestInterceptor
implements
InstanceMethodsAroundInterceptor
{
@Override
public
void
beforeMethod
(
EnhancedInstance
objInst
,
Method
method
,
Object
[]
allArguments
,
Class
<?>[]
argumentsTypes
,
MethodInterceptResult
result
)
throws
Throwable
{
HttpClientRequestContext
requestContext
=
(
HttpClientRequestContext
)
((
EnhancedInstance
)
allArguments
[
0
])
.
getSkyWalkingDynamicField
();
requestContext
.
usingWebClient
=
true
;
}
@Override
public
Object
afterMethod
(
EnhancedInstance
objInst
,
Method
method
,
Object
[]
allArguments
,
Class
<?>[]
argumentsTypes
,
Object
ret
)
throws
Throwable
{
return
ret
;
}
@Override
public
void
handleMethodException
(
EnhancedInstance
objInst
,
Method
method
,
Object
[]
allArguments
,
Class
<?>[]
argumentsTypes
,
Throwable
t
)
{
ContextManager
.
activeSpan
().
errorOccurred
().
log
(
t
);
}
}
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpServerRequestImplConstructorInterceptor.java
0 → 100644
浏览文件 @
705f97f2
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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.apache.skywalking.apm.plugin.vertx3
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceConstructorInterceptor
;
public
class
HttpServerRequestImplConstructorInterceptor
implements
InstanceConstructorInterceptor
{
@Override
public
void
onConstruct
(
EnhancedInstance
objInst
,
Object
[]
allArguments
)
{
objInst
.
setSkyWalkingDynamicField
(
allArguments
[
0
]);
}
}
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpServerRequestWrapperConstructorInterceptor.java
0 → 100644
浏览文件 @
705f97f2
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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.apache.skywalking.apm.plugin.vertx3
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceConstructorInterceptor
;
public
class
HttpServerRequestWrapperConstructorInterceptor
implements
InstanceConstructorInterceptor
{
@Override
public
void
onConstruct
(
EnhancedInstance
objInst
,
Object
[]
allArguments
)
{
objInst
.
setSkyWalkingDynamicField
(((
EnhancedInstance
)
allArguments
[
0
]).
getSkyWalkingDynamicField
());
}
}
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpServerResponseImplHandleExceptionInterceptor.java
浏览文件 @
705f97f2
...
...
@@ -28,7 +28,6 @@ import java.lang.reflect.Method;
public
class
HttpServerResponseImplHandleExceptionInterceptor
implements
InstanceMethodsAroundInterceptor
{
@Override
@SuppressWarnings
(
"unchecked"
)
public
void
beforeMethod
(
EnhancedInstance
objInst
,
Method
method
,
Object
[]
allArguments
,
Class
<?>[]
argumentsTypes
,
MethodInterceptResult
result
)
throws
Throwable
{
VertxContext
context
=
(
VertxContext
)
objInst
.
getSkyWalkingDynamicField
();
...
...
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpServerResponseImplInterceptor.java
0 → 100644
浏览文件 @
705f97f2
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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.apache.skywalking.apm.plugin.vertx3
;
import
io.netty.buffer.ByteBuf
;
import
io.vertx.core.http.HttpServerResponse
;
import
org.apache.skywalking.apm.agent.core.context.ContextManager
;
import
org.apache.skywalking.apm.agent.core.context.tag.Tags
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceConstructorInterceptor
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult
;
import
java.lang.reflect.Method
;
public
class
HttpServerResponseImplInterceptor
implements
InstanceMethodsAroundInterceptor
,
InstanceConstructorInterceptor
{
@Override
public
void
onConstruct
(
EnhancedInstance
objInst
,
Object
[]
allArguments
)
{
objInst
.
setSkyWalkingDynamicField
(((
EnhancedInstance
)
allArguments
[
1
]).
getSkyWalkingDynamicField
());
}
@Override
public
void
beforeMethod
(
EnhancedInstance
objInst
,
Method
method
,
Object
[]
allArguments
,
Class
<?>[]
argumentsTypes
,
MethodInterceptResult
result
)
throws
Throwable
{
if
((
VertxContext
.
VERTX_VERSION
<
36
&&
allArguments
[
0
]
instanceof
ByteBuf
)
||
((
VertxContext
.
VERTX_VERSION
>=
36
&&
VertxContext
.
VERTX_VERSION
<=
37
)
||
allArguments
.
length
==
2
))
{
VertxContext
context
=
(
VertxContext
)
objInst
.
getSkyWalkingDynamicField
();
Tags
.
STATUS_CODE
.
set
(
context
.
getSpan
(),
Integer
.
toString
(((
HttpServerResponse
)
objInst
).
getStatusCode
()));
context
.
getSpan
().
asyncFinish
();
}
}
@Override
public
Object
afterMethod
(
EnhancedInstance
objInst
,
Method
method
,
Object
[]
allArguments
,
Class
<?>[]
argumentsTypes
,
Object
ret
)
throws
Throwable
{
return
ret
;
}
@Override
public
void
handleMethodException
(
EnhancedInstance
objInst
,
Method
method
,
Object
[]
allArguments
,
Class
<?>[]
argumentsTypes
,
Throwable
t
)
{
ContextManager
.
activeSpan
().
errorOccurred
().
log
(
t
);
}
}
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/RouteStateInterceptor.java
0 → 100644
浏览文件 @
705f97f2
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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.apache.skywalking.apm.plugin.vertx3
;
import
io.vertx.core.Handler
;
import
io.vertx.ext.web.RoutingContext
;
import
io.vertx.ext.web.impl.RoutingContextImplBase
;
import
org.apache.skywalking.apm.agent.core.context.ContextManager
;
import
org.apache.skywalking.apm.agent.core.context.trace.AbstractSpan
;
import
org.apache.skywalking.apm.agent.core.context.trace.SpanLayer
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceConstructorInterceptor
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult
;
import
org.apache.skywalking.apm.network.trace.component.ComponentsDefine
;
import
java.lang.reflect.Field
;
import
java.lang.reflect.Method
;
import
java.util.List
;
import
java.util.concurrent.atomic.AtomicInteger
;
public
class
RouteStateInterceptor
implements
InstanceMethodsAroundInterceptor
,
InstanceConstructorInterceptor
{
@Override
public
void
onConstruct
(
EnhancedInstance
objInst
,
Object
[]
allArguments
)
{
if
(
allArguments
.
length
>
8
)
{
objInst
.
setSkyWalkingDynamicField
(
allArguments
[
8
]);
}
else
if
(
VertxContext
.
VERTX_VERSION
>=
35
&&
VertxContext
.
VERTX_VERSION
<=
38.2
)
{
try
{
Field
field
=
objInst
.
getClass
().
getDeclaredField
(
"contextHandlers"
);
field
.
setAccessible
(
true
);
objInst
.
setSkyWalkingDynamicField
(
field
.
get
(
objInst
));
}
catch
(
Throwable
e
)
{
throw
new
RuntimeException
(
e
);
}
}
}
@Override
@SuppressWarnings
(
"unchecked"
)
public
void
beforeMethod
(
EnhancedInstance
objInst
,
Method
method
,
Object
[]
allArguments
,
Class
<?>[]
argumentsTypes
,
MethodInterceptResult
result
)
throws
Throwable
{
RoutingContextImplBase
routingContext
=
(
RoutingContextImplBase
)
allArguments
[
0
];
List
<
Handler
<
RoutingContext
>>
contextHandlers
=
(
List
<
Handler
<
RoutingContext
>>)
objInst
.
getSkyWalkingDynamicField
();
AtomicInteger
currentContextIndex
=
(
AtomicInteger
)
((
EnhancedInstance
)
routingContext
).
getSkyWalkingDynamicField
();
int
handlerContextIndex
=
currentContextIndex
.
get
();
if
(
VertxContext
.
VERTX_VERSION
>=
35
&&
contextHandlers
.
size
()
>
1
)
{
currentContextIndex
.
getAndIncrement
();
//3.5+ has possibility for multiple handlers
}
String
contextName
=
contextHandlers
.
get
(
handlerContextIndex
).
getClass
().
getCanonicalName
();
int
lambdaOffset
=
contextName
.
indexOf
(
"$$Lambda$"
);
if
(
lambdaOffset
>
0
)
contextName
=
contextName
.
substring
(
0
,
lambdaOffset
+
9
);
AbstractSpan
span
=
ContextManager
.
createLocalSpan
(
String
.
format
(
"%s.handle(RoutingContext)"
,
contextName
));
Object
connection
=
((
EnhancedInstance
)
routingContext
.
request
()).
getSkyWalkingDynamicField
();
VertxContext
vertxContext
=
(
VertxContext
)
((
EnhancedInstance
)
connection
).
getSkyWalkingDynamicField
();
ContextManager
.
continued
(
vertxContext
.
getContextSnapshot
());
span
.
setComponent
(
ComponentsDefine
.
VERTX
);
SpanLayer
.
asHttp
(
span
);
}
@Override
public
Object
afterMethod
(
EnhancedInstance
objInst
,
Method
method
,
Object
[]
allArguments
,
Class
<?>[]
argumentsTypes
,
Object
ret
)
throws
Throwable
{
ContextManager
.
stopSpan
();
return
ret
;
}
@Override
public
void
handleMethodException
(
EnhancedInstance
objInst
,
Method
method
,
Object
[]
allArguments
,
Class
<?>[]
argumentsTypes
,
Throwable
t
)
{
ContextManager
.
activeSpan
().
errorOccurred
().
log
(
t
);
}
}
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/
HttpServerResponseImplEnd
Interceptor.java
→
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/
RouterImplHandler
Interceptor.java
浏览文件 @
705f97f2
...
...
@@ -18,24 +18,21 @@
package
org.apache.skywalking.apm.plugin.vertx3
;
import
io.vertx.core.http.HttpServerResponse
;
import
org.apache.skywalking.apm.agent.core.context.ContextManager
;
import
org.apache.skywalking.apm.agent.core.context.tag.Tags
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult
;
import
java.lang.reflect.Method
;
import
java.util.Collections
;
public
class
HttpServerResponseImplEnd
Interceptor
implements
InstanceMethodsAroundInterceptor
{
public
class
RouterImplHandler
Interceptor
implements
InstanceMethodsAroundInterceptor
{
@Override
public
void
beforeMethod
(
EnhancedInstance
objInst
,
Method
method
,
Object
[]
allArguments
,
Class
<?>[]
argumentsTypes
,
MethodInterceptResult
result
)
throws
Throwable
{
if
(
VertxContext
.
VERTX_VERSION
<=
37
||
allArguments
.
length
==
2
)
{
VertxContext
context
=
(
VertxContext
)
objInst
.
getSkyWalkingDynamicField
();
Tags
.
STATUS_CODE
.
set
(
context
.
getSpan
(),
Integer
.
toString
(((
HttpServerResponse
)
objInst
).
getStatusCode
()));
context
.
getSpan
().
asyncFinish
();
if
(
VertxContext
.
VERTX_VERSION
<
35
)
{
objInst
.
setSkyWalkingDynamicField
(
Collections
.
singletonList
(
allArguments
[
0
]));
}
}
...
...
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/RoutingContextImplBaseConstructorInterceptor.java
0 → 100644
浏览文件 @
705f97f2
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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.apache.skywalking.apm.plugin.vertx3
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceConstructorInterceptor
;
import
java.util.concurrent.atomic.AtomicInteger
;
public
class
RoutingContextImplBaseConstructorInterceptor
implements
InstanceConstructorInterceptor
{
@Override
public
void
onConstruct
(
EnhancedInstance
objInst
,
Object
[]
allArguments
)
{
objInst
.
setSkyWalkingDynamicField
(
new
AtomicInteger
(
0
));
}
}
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/RoutingContextWrapperConstructorInterceptor.java
0 → 100644
浏览文件 @
705f97f2
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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.apache.skywalking.apm.plugin.vertx3
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceConstructorInterceptor
;
public
class
RoutingContextWrapperConstructorInterceptor
implements
InstanceConstructorInterceptor
{
@Override
public
void
onConstruct
(
EnhancedInstance
objInst
,
Object
[]
allArguments
)
{
objInst
.
setSkyWalkingDynamicField
(((
EnhancedInstance
)
allArguments
[
3
]).
getSkyWalkingDynamicField
());
}
}
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/
RouterImplAccept
Interceptor.java
→
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/
ServerConnectionHandleMessage
Interceptor.java
浏览文件 @
705f97f2
...
...
@@ -18,7 +18,7 @@
package
org.apache.skywalking.apm.plugin.vertx3
;
import
io.
vertx.core.http.HttpServer
Request
;
import
io.
netty.handler.codec.http.Http
Request
;
import
org.apache.skywalking.apm.agent.core.context.CarrierItem
;
import
org.apache.skywalking.apm.agent.core.context.ContextCarrier
;
import
org.apache.skywalking.apm.agent.core.context.ContextManager
;
...
...
@@ -32,35 +32,37 @@ import org.apache.skywalking.apm.network.trace.component.ComponentsDefine;
import
java.lang.reflect.Method
;
public
class
RouterImplAccept
Interceptor
implements
InstanceMethodsAroundInterceptor
{
public
class
ServerConnectionHandleMessage
Interceptor
implements
InstanceMethodsAroundInterceptor
{
@Override
@SuppressWarnings
(
"unchecked"
)
public
void
beforeMethod
(
EnhancedInstance
objInst
,
Method
method
,
Object
[]
allArguments
,
Class
<?>[]
argumentsTypes
,
MethodInterceptResult
result
)
throws
Throwable
{
HttpServerRequest
request
=
(
HttpServerRequest
)
allArguments
[
0
];
ContextCarrier
contextCarrier
=
new
ContextCarrier
();
CarrierItem
next
=
contextCarrier
.
items
();
while
(
next
.
hasNext
())
{
next
=
next
.
next
();
next
.
setHeadValue
(
request
.
headers
().
get
(
next
.
getHeadKey
()));
request
.
headers
().
remove
(
next
.
getHeadKey
());
}
if
(
allArguments
[
0
]
instanceof
HttpRequest
)
{
HttpRequest
request
=
(
HttpRequest
)
allArguments
[
0
];
ContextCarrier
contextCarrier
=
new
ContextCarrier
();
CarrierItem
next
=
contextCarrier
.
items
();
while
(
next
.
hasNext
())
{
next
=
next
.
next
();
next
.
setHeadValue
(
request
.
headers
().
get
(
next
.
getHeadKey
()));
request
.
headers
().
remove
(
next
.
getHeadKey
());
}
AbstractSpan
span
=
ContextManager
.
createEntrySpan
(
toPath
(
request
.
u
ri
()),
contextCarrier
);
span
.
setComponent
(
ComponentsDefine
.
VERTX
);
SpanLayer
.
asHttp
(
span
);
Tags
.
HTTP
.
METHOD
.
set
(
span
,
request
.
m
ethod
().
toString
());
Tags
.
URL
.
set
(
span
,
request
.
u
ri
());
AbstractSpan
span
=
ContextManager
.
createEntrySpan
(
toPath
(
request
.
getU
ri
()),
contextCarrier
);
span
.
setComponent
(
ComponentsDefine
.
VERTX
);
SpanLayer
.
asHttp
(
span
);
Tags
.
HTTP
.
METHOD
.
set
(
span
,
request
.
getM
ethod
().
toString
());
Tags
.
URL
.
set
(
span
,
request
.
getU
ri
());
((
EnhancedInstance
)
request
.
response
()).
setSkyWalkingDynamicField
(
new
VertxContext
(
ContextManager
.
capture
(),
span
.
prepareForAsync
()));
objInst
.
setSkyWalkingDynamicField
(
new
VertxContext
(
ContextManager
.
capture
(),
span
.
prepareForAsync
()));
}
}
@Override
public
Object
afterMethod
(
EnhancedInstance
objInst
,
Method
method
,
Object
[]
allArguments
,
Class
<?>[]
argumentsTypes
,
Object
ret
)
throws
Throwable
{
ContextManager
.
stopSpan
();
if
(
allArguments
[
0
]
instanceof
HttpRequest
)
{
ContextManager
.
stopSpan
();
}
return
ret
;
}
...
...
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/HttpClientRequestImplHandleResponseInstrumentation.java
浏览文件 @
705f97f2
...
...
@@ -31,7 +31,9 @@ import static net.bytebuddy.matcher.ElementMatchers.named;
/**
* {@link HttpClientRequestImplHandleResponseInstrumentation} enhance the <code>handleResponse</code> method in
* <code>io.vertx.core.http.impl.HttpClientRequestImpl</code> class by
* <code>HttpClientRequestImplHandleResponseInterceptor</code> class
* <code>HttpClientRequestImplHandleResponseInterceptor</code> class.
*
* Ver. 3.0.0 - 3.5.4
*/
public
class
HttpClientRequestImplHandleResponseInstrumentation
extends
ClassInstanceMethodsEnhancePluginDefine
{
...
...
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/HttpClientRequestImpl
End
Instrumentation.java
→
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/HttpClientRequestImplInstrumentation.java
浏览文件 @
705f97f2
...
...
@@ -28,17 +28,17 @@ import org.apache.skywalking.apm.agent.core.plugin.match.NameMatch;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
named
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
takesArgument
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
takesArguments
;
/**
* {@link HttpClientRequestImpl
EndInstrumentation} enhance the <code>end</code> method
in
* {@link HttpClientRequestImpl
Instrumentation} enhance the <code>end/sendHead</code> methods
in
* <code>io.vertx.core.http.impl.HttpClientRequestImpl</code> class by
* <code>HttpClientRequestImpl
End
Interceptor</code> class
* <code>HttpClientRequestImplInterceptor</code> class
*/
public
class
HttpClientRequestImpl
End
Instrumentation
extends
ClassInstanceMethodsEnhancePluginDefine
{
public
class
HttpClientRequestImplInstrumentation
extends
ClassInstanceMethodsEnhancePluginDefine
{
private
static
final
String
ENHANCE_CLASS
=
"io.vertx.core.http.impl.HttpClientRequestImpl"
;
private
static
final
String
ENHANCE_METHOD
=
"end"
;
private
static
final
String
INTERCEPT_CLASS
=
"org.apache.skywalking.apm.plugin.vertx3.HttpClientRequestImplEndInterceptor"
;
private
static
final
String
INTERCEPT_CLASS
=
"org.apache.skywalking.apm.plugin.vertx3.HttpClientRequestImplInterceptor"
;
@Override
public
ConstructorInterceptPoint
[]
getConstructorsInterceptPoints
()
{
...
...
@@ -85,7 +85,8 @@ public class HttpClientRequestImplEndInstrumentation extends ClassInstanceMethod
new
InstanceMethodsInterceptPoint
()
{
@Override
public
ElementMatcher
<
MethodDescription
>
getMethodsMatcher
()
{
return
named
(
ENHANCE_METHOD
);
return
named
(
"end"
)
.
or
(
named
(
"sendHead"
).
and
(
takesArguments
(
1
)));
}
@Override
...
...
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/HttpContextHandleDispatchResponseInstrumentation.java
0 → 100644
浏览文件 @
705f97f2
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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.apache.skywalking.apm.plugin.vertx3.define
;
import
net.bytebuddy.description.method.MethodDescription
;
import
net.bytebuddy.matcher.ElementMatcher
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine
;
import
org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch
;
import
org.apache.skywalking.apm.agent.core.plugin.match.NameMatch
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
named
;
/**
* {@link HttpContextHandleDispatchResponseInstrumentation} enhance the <code>handleDispatchResponse</code> method in
* <code>io.vertx.ext.web.client.impl.HttpContext</code> class by
* <code>HttpContextHandleDispatchResponseInterceptor</code> class.
*
* Ver. 3.6.0+
*/
public
class
HttpContextHandleDispatchResponseInstrumentation
extends
ClassInstanceMethodsEnhancePluginDefine
{
private
static
final
String
ENHANCE_CLASS
=
"io.vertx.ext.web.client.impl.HttpContext"
;
private
static
final
String
ENHANCE_METHOD
=
"handleDispatchResponse"
;
private
static
final
String
INTERCEPT_CLASS
=
"org.apache.skywalking.apm.plugin.vertx3.HttpContextHandleDispatchResponseInterceptor"
;
@Override
public
ConstructorInterceptPoint
[]
getConstructorsInterceptPoints
()
{
return
new
ConstructorInterceptPoint
[
0
];
}
@Override
public
InstanceMethodsInterceptPoint
[]
getInstanceMethodsInterceptPoints
()
{
return
new
InstanceMethodsInterceptPoint
[]
{
new
InstanceMethodsInterceptPoint
()
{
@Override
public
ElementMatcher
<
MethodDescription
>
getMethodsMatcher
()
{
return
named
(
ENHANCE_METHOD
);
}
@Override
public
String
getMethodsInterceptor
()
{
return
INTERCEPT_CLASS
;
}
@Override
public
boolean
isOverrideArgs
()
{
return
false
;
}
}
};
}
@Override
protected
ClassMatch
enhanceClass
()
{
return
NameMatch
.
byName
(
ENHANCE_CLASS
);
}
}
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/HttpContextSendRequestInstrumentation.java
0 → 100644
浏览文件 @
705f97f2
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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.apache.skywalking.apm.plugin.vertx3.define
;
import
net.bytebuddy.description.method.MethodDescription
;
import
net.bytebuddy.matcher.ElementMatcher
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine
;
import
org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch
;
import
org.apache.skywalking.apm.agent.core.plugin.match.NameMatch
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
named
;
/**
* {@link HttpContextSendRequestInstrumentation} enhance the <code>sendRequest</code> method in
* <code>io.vertx.ext.web.client.impl.HttpContext</code> class by
* <code>HttpContextSendRequestInterceptor</code> class.
*/
public
class
HttpContextSendRequestInstrumentation
extends
ClassInstanceMethodsEnhancePluginDefine
{
private
static
final
String
ENHANCE_CLASS
=
"io.vertx.ext.web.client.impl.HttpContext"
;
private
static
final
String
ENHANCE_METHOD
=
"sendRequest"
;
private
static
final
String
INTERCEPT_CLASS
=
"org.apache.skywalking.apm.plugin.vertx3.HttpContextSendRequestInterceptor"
;
@Override
public
ConstructorInterceptPoint
[]
getConstructorsInterceptPoints
()
{
return
new
ConstructorInterceptPoint
[
0
];
}
@Override
public
InstanceMethodsInterceptPoint
[]
getInstanceMethodsInterceptPoints
()
{
return
new
InstanceMethodsInterceptPoint
[]
{
new
InstanceMethodsInterceptPoint
()
{
@Override
public
ElementMatcher
<
MethodDescription
>
getMethodsMatcher
()
{
return
named
(
ENHANCE_METHOD
);
}
@Override
public
String
getMethodsInterceptor
()
{
return
INTERCEPT_CLASS
;
}
@Override
public
boolean
isOverrideArgs
()
{
return
false
;
}
}
};
}
@Override
protected
ClassMatch
enhanceClass
()
{
return
NameMatch
.
byName
(
ENHANCE_CLASS
);
}
}
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/HttpServerRequestImplConstructorInstrumentation.java
0 → 100644
浏览文件 @
705f97f2
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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.apache.skywalking.apm.plugin.vertx3.define
;
import
net.bytebuddy.description.method.MethodDescription
;
import
net.bytebuddy.matcher.ElementMatcher
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine
;
import
org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch
;
import
org.apache.skywalking.apm.agent.core.plugin.match.NameMatch
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
any
;
/**
* {@link HttpServerRequestImplConstructorInstrumentation} enhance the constructor in
* <code>io.vertx.core.http.impl.HttpServerRequestImpl</code> class by
* <code>HttpServerRequestImplConstructorInterceptor</code> class.
*/
public
class
HttpServerRequestImplConstructorInstrumentation
extends
ClassInstanceMethodsEnhancePluginDefine
{
private
static
final
String
ENHANCE_CLASS
=
"io.vertx.core.http.impl.HttpServerRequestImpl"
;
private
static
final
String
INTERCEPT_CLASS
=
"org.apache.skywalking.apm.plugin.vertx3.HttpServerRequestImplConstructorInterceptor"
;
@Override
public
ConstructorInterceptPoint
[]
getConstructorsInterceptPoints
()
{
return
new
ConstructorInterceptPoint
[]
{
new
ConstructorInterceptPoint
()
{
@Override
public
ElementMatcher
<
MethodDescription
>
getConstructorMatcher
()
{
return
any
();
}
@Override
public
String
getConstructorInterceptor
()
{
return
INTERCEPT_CLASS
;
}
}
};
}
@Override
public
InstanceMethodsInterceptPoint
[]
getInstanceMethodsInterceptPoints
()
{
return
new
InstanceMethodsInterceptPoint
[
0
];
}
@Override
protected
ClassMatch
enhanceClass
()
{
return
NameMatch
.
byName
(
ENHANCE_CLASS
);
}
}
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/HttpServerRequestWrapperConstructorInstrumentation.java
0 → 100644
浏览文件 @
705f97f2
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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.apache.skywalking.apm.plugin.vertx3.define
;
import
net.bytebuddy.description.method.MethodDescription
;
import
net.bytebuddy.matcher.ElementMatcher
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine
;
import
org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch
;
import
org.apache.skywalking.apm.agent.core.plugin.match.NameMatch
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
any
;
/**
* {@link HttpServerRequestWrapperConstructorInstrumentation} enhance the constructor in
* <code>io.vertx.ext.web.impl.HttpServerRequestWrapper</code> class by
* <code>HttpServerRequestWrapperConstructorInterceptor</code> class.
*/
public
class
HttpServerRequestWrapperConstructorInstrumentation
extends
ClassInstanceMethodsEnhancePluginDefine
{
private
static
final
String
ENHANCE_CLASS
=
"io.vertx.ext.web.impl.HttpServerRequestWrapper"
;
private
static
final
String
INTERCEPT_CLASS
=
"org.apache.skywalking.apm.plugin.vertx3.HttpServerRequestWrapperConstructorInterceptor"
;
@Override
public
ConstructorInterceptPoint
[]
getConstructorsInterceptPoints
()
{
return
new
ConstructorInterceptPoint
[]
{
new
ConstructorInterceptPoint
()
{
@Override
public
ElementMatcher
<
MethodDescription
>
getConstructorMatcher
()
{
return
any
();
}
@Override
public
String
getConstructorInterceptor
()
{
return
INTERCEPT_CLASS
;
}
}
};
}
@Override
public
InstanceMethodsInterceptPoint
[]
getInstanceMethodsInterceptPoints
()
{
return
new
InstanceMethodsInterceptPoint
[
0
];
}
@Override
protected
ClassMatch
enhanceClass
()
{
return
NameMatch
.
byName
(
ENHANCE_CLASS
);
}
}
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/HttpServerResponseImplHandleExceptionInstrumentation.java
浏览文件 @
705f97f2
...
...
@@ -31,7 +31,7 @@ import static net.bytebuddy.matcher.ElementMatchers.named;
/**
* {@link HttpServerResponseImplHandleExceptionInstrumentation} enhance the <code>handleException</code> method in
* <code>io.vertx.core.http.impl.HttpServerResponseImpl</code> class by
* <code>HttpServerResponseImplHandleExceptionInterceptor</code> class
* <code>HttpServerResponseImplHandleExceptionInterceptor</code> class
.
*/
public
class
HttpServerResponseImplHandleExceptionInstrumentation
extends
ClassInstanceMethodsEnhancePluginDefine
{
...
...
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/HttpServerResponseImpl
End
Instrumentation.java
→
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/HttpServerResponseImplInstrumentation.java
浏览文件 @
705f97f2
...
...
@@ -26,22 +26,35 @@ import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInst
import
org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch
;
import
org.apache.skywalking.apm.agent.core.plugin.match.NameMatch
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
any
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
named
;
import
static
org
.
apache
.
skywalking
.
apm
.
agent
.
core
.
plugin
.
bytebuddy
.
ArgumentTypeNameMatch
.
takesArgumentWithType
;
/**
* {@link HttpServerResponseImpl
EndInstrumentation} enhance the <code>
end</code> method in
* {@link HttpServerResponseImpl
Instrumentation} enhance the <code>end0/
end</code> method in
* <code>io.vertx.core.http.impl.HttpServerResponseImpl</code> class by
* <code>HttpServerResponseImpl
End
Interceptor</code> class
* <code>HttpServerResponseImplInterceptor</code> class
*/
public
class
HttpServerResponseImpl
End
Instrumentation
extends
ClassInstanceMethodsEnhancePluginDefine
{
public
class
HttpServerResponseImplInstrumentation
extends
ClassInstanceMethodsEnhancePluginDefine
{
private
static
final
String
ENHANCE_CLASS
=
"io.vertx.core.http.impl.HttpServerResponseImpl"
;
private
static
final
String
INTERCEPTOR_CLASS
=
"org.apache.skywalking.apm.plugin.vertx3.HttpServerResponseImpl
End
Interceptor"
;
private
static
final
String
INTERCEPTOR_CLASS
=
"org.apache.skywalking.apm.plugin.vertx3.HttpServerResponseImplInterceptor"
;
@Override
public
ConstructorInterceptPoint
[]
getConstructorsInterceptPoints
()
{
return
new
ConstructorInterceptPoint
[
0
];
return
new
ConstructorInterceptPoint
[]
{
new
ConstructorInterceptPoint
()
{
@Override
public
ElementMatcher
<
MethodDescription
>
getConstructorMatcher
()
{
return
any
();
}
@Override
public
String
getConstructorInterceptor
()
{
return
INTERCEPTOR_CLASS
;
}
}
};
}
@Override
...
...
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/Route
rImplAccept
Instrumentation.java
→
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/Route
State
Instrumentation.java
浏览文件 @
705f97f2
...
...
@@ -26,24 +26,39 @@ import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInst
import
org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch
;
import
org.apache.skywalking.apm.agent.core.plugin.match.NameMatch
;
import
java.util.List
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
named
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
takesArgument
;
/**
* {@link Route
rImplAcceptInstrumentation} enhance the <code>accep
t</code> method in
* <code>io.vertx.ext.web.impl.Route
rImpl
</code> class by
* <code>Route
rImplAccept
Interceptor</code> class.
* {@link Route
StateInstrumentation} enhance the <code>handleContex
t</code> method in
* <code>io.vertx.ext.web.impl.Route
State
</code> class by
* <code>Route
State
Interceptor</code> class.
*
*
Targets: ver. 3.0.0 - 3.5.4
*
Ver. 3.8.3+
*/
public
class
Route
rImplAccept
Instrumentation
extends
ClassInstanceMethodsEnhancePluginDefine
{
public
class
Route
State
Instrumentation
extends
ClassInstanceMethodsEnhancePluginDefine
{
private
static
final
String
ENHANCE_CLASS
=
"io.vertx.ext.web.impl.Route
rImpl
"
;
private
static
final
String
ENHANCE_METHOD
=
"
accep
t"
;
private
static
final
String
INTERCEPT_CLASS
=
"org.apache.skywalking.apm.plugin.vertx3.Route
rImplAccept
Interceptor"
;
private
static
final
String
ENHANCE_CLASS
=
"io.vertx.ext.web.impl.Route
State
"
;
private
static
final
String
ENHANCE_METHOD
=
"
handleContex
t"
;
private
static
final
String
INTERCEPT_CLASS
=
"org.apache.skywalking.apm.plugin.vertx3.Route
State
Interceptor"
;
@Override
public
ConstructorInterceptPoint
[]
getConstructorsInterceptPoints
()
{
return
new
ConstructorInterceptPoint
[
0
];
return
new
ConstructorInterceptPoint
[]
{
new
ConstructorInterceptPoint
()
{
@Override
public
ElementMatcher
<
MethodDescription
>
getConstructorMatcher
()
{
return
takesArgument
(
8
,
List
.
class
);
}
@Override
public
String
getConstructorInterceptor
()
{
return
INTERCEPT_CLASS
;
}
}
};
}
@Override
...
...
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/RouterContextImplBaseConstructorInstrumentation.java
0 → 100644
浏览文件 @
705f97f2
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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.apache.skywalking.apm.plugin.vertx3.define
;
import
net.bytebuddy.description.method.MethodDescription
;
import
net.bytebuddy.matcher.ElementMatcher
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine
;
import
org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch
;
import
org.apache.skywalking.apm.agent.core.plugin.match.NameMatch
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
any
;
/**
* {@link RouterContextImplBaseConstructorInstrumentation} enhance the constructor in
* <code>io.vertx.ext.web.impl.RoutingContextImplBase</code> class by
* <code>RoutingContextImplBaseConstructorInterceptor</code> class.
*/
public
class
RouterContextImplBaseConstructorInstrumentation
extends
ClassInstanceMethodsEnhancePluginDefine
{
private
static
final
String
ENHANCE_CLASS
=
"io.vertx.ext.web.impl.RoutingContextImplBase"
;
private
static
final
String
INTERCEPT_CLASS
=
"org.apache.skywalking.apm.plugin.vertx3.RoutingContextImplBaseConstructorInterceptor"
;
@Override
public
ConstructorInterceptPoint
[]
getConstructorsInterceptPoints
()
{
return
new
ConstructorInterceptPoint
[]
{
new
ConstructorInterceptPoint
()
{
@Override
public
ElementMatcher
<
MethodDescription
>
getConstructorMatcher
()
{
return
any
();
}
@Override
public
String
getConstructorInterceptor
()
{
return
INTERCEPT_CLASS
;
}
}
};
}
@Override
public
InstanceMethodsInterceptPoint
[]
getInstanceMethodsInterceptPoints
()
{
return
new
InstanceMethodsInterceptPoint
[
0
];
}
@Override
protected
ClassMatch
enhanceClass
()
{
return
NameMatch
.
byName
(
ENHANCE_CLASS
);
}
}
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/RouterImplHandleInstrumentation.java
→
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/RouterImplHandle
r
Instrumentation.java
浏览文件 @
705f97f2
...
...
@@ -29,17 +29,17 @@ import org.apache.skywalking.apm.agent.core.plugin.match.NameMatch;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
named
;
/**
* {@link RouterImplHandle
Instrumentation} enhance the <code>handle
</code> method in
* {@link RouterImplHandle
rInstrumentation} enhance the <code>handler
</code> method in
* <code>io.vertx.ext.web.impl.RouterImpl</code> class by
* <code>RouterImpl
Accept
Interceptor</code> class.
* <code>RouterImpl
Handler
Interceptor</code> class.
*
*
Targets: ver. 3.6.0+
*
Ver. 3.0.0 - 3.4.2
*/
public
class
RouterImplHandleInstrumentation
extends
ClassInstanceMethodsEnhancePluginDefine
{
public
class
RouterImplHandle
r
Instrumentation
extends
ClassInstanceMethodsEnhancePluginDefine
{
private
static
final
String
ENHANCE_CLASS
=
"io.vertx.ext.web.impl.Route
r
Impl"
;
private
static
final
String
ENHANCE_METHOD
=
"handle"
;
private
static
final
String
INTERCEPT_CLASS
=
"org.apache.skywalking.apm.plugin.vertx3.RouterImpl
Accept
Interceptor"
;
private
static
final
String
ENHANCE_CLASS
=
"io.vertx.ext.web.impl.RouteImpl"
;
private
static
final
String
ENHANCE_METHOD
=
"handle
r
"
;
private
static
final
String
INTERCEPT_CLASS
=
"org.apache.skywalking.apm.plugin.vertx3.RouterImpl
Handler
Interceptor"
;
@Override
public
ConstructorInterceptPoint
[]
getConstructorsInterceptPoints
()
{
...
...
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/RouterImplInstrumentation.java
0 → 100644
浏览文件 @
705f97f2
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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.apache.skywalking.apm.plugin.vertx3.define
;
import
net.bytebuddy.description.method.MethodDescription
;
import
net.bytebuddy.matcher.ElementMatcher
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine
;
import
org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch
;
import
org.apache.skywalking.apm.agent.core.plugin.match.NameMatch
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
any
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
named
;
/**
* {@link RouterImplInstrumentation} enhance the <code>handleContext</code> method in
* <code>io.vertx.ext.web.impl.RouterImpl</code> class by
* <code>RouteStateInterceptor</code> class.
*
* Ver. 3.0.0 - 3.8.2
*/
public
class
RouterImplInstrumentation
extends
ClassInstanceMethodsEnhancePluginDefine
{
private
static
final
String
ENHANCE_CLASS
=
"io.vertx.ext.web.impl.RouteImpl"
;
private
static
final
String
ENHANCE_METHOD
=
"handleContext"
;
private
static
final
String
INTERCEPT_CLASS
=
"org.apache.skywalking.apm.plugin.vertx3.RouteStateInterceptor"
;
@Override
public
ConstructorInterceptPoint
[]
getConstructorsInterceptPoints
()
{
return
new
ConstructorInterceptPoint
[]
{
new
ConstructorInterceptPoint
()
{
@Override
public
ElementMatcher
<
MethodDescription
>
getConstructorMatcher
()
{
return
any
();
}
@Override
public
String
getConstructorInterceptor
()
{
return
INTERCEPT_CLASS
;
}
}
};
}
@Override
public
InstanceMethodsInterceptPoint
[]
getInstanceMethodsInterceptPoints
()
{
return
new
InstanceMethodsInterceptPoint
[]
{
new
InstanceMethodsInterceptPoint
()
{
@Override
public
ElementMatcher
<
MethodDescription
>
getMethodsMatcher
()
{
return
named
(
ENHANCE_METHOD
);
}
@Override
public
String
getMethodsInterceptor
()
{
return
INTERCEPT_CLASS
;
}
@Override
public
boolean
isOverrideArgs
()
{
return
false
;
}
}
};
}
@Override
protected
ClassMatch
enhanceClass
()
{
return
NameMatch
.
byName
(
ENHANCE_CLASS
);
}
}
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/RoutingContextWrapperConstructorInstrumentation.java
0 → 100644
浏览文件 @
705f97f2
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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.apache.skywalking.apm.plugin.vertx3.define
;
import
net.bytebuddy.description.method.MethodDescription
;
import
net.bytebuddy.matcher.ElementMatcher
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine
;
import
org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch
;
import
org.apache.skywalking.apm.agent.core.plugin.match.NameMatch
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
any
;
/**
* {@link RoutingContextWrapperConstructorInstrumentation} enhance the constructor in
* <code>io.vertx.ext.web.impl.RoutingContextWrapper</code> class by
* <code>RoutingContextWrapperInterceptor</code> class.
*
* Ver. 3.1.0+
*/
public
class
RoutingContextWrapperConstructorInstrumentation
extends
ClassInstanceMethodsEnhancePluginDefine
{
private
static
final
String
ENHANCE_CLASS
=
"io.vertx.ext.web.impl.RoutingContextWrapper"
;
private
static
final
String
INTERCEPT_CLASS
=
"org.apache.skywalking.apm.plugin.vertx3.RoutingContextWrapperConstructorInterceptor"
;
@Override
public
ConstructorInterceptPoint
[]
getConstructorsInterceptPoints
()
{
return
new
ConstructorInterceptPoint
[]
{
new
ConstructorInterceptPoint
()
{
@Override
public
ElementMatcher
<
MethodDescription
>
getConstructorMatcher
()
{
return
any
();
}
@Override
public
String
getConstructorInterceptor
()
{
return
INTERCEPT_CLASS
;
}
}
};
}
@Override
public
InstanceMethodsInterceptPoint
[]
getInstanceMethodsInterceptPoints
()
{
return
new
InstanceMethodsInterceptPoint
[
0
];
}
@Override
protected
ClassMatch
enhanceClass
()
{
return
NameMatch
.
byName
(
ENHANCE_CLASS
);
}
}
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/ServerConnectionHandleMessageInstrumentation.java
0 → 100644
浏览文件 @
705f97f2
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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.apache.skywalking.apm.plugin.vertx3.define
;
import
net.bytebuddy.description.method.MethodDescription
;
import
net.bytebuddy.matcher.ElementMatcher
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint
;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine
;
import
org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch
;
import
org.apache.skywalking.apm.agent.core.plugin.match.MultiClassNameMatch
;
import
static
net
.
bytebuddy
.
matcher
.
ElementMatchers
.
named
;
/**
* {@link ServerConnectionHandleMessageInstrumentation} enhance the <code>handleMessage</code> method in
* <code>io.vertx.core.http.impl.ServerConnection</code> and <code>io.vertx.core.http.impl.Http1xServerConnection</code>
* classes by <code>ServerConnectionHandleMessageInterceptor</code> class.
*/
public
class
ServerConnectionHandleMessageInstrumentation
extends
ClassInstanceMethodsEnhancePluginDefine
{
private
static
final
String
SERVER_CONNECTION_ENHANCE_CLASS
=
"io.vertx.core.http.impl.ServerConnection"
;
private
static
final
String
HTTP_SERVER_CONNECTION_ENHANCE_CLASS
=
"io.vertx.core.http.impl.Http1xServerConnection"
;
private
static
final
String
ENHANCE_METHOD
=
"handleMessage"
;
private
static
final
String
INTERCEPT_CLASS
=
"org.apache.skywalking.apm.plugin.vertx3.ServerConnectionHandleMessageInterceptor"
;
@Override
public
ConstructorInterceptPoint
[]
getConstructorsInterceptPoints
()
{
return
new
ConstructorInterceptPoint
[
0
];
}
@Override
public
InstanceMethodsInterceptPoint
[]
getInstanceMethodsInterceptPoints
()
{
return
new
InstanceMethodsInterceptPoint
[]
{
new
InstanceMethodsInterceptPoint
()
{
@Override
public
ElementMatcher
<
MethodDescription
>
getMethodsMatcher
()
{
return
named
(
ENHANCE_METHOD
);
}
@Override
public
String
getMethodsInterceptor
()
{
return
INTERCEPT_CLASS
;
}
@Override
public
boolean
isOverrideArgs
()
{
return
false
;
}
}
};
}
@Override
protected
ClassMatch
enhanceClass
()
{
return
MultiClassNameMatch
.
byMultiClassMatch
(
HTTP_SERVER_CONNECTION_ENHANCE_CLASS
,
//ver. 3.5.1+
SERVER_CONNECTION_ENHANCE_CLASS
//ver. 3.0.0 - 3.5.0
);
}
}
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/resources/skywalking-plugin.def
浏览文件 @
705f97f2
...
...
@@ -17,11 +17,18 @@
vertx-core-3.x=org.apache.skywalking.apm.plugin.vertx3.define.ClusteredEventBusSendRemoteInstrumentation
vertx-core-3.x=org.apache.skywalking.apm.plugin.vertx3.define.EventBusImplDeliverToHandlerInstrumentation
vertx-core-3.x=org.apache.skywalking.apm.plugin.vertx3.define.HandlerRegistrationInstrumentation
vertx-core-3.x=org.apache.skywalking.apm.plugin.vertx3.define.HttpClientRequestImpl
End
Instrumentation
vertx-core-3.x=org.apache.skywalking.apm.plugin.vertx3.define.HttpClientRequestImplInstrumentation
vertx-core-3.x=org.apache.skywalking.apm.plugin.vertx3.define.HttpClientRequestImplHandleExceptionInstrumentation
vertx-core-3.x=org.apache.skywalking.apm.plugin.vertx3.define.HttpClientRequestImplHandleResponseInstrumentation
vertx-core-3.x=org.apache.skywalking.apm.plugin.vertx3.define.HttpServerResponseImpl
End
Instrumentation
vertx-core-3.x=org.apache.skywalking.apm.plugin.vertx3.define.HttpServerResponseImplInstrumentation
vertx-core-3.x=org.apache.skywalking.apm.plugin.vertx3.define.HttpServerResponseImplHandleExceptionInstrumentation
vertx-core-3.x=org.apache.skywalking.apm.plugin.vertx3.define.RouterImplAcceptInstrumentation
vertx-core-3.x=org.apache.skywalking.apm.plugin.vertx3.define.RouterImplHandleInstrumentation
vertx-core-3.x=org.apache.skywalking.apm.plugin.vertx3.define.RouterContextImplBaseConstructorInstrumentation
vertx-core-3.x=org.apache.skywalking.apm.plugin.vertx3.define.ServerConnectionHandleMessageInstrumentation
vertx-core-3.x=org.apache.skywalking.apm.plugin.vertx3.define.RouteStateInstrumentation
vertx-core-3.x=org.apache.skywalking.apm.plugin.vertx3.define.RouterImplInstrumentation
vertx-core-3.x=org.apache.skywalking.apm.plugin.vertx3.define.RouterImplHandlerInstrumentation
vertx-core-3.x=org.apache.skywalking.apm.plugin.vertx3.define.RoutingContextWrapperConstructorInstrumentation
vertx-core-3.x=org.apache.skywalking.apm.plugin.vertx3.define.HttpServerRequestImplConstructorInstrumentation
vertx-core-3.x=org.apache.skywalking.apm.plugin.vertx3.define.HttpServerRequestWrapperConstructorInstrumentation
vertx-core-3.x=org.apache.skywalking.apm.plugin.vertx3.define.HttpContextSendRequestInstrumentation
vertx-core-3.x=org.apache.skywalking.apm.plugin.vertx3.define.HttpContextHandleDispatchResponseInstrumentation
test/plugin/scenarios/vertx-eventbus-3.x-scenario/config/expectedData.yaml
浏览文件 @
705f97f2
...
...
@@ -19,6 +19,10 @@ segmentItems:
segments
:
-
segmentId
:
not
null
spans
:
-
{
operationName
:
org.apache.skywalking.apm.testcase.vertxeventbus.controller.VertxEventbusController$$Lambda$.handle(RoutingContext)
,
operationId
:
0
,
parentSpanId
:
0
,
spanId
:
1
,
spanLayer
:
Http
,
startTime
:
nq 0
,
endTime
:
nq 0
,
componentId
:
59
,
isError
:
false
,
spanType
:
Local
,
peer
:
'
'
,
skipAnalysis
:
false
}
-
operationName
:
/vertx-eventbus-3-scenario/case/healthCheck
operationId
:
0
parentSpanId
:
-1
...
...
@@ -63,8 +67,8 @@ segmentItems:
spans
:
-
operationName
:
/vertx-eventbus-3-scenario/case/executeTest
operationId
:
0
parentSpanId
:
0
spanId
:
1
parentSpanId
:
1
spanId
:
2
spanLayer
:
Http
startTime
:
nq
0
endTime
:
nq
0
...
...
@@ -77,6 +81,10 @@ segmentItems:
-
{
key
:
http.method
,
value
:
GET
}
-
{
key
:
url
,
value
:
/vertx-eventbus-3-scenario/case/executeTest
}
-
{
key
:
status_code
,
value
:
'
200'
}
-
{
operationName
:
org.apache.skywalking.apm.testcase.vertxeventbus.controller.VertxEventbusController$$Lambda$.handle(RoutingContext)
,
operationId
:
0
,
parentSpanId
:
0
,
spanId
:
1
,
spanLayer
:
Http
,
startTime
:
nq 0
,
endTime
:
nq 0
,
componentId
:
59
,
isError
:
false
,
spanType
:
Local
,
peer
:
'
'
,
skipAnalysis
:
false
}
-
operationName
:
/vertx-eventbus-3-scenario/case/eventbus-case
operationId
:
0
parentSpanId
:
-1
...
...
@@ -109,7 +117,7 @@ segmentItems:
skipAnalysis
:
false
refs
:
-
{
parentEndpoint
:
/vertx-eventbus-3-scenario/case/eventbus-case
,
networkAddress
:
'
'
,
refType
:
CrossThread
,
parentSpanId
:
1
,
parentTraceSegmentId
:
not null
,
refType
:
CrossThread
,
parentSpanId
:
2
,
parentTraceSegmentId
:
not null
,
parentServiceInstance
:
not null
,
parentService
:
vertx-eventbus-3.x-scenario
,
traceId
:
not null
}
-
segmentId
:
not
null
...
...
@@ -138,6 +146,10 @@ segmentItems:
componentId
:
59
,
isError
:
false
,
spanType
:
Exit
,
peer
:
not null
,
skipAnalysis
:
false
}
-
segmentId
:
not
null
spans
:
-
{
operationName
:
org.apache.skywalking.apm.testcase.vertxeventbus.controller.VertxEventbusController$$Lambda$.handle(RoutingContext)
,
operationId
:
0
,
parentSpanId
:
0
,
spanId
:
1
,
spanLayer
:
Http
,
startTime
:
nq 0
,
endTime
:
nq 0
,
componentId
:
59
,
isError
:
false
,
spanType
:
Local
,
peer
:
'
'
,
skipAnalysis
:
false
}
-
operationName
:
/vertx-eventbus-3-scenario/case/executeTest
operationId
:
0
parentSpanId
:
-1
...
...
@@ -156,6 +168,6 @@ segmentItems:
-
{
key
:
status_code
,
value
:
'
200'
}
refs
:
-
{
parentEndpoint
:
/vertx-eventbus-3-scenario/case/eventbus-case
,
networkAddress
:
'
localhost:8080'
,
refType
:
CrossProcess
,
parentSpanId
:
1
,
parentTraceSegmentId
:
not null
,
refType
:
CrossProcess
,
parentSpanId
:
2
,
parentTraceSegmentId
:
not null
,
parentServiceInstance
:
not null
,
parentService
:
vertx-eventbus-3.x-scenario
,
traceId
:
not null
}
test/plugin/scenarios/vertx-eventbus-3.x-scenario/support-version.list
浏览文件 @
705f97f2
...
...
@@ -14,6 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
3.9.1
3.9.0
3.8.5
3.8.4
...
...
test/plugin/scenarios/vertx-web-3.54minus-scenario/config/expectedData.yaml
浏览文件 @
705f97f2
...
...
@@ -15,10 +15,14 @@
# limitations under the License.
segmentItems
:
-
serviceName
:
vertx-web-3.54minus-scenario
segmentSize
:
4
segmentSize
:
7
segments
:
-
segmentId
:
not
null
spans
:
-
{
operationName
:
org.apache.skywalking.apm.testcase.vertxweb.controller.VertxWebController$$Lambda$.handle(RoutingContext)
,
operationId
:
0
,
parentSpanId
:
0
,
spanId
:
1
,
spanLayer
:
Http
,
startTime
:
nq 0
,
endTime
:
nq 0
,
componentId
:
59
,
isError
:
false
,
spanType
:
Local
,
peer
:
'
'
,
skipAnalysis
:
false
}
-
operationName
:
/vertx-web-3_54minus-scenario/case/healthCheck
operationId
:
0
parentSpanId
:
-1
...
...
@@ -37,6 +41,48 @@ segmentItems:
-
{
key
:
status_code
,
value
:
'
200'
}
-
segmentId
:
not
null
spans
:
-
operationName
:
/vertx-web-3_54minus-scenario/case/healthCheck
operationId
:
0
parentSpanId
:
1
spanId
:
2
spanLayer
:
Http
startTime
:
nq
0
endTime
:
nq
0
componentId
:
59
isError
:
false
spanType
:
Exit
peer
:
localhost:8080
skipAnalysis
:
false
tags
:
-
{
key
:
http.method
,
value
:
HEAD
}
-
{
key
:
url
,
value
:
/vertx-web-3_54minus-scenario/case/healthCheck
}
-
{
key
:
status_code
,
value
:
'
200'
}
-
{
operationName
:
org.apache.skywalking.apm.testcase.vertxweb.controller.VertxWebController$$Lambda$.handle(RoutingContext)
,
operationId
:
0
,
parentSpanId
:
0
,
spanId
:
1
,
spanLayer
:
Http
,
startTime
:
nq 0
,
endTime
:
nq 0
,
componentId
:
59
,
isError
:
false
,
spanType
:
Local
,
peer
:
'
'
,
skipAnalysis
:
false
}
-
operationName
:
/vertx-web-3_54minus-scenario/case/web-case
operationId
:
0
parentSpanId
:
-1
spanId
:
0
spanLayer
:
Http
startTime
:
nq
0
endTime
:
nq
0
componentId
:
59
isError
:
false
spanType
:
Entry
peer
:
'
'
skipAnalysis
:
false
tags
:
-
{
key
:
http.method
,
value
:
GET
}
-
{
key
:
url
,
value
:
/vertx-web-3_54minus-scenario/case/web-case
}
-
{
key
:
status_code
,
value
:
'
200'
}
-
segmentId
:
not
null
spans
:
-
{
operationName
:
org.apache.skywalking.apm.testcase.vertxweb.controller.VertxWebController$$Lambda$.handle(RoutingContext)
,
operationId
:
0
,
parentSpanId
:
0
,
spanId
:
1
,
spanLayer
:
Http
,
startTime
:
nq 0
,
endTime
:
nq 0
,
componentId
:
59
,
isError
:
false
,
spanType
:
Local
,
peer
:
'
'
,
skipAnalysis
:
false
}
-
operationName
:
/vertx-web-3_54minus-scenario/case/healthCheck
operationId
:
0
parentSpanId
:
-1
...
...
@@ -55,12 +101,58 @@ segmentItems:
-
{
key
:
status_code
,
value
:
'
200'
}
refs
:
-
{
parentEndpoint
:
/vertx-web-3_54minus-scenario/case/web-case
,
networkAddress
:
'
localhost:8080'
,
refType
:
CrossProcess
,
parentSpanId
:
2
,
parentTraceSegmentId
:
not null
,
parentServiceInstance
:
not null
,
parentService
:
vertx-web-3.54minus-scenario
,
traceId
:
not null
}
-
segmentId
:
not
null
spans
:
-
{
operationName
:
io.vertx.ext.web.handler.impl.BodyHandlerImpl.handle(RoutingContext)
,
operationId
:
0
,
parentSpanId
:
0
,
spanId
:
1
,
spanLayer
:
Http
,
startTime
:
nq 0
,
endTime
:
nq 0
,
componentId
:
59
,
isError
:
false
,
spanType
:
Local
,
peer
:
'
'
,
skipAnalysis
:
false
}
-
operationName
:
/vertx-web-3_54minus-scenario/case/web-case/withBodyHandler
operationId
:
0
parentSpanId
:
-1
spanId
:
0
spanLayer
:
Http
startTime
:
nq
0
endTime
:
nq
0
componentId
:
59
isError
:
false
spanType
:
Entry
peer
:
'
'
skipAnalysis
:
false
tags
:
-
{
key
:
http.method
,
value
:
GET
}
-
{
key
:
url
,
value
:
/vertx-web-3_54minus-scenario/case/web-case/withBodyHandler
}
-
{
key
:
status_code
,
value
:
'
200'
}
refs
:
-
{
parentEndpoint
:
'
#/vertx-web-3_54minus-scenario/case/healthCheck'
,
networkAddress
:
'
localhost:8080'
,
refType
:
CrossProcess
,
parentSpanId
:
1
,
parentTraceSegmentId
:
not null
,
parentServiceInstance
:
not null
,
parentService
:
vertx-web-3.54minus-scenario
,
traceId
:
not null
}
-
segmentId
:
not
null
spans
:
-
operationName
:
/vertx-web-3_54minus-scenario/case/healthCheck
-
operationName
:
org.apache.skywalking.apm.testcase.vertxweb.controller.VertxWebController$$Lambda$.handle(RoutingContext)
operationId
:
0
parentSpanId
:
-1
spanId
:
0
spanLayer
:
Http
startTime
:
nq
0
endTime
:
nq
0
componentId
:
59
isError
:
false
spanType
:
Local
peer
:
'
'
skipAnalysis
:
false
refs
:
-
{
parentEndpoint
:
/vertx-web-3_54minus-scenario/case/web-case/withBodyHandler
,
networkAddress
:
'
'
,
refType
:
CrossThread
,
parentSpanId
:
0
,
parentTraceSegmentId
:
not null
,
parentServiceInstance
:
not null
,
parentService
:
vertx-web-3.54minus-scenario
,
traceId
:
not null
}
-
segmentId
:
not
null
spans
:
-
operationName
:
/vertx-web-3_54minus-scenario/case/web-case/withBodyHandler
operationId
:
0
parentSpanId
:
0
spanId
:
1
...
...
@@ -73,10 +165,10 @@ segmentItems:
peer
:
localhost:8080
skipAnalysis
:
false
tags
:
-
{
key
:
http.method
,
value
:
HEAD
}
-
{
key
:
url
,
value
:
/vertx-web-3_54minus-scenario/case/
healthCheck
}
-
{
key
:
http.method
,
value
:
GET
}
-
{
key
:
url
,
value
:
/vertx-web-3_54minus-scenario/case/
web-case/withBodyHandler
}
-
{
key
:
status_code
,
value
:
'
200'
}
-
operationName
:
/vertx-web-3_54minus-scenario/case/web-case
-
operationName
:
'
#/vertx-web-3_54minus-scenario/case/healthCheck'
operationId
:
0
parentSpanId
:
-1
spanId
:
0
...
...
@@ -85,16 +177,17 @@ segmentItems:
endTime
:
nq
0
componentId
:
59
isError
:
false
spanType
:
Entry
spanType
:
Local
peer
:
'
'
skipAnalysis
:
false
tags
:
-
{
key
:
http.method
,
value
:
GET
}
-
{
key
:
url
,
value
:
/vertx-web-3_54minus-scenario/case/web-case
}
-
{
key
:
status_code
,
value
:
'
200'
}
refs
:
-
{
parentEndpoint
:
/vertx-web-3_54minus-scenario/case/web-case
,
networkAddress
:
'
'
,
refType
:
CrossThread
,
parentSpanId
:
2
,
parentTraceSegmentId
:
not null
,
parentServiceInstance
:
not null
,
parentService
:
vertx-web-3.54minus-scenario
,
traceId
:
not null
}
-
segmentId
:
not
null
spans
:
-
operationName
:
'
#/vertx-web-3_54minus-scenario/case/
healthCheck
'
-
operationName
:
'
#/vertx-web-3_54minus-scenario/case/
web-case/withBodyHandler
'
operationId
:
0
parentSpanId
:
-1
spanId
:
0
...
...
@@ -107,7 +200,7 @@ segmentItems:
peer
:
'
'
skipAnalysis
:
false
refs
:
-
{
parentEndpoint
:
/vertx-web-3_54minus-scenario/case/web-case
,
networkAddress
:
'
'
,
-
{
parentEndpoint
:
'
#/vertx-web-3_54minus-scenario/case/healthCheck'
,
networkAddress
:
'
'
,
refType
:
CrossThread
,
parentSpanId
:
1
,
parentTraceSegmentId
:
not null
,
parentServiceInstance
:
not null
,
parentService
:
vertx-web-3.54minus-scenario
,
traceId
:
not null
}
test/plugin/scenarios/vertx-web-3.54minus-scenario/src/main/java/org/apache/skywalking/apm/testcase/vertxweb/controller/VertxWebController.java
浏览文件 @
705f97f2
...
...
@@ -20,6 +20,7 @@ package org.apache.skywalking.apm.testcase.vertxweb.controller;
import
io.vertx.core.AbstractVerticle
;
import
io.vertx.ext.web.Router
;
import
io.vertx.ext.web.RoutingContext
;
import
io.vertx.ext.web.handler.BodyHandler
;
public
class
VertxWebController
extends
AbstractVerticle
{
...
...
@@ -27,14 +28,23 @@ public class VertxWebController extends AbstractVerticle {
public
void
start
()
{
Router
router
=
Router
.
router
(
vertx
);
router
.
get
(
"/vertx-web-3_54minus-scenario/case/web-case"
).
handler
(
this
::
handleWebCase
);
router
.
route
(
"/vertx-web-3_54minus-scenario/case/web-case/withBodyHandler"
).
handler
(
BodyHandler
.
create
());
router
.
get
(
"/vertx-web-3_54minus-scenario/case/web-case/withBodyHandler"
).
handler
(
this
::
withBodyHandler
);
router
.
head
(
"/vertx-web-3_54minus-scenario/case/healthCheck"
).
handler
(
this
::
healthCheck
);
vertx
.
createHttpServer
().
requestHandler
(
router:
:
accept
).
listen
(
8080
);
}
private
void
handleWebCase
(
RoutingContext
routingContext
)
{
vertx
.
createHttpClient
().
headNow
(
8080
,
"localhost"
,
"/vertx-web-3_54minus-scenario/case/healthCheck"
,
it
->
routingContext
.
response
().
setStatusCode
(
it
.
statusCode
()).
end
());
vertx
.
createHttpClient
().
headNow
(
8080
,
"localhost"
,
"/vertx-web-3_54minus-scenario/case/healthCheck"
,
healthCheck
->
{
vertx
.
createHttpClient
().
getNow
(
8080
,
"localhost"
,
"/vertx-web-3_54minus-scenario/case/web-case/withBodyHandler"
,
it
->
routingContext
.
response
().
setStatusCode
(
it
.
statusCode
()).
end
());
});
}
private
void
withBodyHandler
(
RoutingContext
routingContext
)
{
routingContext
.
response
().
setStatusCode
(
200
).
end
(
"Success"
);
}
private
void
healthCheck
(
RoutingContext
routingContext
)
{
...
...
test/plugin/scenarios/vertx-web-3.6plus-scenario/config/expectedData.yaml
浏览文件 @
705f97f2
...
...
@@ -15,10 +15,14 @@
# limitations under the License.
segmentItems
:
-
serviceName
:
vertx-web-3.6plus-scenario
segmentSize
:
4
segmentSize
:
7
segments
:
-
segmentId
:
not
null
spans
:
-
{
operationName
:
org.apache.skywalking.apm.testcase.vertxweb.controller.VertxWebController$$Lambda$.handle(RoutingContext)
,
operationId
:
0
,
parentSpanId
:
0
,
spanId
:
1
,
spanLayer
:
Http
,
startTime
:
nq 0
,
endTime
:
nq 0
,
componentId
:
59
,
isError
:
false
,
spanType
:
Local
,
peer
:
'
'
,
skipAnalysis
:
false
}
-
operationName
:
/vertx-web-3_6plus-scenario/case/healthCheck
operationId
:
0
parentSpanId
:
-1
...
...
@@ -37,6 +41,48 @@ segmentItems:
-
{
key
:
status_code
,
value
:
'
200'
}
-
segmentId
:
not
null
spans
:
-
operationName
:
/vertx-web-3_6plus-scenario/case/healthCheck
operationId
:
0
parentSpanId
:
1
spanId
:
2
spanLayer
:
Http
startTime
:
nq
0
endTime
:
nq
0
componentId
:
59
isError
:
false
spanType
:
Exit
peer
:
localhost:8080
skipAnalysis
:
false
tags
:
-
{
key
:
http.method
,
value
:
HEAD
}
-
{
key
:
url
,
value
:
/vertx-web-3_6plus-scenario/case/healthCheck
}
-
{
key
:
status_code
,
value
:
'
200'
}
-
{
operationName
:
org.apache.skywalking.apm.testcase.vertxweb.controller.VertxWebController$$Lambda$.handle(RoutingContext)
,
operationId
:
0
,
parentSpanId
:
0
,
spanId
:
1
,
spanLayer
:
Http
,
startTime
:
nq 0
,
endTime
:
nq 0
,
componentId
:
59
,
isError
:
false
,
spanType
:
Local
,
peer
:
'
'
,
skipAnalysis
:
false
}
-
operationName
:
/vertx-web-3_6plus-scenario/case/web-case
operationId
:
0
parentSpanId
:
-1
spanId
:
0
spanLayer
:
Http
startTime
:
nq
0
endTime
:
nq
0
componentId
:
59
isError
:
false
spanType
:
Entry
peer
:
'
'
skipAnalysis
:
false
tags
:
-
{
key
:
http.method
,
value
:
GET
}
-
{
key
:
url
,
value
:
/vertx-web-3_6plus-scenario/case/web-case
}
-
{
key
:
status_code
,
value
:
'
200'
}
-
segmentId
:
not
null
spans
:
-
{
operationName
:
org.apache.skywalking.apm.testcase.vertxweb.controller.VertxWebController$$Lambda$.handle(RoutingContext)
,
operationId
:
0
,
parentSpanId
:
0
,
spanId
:
1
,
spanLayer
:
Http
,
startTime
:
nq 0
,
endTime
:
nq 0
,
componentId
:
59
,
isError
:
false
,
spanType
:
Local
,
peer
:
'
'
,
skipAnalysis
:
false
}
-
operationName
:
/vertx-web-3_6plus-scenario/case/healthCheck
operationId
:
0
parentSpanId
:
-1
...
...
@@ -55,12 +101,58 @@ segmentItems:
-
{
key
:
status_code
,
value
:
'
200'
}
refs
:
-
{
parentEndpoint
:
/vertx-web-3_6plus-scenario/case/web-case
,
networkAddress
:
'
localhost:8080'
,
refType
:
CrossProcess
,
parentSpanId
:
2
,
parentTraceSegmentId
:
not null
,
parentServiceInstance
:
not null
,
parentService
:
vertx-web-3.6plus-scenario
,
traceId
:
not null
}
-
segmentId
:
not
null
spans
:
-
{
operationName
:
io.vertx.ext.web.handler.impl.BodyHandlerImpl.handle(RoutingContext)
,
operationId
:
0
,
parentSpanId
:
0
,
spanId
:
1
,
spanLayer
:
Http
,
startTime
:
nq 0
,
endTime
:
nq 0
,
componentId
:
59
,
isError
:
false
,
spanType
:
Local
,
peer
:
'
'
,
skipAnalysis
:
false
}
-
operationName
:
/vertx-web-3_6plus-scenario/case/web-case/withBodyHandler
operationId
:
0
parentSpanId
:
-1
spanId
:
0
spanLayer
:
Http
startTime
:
nq
0
endTime
:
nq
0
componentId
:
59
isError
:
false
spanType
:
Entry
peer
:
'
'
skipAnalysis
:
false
tags
:
-
{
key
:
http.method
,
value
:
GET
}
-
{
key
:
url
,
value
:
/vertx-web-3_6plus-scenario/case/web-case/withBodyHandler
}
-
{
key
:
status_code
,
value
:
'
200'
}
refs
:
-
{
parentEndpoint
:
'
#/vertx-web-3_6plus-scenario/case/healthCheck'
,
networkAddress
:
'
localhost:8080'
,
refType
:
CrossProcess
,
parentSpanId
:
1
,
parentTraceSegmentId
:
not null
,
parentServiceInstance
:
not null
,
parentService
:
vertx-web-3.6plus-scenario
,
traceId
:
not null
}
-
segmentId
:
not
null
spans
:
-
operationName
:
/vertx-web-3_6plus-scenario/case/healthCheck
-
operationName
:
org.apache.skywalking.apm.testcase.vertxweb.controller.VertxWebController$$Lambda$.handle(RoutingContext)
operationId
:
0
parentSpanId
:
-1
spanId
:
0
spanLayer
:
Http
startTime
:
nq
0
endTime
:
nq
0
componentId
:
59
isError
:
false
spanType
:
Local
peer
:
'
'
skipAnalysis
:
false
refs
:
-
{
parentEndpoint
:
/vertx-web-3_6plus-scenario/case/web-case/withBodyHandler
,
networkAddress
:
'
'
,
refType
:
CrossThread
,
parentSpanId
:
0
,
parentTraceSegmentId
:
not null
,
parentServiceInstance
:
not null
,
parentService
:
vertx-web-3.6plus-scenario
,
traceId
:
not null
}
-
segmentId
:
not
null
spans
:
-
operationName
:
/vertx-web-3_6plus-scenario/case/web-case/withBodyHandler
operationId
:
0
parentSpanId
:
0
spanId
:
1
...
...
@@ -73,10 +165,10 @@ segmentItems:
peer
:
localhost:8080
skipAnalysis
:
false
tags
:
-
{
key
:
http.method
,
value
:
HEAD
}
-
{
key
:
url
,
value
:
/vertx-web-3_6plus-scenario/case/
healthCheck
}
-
{
key
:
http.method
,
value
:
GET
}
-
{
key
:
url
,
value
:
/vertx-web-3_6plus-scenario/case/
web-case/withBodyHandler
}
-
{
key
:
status_code
,
value
:
'
200'
}
-
operationName
:
/vertx-web-3_6plus-scenario/case/web-case
-
operationName
:
'
#/vertx-web-3_6plus-scenario/case/healthCheck'
operationId
:
0
parentSpanId
:
-1
spanId
:
0
...
...
@@ -85,16 +177,17 @@ segmentItems:
endTime
:
nq
0
componentId
:
59
isError
:
false
spanType
:
Entry
spanType
:
Local
peer
:
'
'
skipAnalysis
:
false
tags
:
-
{
key
:
http.method
,
value
:
GET
}
-
{
key
:
url
,
value
:
/vertx-web-3_6plus-scenario/case/web-case
}
-
{
key
:
status_code
,
value
:
'
200'
}
refs
:
-
{
parentEndpoint
:
/vertx-web-3_6plus-scenario/case/web-case
,
networkAddress
:
'
'
,
refType
:
CrossThread
,
parentSpanId
:
2
,
parentTraceSegmentId
:
not null
,
parentServiceInstance
:
not null
,
parentService
:
vertx-web-3.6plus-scenario
,
traceId
:
not null
}
-
segmentId
:
not
null
spans
:
-
operationName
:
'
#/vertx-web-3_6plus-scenario/case/
healthCheck
'
-
operationName
:
'
#/vertx-web-3_6plus-scenario/case/
web-case/withBodyHandler
'
operationId
:
0
parentSpanId
:
-1
spanId
:
0
...
...
@@ -107,7 +200,7 @@ segmentItems:
peer
:
'
'
skipAnalysis
:
false
refs
:
-
{
parentEndpoint
:
/vertx-web-3_6plus-scenario/case/web-case
,
networkAddress
:
'
'
,
-
{
parentEndpoint
:
'
#/vertx-web-3_6plus-scenario/case/healthCheck'
,
networkAddress
:
'
'
,
refType
:
CrossThread
,
parentSpanId
:
1
,
parentTraceSegmentId
:
not null
,
parentServiceInstance
:
not null
,
parentService
:
vertx-web-3.6plus-scenario
,
traceId
:
not null
}
test/plugin/scenarios/vertx-web-3.6plus-scenario/pom.xml
浏览文件 @
705f97f2
...
...
@@ -30,7 +30,7 @@
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<compiler.version>
1.8
</compiler.version>
<test.framework.version>
3.9.
0
</test.framework.version>
<test.framework.version>
3.9.
1
</test.framework.version>
</properties>
<name>
skywalking-vertx-web-3.6plus-scenario
</name>
...
...
test/plugin/scenarios/vertx-web-3.6plus-scenario/src/main/java/org/apache/skywalking/apm/testcase/vertxweb/controller/VertxWebController.java
浏览文件 @
705f97f2
...
...
@@ -21,6 +21,7 @@ import io.vertx.core.AbstractVerticle;
import
io.vertx.ext.web.Router
;
import
io.vertx.ext.web.RoutingContext
;
import
io.vertx.ext.web.client.WebClient
;
import
io.vertx.ext.web.handler.BodyHandler
;
public
class
VertxWebController
extends
AbstractVerticle
{
...
...
@@ -28,14 +29,27 @@ public class VertxWebController extends AbstractVerticle {
public
void
start
()
{
Router
router
=
Router
.
router
(
vertx
);
router
.
get
(
"/vertx-web-3_6plus-scenario/case/web-case"
).
handler
(
this
::
handleWebCase
);
router
.
get
(
"/vertx-web-3_6plus-scenario/case/web-case/withBodyHandler"
)
.
handler
(
BodyHandler
.
create
()).
handler
(
this
::
withBodyHandler
);
router
.
head
(
"/vertx-web-3_6plus-scenario/case/healthCheck"
).
handler
(
this
::
healthCheck
);
vertx
.
createHttpServer
().
requestHandler
(
router
).
listen
(
8080
);
}
private
void
handleWebCase
(
RoutingContext
routingContext
)
{
WebClient
.
create
(
vertx
).
head
(
8080
,
"localhost"
,
"/vertx-web-3_6plus-scenario/case/healthCheck"
)
.
send
(
it
->
routingContext
.
response
().
setStatusCode
(
it
.
result
().
statusCode
()).
end
());
WebClient
.
create
(
vertx
).
head
(
8080
,
"localhost"
,
"/vertx-web-3_6plus-scenario/case/healthCheck"
)
.
send
(
healthCheck
->
{
if
(
healthCheck
.
succeeded
())
{
WebClient
.
create
(
vertx
).
get
(
8080
,
"localhost"
,
"/vertx-web-3_6plus-scenario/case/web-case/withBodyHandler"
)
.
send
(
it
->
routingContext
.
response
().
setStatusCode
(
it
.
result
().
statusCode
()).
end
());
}
else
{
healthCheck
.
cause
().
printStackTrace
();
routingContext
.
response
().
setStatusCode
(
500
).
end
();
}
});
}
private
void
withBodyHandler
(
RoutingContext
routingContext
)
{
routingContext
.
response
().
setStatusCode
(
200
).
end
(
"Success"
);
}
private
void
healthCheck
(
RoutingContext
routingContext
)
{
...
...
test/plugin/scenarios/vertx-web-3.6plus-scenario/support-version.list
浏览文件 @
705f97f2
...
...
@@ -14,6 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
3.9.1
3.9.0
3.8.5
3.8.4
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录