This is an automated email from the ASF dual-hosted git repository.
wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking.git
The following commit(s) were added to refs/heads/master by this push:
new 705f97f Increased Vert.x support (#4840)
705f97f is described below
commit 705f97f27ae7362bd87022b323a059f90b303fd1
Author: Brandon Fergerson <[email protected]>
AuthorDate: Mon Jun 1 17:00:16 2020 +0400
Increased Vert.x support (#4840)
---
.github/workflows/plugins-test.3.yaml | 4 +-
.../vertx-plugins/vertx-core-3.x-plugin/pom.xml | 14 ++-
.../ClusteredEventBusSendRemoteInterceptor.java | 2 +-
.../EventBusImplDeliverToHandlerInterceptor.java | 2 +-
.../vertx3/HandlerRegistrationInterceptor.java | 2 +-
...lientRequestImplHandleExceptionInterceptor.java | 1 -
...ClientRequestImplHandleResponseInterceptor.java | 23 ++--
....java => HttpClientRequestImplInterceptor.java} | 54 ++++++----
...pContextHandleDispatchResponseInterceptor.java} | 36 ++++---
...java => HttpContextSendRequestInterceptor.java} | 9 +-
...ttpServerRequestImplConstructorInterceptor.java | 30 ++++++
...ServerRequestWrapperConstructorInterceptor.java | 30 ++++++
...rverResponseImplHandleExceptionInterceptor.java | 1 -
...java => HttpServerResponseImplInterceptor.java} | 13 ++-
.../apm/plugin/vertx3/RouteStateInterceptor.java | 91 ++++++++++++++++
...ptor.java => RouterImplHandlerInterceptor.java} | 11 +-
...utingContextImplBaseConstructorInterceptor.java | 32 ++++++
...outingContextWrapperConstructorInterceptor.java | 30 ++++++
... ServerConnectionHandleMessageInterceptor.java} | 40 +++----
...ntRequestImplHandleResponseInstrumentation.java | 4 +-
...a => HttpClientRequestImplInstrumentation.java} | 13 +--
...textHandleDispatchResponseInstrumentation.java} | 42 ++++----
... => HttpContextSendRequestInstrumentation.java} | 42 ++++----
...rverRequestImplConstructorInstrumentation.java} | 48 ++++-----
...rRequestWrapperConstructorInstrumentation.java} | 50 ++++-----
...ResponseImplHandleExceptionInstrumentation.java | 2 +-
... => HttpServerResponseImplInstrumentation.java} | 23 +++-
...ntation.java => RouteStateInstrumentation.java} | 33 ++++--
...ContextImplBaseConstructorInstrumentation.java} | 50 ++++-----
....java => RouterImplHandlerInstrumentation.java} | 14 +--
...ntation.java => RouterImplInstrumentation.java} | 48 +++------
...gContextWrapperConstructorInstrumentation.java} | 50 ++++-----
...verConnectionHandleMessageInstrumentation.java} | 24 +++--
.../src/main/resources/skywalking-plugin.def | 17 ++-
.../config/expectedData.yaml | 20 +++-
.../support-version.list | 1 +
.../config/expectedData.yaml | 117 ++++++++++++++++++---
.../vertxweb/controller/VertxWebController.java | 16 ++-
.../config/expectedData.yaml | 117 ++++++++++++++++++---
.../scenarios/vertx-web-3.6plus-scenario/pom.xml | 2 +-
.../vertxweb/controller/VertxWebController.java | 20 +++-
.../support-version.list | 1 +
42 files changed, 826 insertions(+), 353 deletions(-)
diff --git a/.github/workflows/plugins-test.3.yaml
b/.github/workflows/plugins-test.3.yaml
index 63e30a3..10e06d8 100644
--- a/.github/workflows/plugins-test.3.yaml
+++ b/.github/workflows/plugins-test.3.yaml
@@ -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
diff --git
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/pom.xml
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/pom.xml
index 3090bf1..0625ab0 100644
--- a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/pom.xml
+++ b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/pom.xml
@@ -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>
diff --git
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/ClusteredEventBusSendRemoteInterceptor.java
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/ClusteredEventBusSendRemoteInterceptor.java
index 2b15cf1..47e0a20 100644
---
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/ClusteredEventBusSendRemoteInterceptor.java
+++
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/ClusteredEventBusSendRemoteInterceptor.java
@@ -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());
diff --git
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/EventBusImplDeliverToHandlerInterceptor.java
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/EventBusImplDeliverToHandlerInterceptor.java
index 709f875..8e32945 100644
---
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/EventBusImplDeliverToHandlerInterceptor.java
+++
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/EventBusImplDeliverToHandlerInterceptor.java
@@ -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());
diff --git
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HandlerRegistrationInterceptor.java
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HandlerRegistrationInterceptor.java
index cfb718c..ff8db51 100644
---
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HandlerRegistrationInterceptor.java
+++
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HandlerRegistrationInterceptor.java
@@ -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());
diff --git
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpClientRequestImplHandleExceptionInterceptor.java
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpClientRequestImplHandleExceptionInterceptor.java
index 43e526d..ef58d44 100644
---
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpClientRequestImplHandleExceptionInterceptor.java
+++
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpClientRequestImplHandleExceptionInterceptor.java
@@ -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();
diff --git
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpClientRequestImplHandleResponseInterceptor.java
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpClientRequestImplHandleResponseInterceptor.java
index 982a5f1..de6bfb7 100644
---
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpClientRequestImplHandleResponseInterceptor.java
+++
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpClientRequestImplHandleResponseInterceptor.java
@@ -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;
}
diff --git
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpClientRequestImplEndInterceptor.java
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpClientRequestImplInterceptor.java
similarity index 66%
rename from
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpClientRequestImplEndInterceptor.java
rename to
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpClientRequestImplInterceptor.java
index 1cc863c..08cf2ab 100644
---
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpClientRequestImplEndInterceptor.java
+++
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpClientRequestImplInterceptor.java
@@ -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;
}
diff --git
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpClientRequestImplHandleResponseInterceptor.java
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpContextHandleDispatchResponseInterceptor.java
similarity index 61%
copy from
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpClientRequestImplHandleResponseInterceptor.java
copy to
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpContextHandleDispatchResponseInterceptor.java
index 982a5f1..7b9f3a9 100644
---
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpClientRequestImplHandleResponseInterceptor.java
+++
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpContextHandleDispatchResponseInterceptor.java
@@ -18,7 +18,8 @@
package org.apache.skywalking.apm.plugin.vertx3;
-import io.vertx.core.http.HttpClientResponse;
+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;
@@ -27,38 +28,39 @@ 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;
-public class HttpClientRequestImplHandleResponseInterceptor implements
InstanceMethodsAroundInterceptor {
+public class HttpContextHandleDispatchResponseInterceptor implements
InstanceMethodsAroundInterceptor {
@Override
+ @SuppressWarnings("rawtypes")
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();
+ 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());
- }
+ 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 {
- if (VertxContext.VERTX_VERSION < 38 || allArguments.length == 2) {
- ContextManager.stopSpan();
- }
+ Object ret) throws Throwable {
+ ContextManager.stopSpan();
return ret;
}
@Override
public void handleMethodException(EnhancedInstance objInst, Method method,
Object[] allArguments,
- Class<?>[] argumentsTypes, Throwable t) {
+ Class<?>[] argumentsTypes, Throwable t) {
ContextManager.activeSpan().errorOccurred().log(t);
}
}
diff --git
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpClientRequestImplHandleExceptionInterceptor.java
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpContextSendRequestInterceptor.java
similarity index 82%
copy from
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpClientRequestImplHandleExceptionInterceptor.java
copy to
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpContextSendRequestInterceptor.java
index 43e526d..a90dd43 100644
---
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpClientRequestImplHandleExceptionInterceptor.java
+++
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpContextSendRequestInterceptor.java
@@ -22,17 +22,18 @@ 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 HttpClientRequestImplHandleExceptionInterceptor implements
InstanceMethodsAroundInterceptor {
+public class HttpContextSendRequestInterceptor 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();
- context.getSpan().errorOccurred().log((Throwable) allArguments[0]);
+ HttpClientRequestContext requestContext = (HttpClientRequestContext)
((EnhancedInstance) allArguments[0])
+ .getSkyWalkingDynamicField();
+ requestContext.usingWebClient = true;
}
@Override
diff --git
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpServerRequestImplConstructorInterceptor.java
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpServerRequestImplConstructorInterceptor.java
new file mode 100644
index 0000000..35e80af
--- /dev/null
+++
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpServerRequestImplConstructorInterceptor.java
@@ -0,0 +1,30 @@
+/*
+ * 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]);
+ }
+}
diff --git
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpServerRequestWrapperConstructorInterceptor.java
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpServerRequestWrapperConstructorInterceptor.java
new file mode 100644
index 0000000..e90514a
--- /dev/null
+++
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpServerRequestWrapperConstructorInterceptor.java
@@ -0,0 +1,30 @@
+/*
+ * 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());
+ }
+}
diff --git
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpServerResponseImplHandleExceptionInterceptor.java
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpServerResponseImplHandleExceptionInterceptor.java
index 2db587c..fd45615 100644
---
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpServerResponseImplHandleExceptionInterceptor.java
+++
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpServerResponseImplHandleExceptionInterceptor.java
@@ -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();
diff --git
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpServerResponseImplEndInterceptor.java
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpServerResponseImplInterceptor.java
similarity index 76%
copy from
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpServerResponseImplEndInterceptor.java
copy to
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpServerResponseImplInterceptor.java
index 2972093..83bb689 100644
---
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpServerResponseImplEndInterceptor.java
+++
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpServerResponseImplInterceptor.java
@@ -18,21 +18,30 @@
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 HttpServerResponseImplEndInterceptor implements
InstanceMethodsAroundInterceptor {
+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 <= 37 || allArguments.length == 2) {
+ 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();
diff --git
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/RouteStateInterceptor.java
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/RouteStateInterceptor.java
new file mode 100644
index 0000000..3e8b56f
--- /dev/null
+++
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/RouteStateInterceptor.java
@@ -0,0 +1,91 @@
+/*
+ * 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);
+ }
+}
diff --git
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpServerResponseImplEndInterceptor.java
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/RouterImplHandlerInterceptor.java
similarity index 78%
rename from
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpServerResponseImplEndInterceptor.java
rename to
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/RouterImplHandlerInterceptor.java
index 2972093..91b30a4 100644
---
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpServerResponseImplEndInterceptor.java
+++
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/RouterImplHandlerInterceptor.java
@@ -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 HttpServerResponseImplEndInterceptor implements
InstanceMethodsAroundInterceptor {
+public class RouterImplHandlerInterceptor 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]));
}
}
diff --git
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/RoutingContextImplBaseConstructorInterceptor.java
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/RoutingContextImplBaseConstructorInterceptor.java
new file mode 100644
index 0000000..9751d4b
--- /dev/null
+++
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/RoutingContextImplBaseConstructorInterceptor.java
@@ -0,0 +1,32 @@
+/*
+ * 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));
+ }
+}
diff --git
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/RoutingContextWrapperConstructorInterceptor.java
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/RoutingContextWrapperConstructorInterceptor.java
new file mode 100644
index 0000000..e63ea34
--- /dev/null
+++
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/RoutingContextWrapperConstructorInterceptor.java
@@ -0,0 +1,30 @@
+/*
+ * 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());
+ }
+}
diff --git
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/RouterImplAcceptInterceptor.java
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/ServerConnectionHandleMessageInterceptor.java
similarity index 68%
rename from
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/RouterImplAcceptInterceptor.java
rename to
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/ServerConnectionHandleMessageInterceptor.java
index 0eb4470..37f50fc 100644
---
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/RouterImplAcceptInterceptor.java
+++
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/ServerConnectionHandleMessageInterceptor.java
@@ -18,7 +18,7 @@
package org.apache.skywalking.apm.plugin.vertx3;
-import io.vertx.core.http.HttpServerRequest;
+import io.netty.handler.codec.http.HttpRequest;
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 RouterImplAcceptInterceptor implements
InstanceMethodsAroundInterceptor {
+public class ServerConnectionHandleMessageInterceptor 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.uri()), contextCarrier);
- span.setComponent(ComponentsDefine.VERTX);
- SpanLayer.asHttp(span);
- Tags.HTTP.METHOD.set(span, request.method().toString());
- Tags.URL.set(span, request.uri());
+ AbstractSpan span =
ContextManager.createEntrySpan(toPath(request.getUri()), contextCarrier);
+ span.setComponent(ComponentsDefine.VERTX);
+ SpanLayer.asHttp(span);
+ Tags.HTTP.METHOD.set(span, request.getMethod().toString());
+ Tags.URL.set(span, request.getUri());
- ((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;
}
diff --git
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/HttpClientRequestImplHandleResponseInstrumentation.java
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/HttpClientRequestImplHandleResponseInstrumentation.java
index d421298..63d4d1b 100644
---
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/HttpClientRequestImplHandleResponseInstrumentation.java
+++
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/HttpClientRequestImplHandleResponseInstrumentation.java
@@ -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 {
diff --git
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/HttpClientRequestImplEndInstrumentation.java
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/HttpClientRequestImplInstrumentation.java
similarity index 89%
copy from
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/HttpClientRequestImplEndInstrumentation.java
copy to
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/HttpClientRequestImplInstrumentation.java
index bc8b2fa..9f04780 100644
---
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/HttpClientRequestImplEndInstrumentation.java
+++
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/HttpClientRequestImplInstrumentation.java
@@ -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 HttpClientRequestImplEndInstrumentation} enhance the
<code>end</code> method in
+ * {@link HttpClientRequestImplInstrumentation} enhance the
<code>end/sendHead</code> methods in
* <code>io.vertx.core.http.impl.HttpClientRequestImpl</code> class by
- * <code>HttpClientRequestImplEndInterceptor</code> class
+ * <code>HttpClientRequestImplInterceptor</code> class
*/
-public class HttpClientRequestImplEndInstrumentation 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
diff --git
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/RouterImplAcceptInstrumentation.java
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/HttpContextHandleDispatchResponseInstrumentation.java
similarity index 64%
copy from
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/RouterImplAcceptInstrumentation.java
copy to
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/HttpContextHandleDispatchResponseInstrumentation.java
index 3fddc8b..454ad40 100644
---
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/RouterImplAcceptInstrumentation.java
+++
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/HttpContextHandleDispatchResponseInstrumentation.java
@@ -29,17 +29,17 @@ import
org.apache.skywalking.apm.agent.core.plugin.match.NameMatch;
import static net.bytebuddy.matcher.ElementMatchers.named;
/**
- * {@link RouterImplAcceptInstrumentation} enhance the <code>accept</code>
method in
- * <code>io.vertx.ext.web.impl.RouterImpl</code> class by
- * <code>RouterImplAcceptInterceptor</code> class.
+ * {@link HttpContextHandleDispatchResponseInstrumentation} enhance the
<code>handleDispatchResponse</code> method in
+ * <code>io.vertx.ext.web.client.impl.HttpContext</code> class by
+ * <code>HttpContextHandleDispatchResponseInterceptor</code> class.
*
- * Targets: ver. 3.0.0 - 3.5.4
+ * Ver. 3.6.0+
*/
-public class RouterImplAcceptInstrumentation extends
ClassInstanceMethodsEnhancePluginDefine {
+public class HttpContextHandleDispatchResponseInstrumentation extends
ClassInstanceMethodsEnhancePluginDefine {
- private static final String ENHANCE_CLASS =
"io.vertx.ext.web.impl.RouterImpl";
- private static final String ENHANCE_METHOD = "accept";
- private static final String INTERCEPT_CLASS =
"org.apache.skywalking.apm.plugin.vertx3.RouterImplAcceptInterceptor";
+ 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() {
@@ -49,22 +49,22 @@ public class RouterImplAcceptInstrumentation extends
ClassInstanceMethodsEnhance
@Override
public InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints()
{
return new InstanceMethodsInterceptPoint[] {
- new InstanceMethodsInterceptPoint() {
- @Override
- public ElementMatcher<MethodDescription> getMethodsMatcher() {
- return named(ENHANCE_METHOD);
- }
+ new InstanceMethodsInterceptPoint() {
+ @Override
+ public ElementMatcher<MethodDescription>
getMethodsMatcher() {
+ return named(ENHANCE_METHOD);
+ }
- @Override
- public String getMethodsInterceptor() {
- return INTERCEPT_CLASS;
- }
+ @Override
+ public String getMethodsInterceptor() {
+ return INTERCEPT_CLASS;
+ }
- @Override
- public boolean isOverrideArgs() {
- return false;
+ @Override
+ public boolean isOverrideArgs() {
+ return false;
+ }
}
- }
};
}
diff --git
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/RouterImplAcceptInstrumentation.java
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/HttpContextSendRequestInstrumentation.java
similarity index 66%
copy from
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/RouterImplAcceptInstrumentation.java
copy to
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/HttpContextSendRequestInstrumentation.java
index 3fddc8b..a4cc50d 100644
---
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/RouterImplAcceptInstrumentation.java
+++
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/HttpContextSendRequestInstrumentation.java
@@ -29,17 +29,15 @@ import
org.apache.skywalking.apm.agent.core.plugin.match.NameMatch;
import static net.bytebuddy.matcher.ElementMatchers.named;
/**
- * {@link RouterImplAcceptInstrumentation} enhance the <code>accept</code>
method in
- * <code>io.vertx.ext.web.impl.RouterImpl</code> class by
- * <code>RouterImplAcceptInterceptor</code> class.
- *
- * Targets: ver. 3.0.0 - 3.5.4
+ * {@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 RouterImplAcceptInstrumentation extends
ClassInstanceMethodsEnhancePluginDefine {
+public class HttpContextSendRequestInstrumentation extends
ClassInstanceMethodsEnhancePluginDefine {
- private static final String ENHANCE_CLASS =
"io.vertx.ext.web.impl.RouterImpl";
- private static final String ENHANCE_METHOD = "accept";
- private static final String INTERCEPT_CLASS =
"org.apache.skywalking.apm.plugin.vertx3.RouterImplAcceptInterceptor";
+ 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() {
@@ -49,22 +47,22 @@ public class RouterImplAcceptInstrumentation extends
ClassInstanceMethodsEnhance
@Override
public InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints()
{
return new InstanceMethodsInterceptPoint[] {
- new InstanceMethodsInterceptPoint() {
- @Override
- public ElementMatcher<MethodDescription> getMethodsMatcher() {
- return named(ENHANCE_METHOD);
- }
+ new InstanceMethodsInterceptPoint() {
+ @Override
+ public ElementMatcher<MethodDescription>
getMethodsMatcher() {
+ return named(ENHANCE_METHOD);
+ }
- @Override
- public String getMethodsInterceptor() {
- return INTERCEPT_CLASS;
- }
+ @Override
+ public String getMethodsInterceptor() {
+ return INTERCEPT_CLASS;
+ }
- @Override
- public boolean isOverrideArgs() {
- return false;
+ @Override
+ public boolean isOverrideArgs() {
+ return false;
+ }
}
- }
};
}
diff --git
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/HttpClientRequestImplHandleResponseInstrumentation.java
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/HttpServerRequestImplConstructorInstrumentation.java
similarity index 61%
copy from
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/HttpClientRequestImplHandleResponseInstrumentation.java
copy to
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/HttpServerRequestImplConstructorInstrumentation.java
index d421298..054f5bb 100644
---
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/HttpClientRequestImplHandleResponseInstrumentation.java
+++
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/HttpServerRequestImplConstructorInstrumentation.java
@@ -26,44 +26,38 @@ 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.named;
+import static net.bytebuddy.matcher.ElementMatchers.any;
/**
- * {@link HttpClientRequestImplHandleResponseInstrumentation} enhance the
<code>handleResponse</code> method in
- * <code>io.vertx.core.http.impl.HttpClientRequestImpl</code> class by
- * <code>HttpClientRequestImplHandleResponseInterceptor</code> class
+ * {@link HttpServerRequestImplConstructorInstrumentation} enhance the
constructor in
+ * <code>io.vertx.core.http.impl.HttpServerRequestImpl</code> class by
+ * <code>HttpServerRequestImplConstructorInterceptor</code> class.
*/
-public class HttpClientRequestImplHandleResponseInstrumentation extends
ClassInstanceMethodsEnhancePluginDefine {
+public class HttpServerRequestImplConstructorInstrumentation extends
ClassInstanceMethodsEnhancePluginDefine {
- private static final String ENHANCE_CLASS =
"io.vertx.core.http.impl.HttpClientRequestImpl";
- private static final String ENHANCE_METHOD = "handleResponse";
- private static final String INTERCEPT_CLASS =
"org.apache.skywalking.apm.plugin.vertx3.HttpClientRequestImplHandleResponseInterceptor";
+ 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[0];
+ 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;
- }
- }
- };
+ return new InstanceMethodsInterceptPoint[0];
}
@Override
diff --git
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/RouterImplHandleInstrumentation.java
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/HttpServerRequestWrapperConstructorInstrumentation.java
similarity index 62%
copy from
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/RouterImplHandleInstrumentation.java
copy to
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/HttpServerRequestWrapperConstructorInstrumentation.java
index 431bcf2..2a0d468 100644
---
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/RouterImplHandleInstrumentation.java
+++
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/HttpServerRequestWrapperConstructorInstrumentation.java
@@ -26,46 +26,38 @@ 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.named;
+import static net.bytebuddy.matcher.ElementMatchers.any;
/**
- * {@link RouterImplHandleInstrumentation} enhance the <code>handle</code>
method in
- * <code>io.vertx.ext.web.impl.RouterImpl</code> class by
- * <code>RouterImplAcceptInterceptor</code> class.
- *
- * Targets: ver. 3.6.0+
+ * {@link HttpServerRequestWrapperConstructorInstrumentation} enhance the
constructor in
+ * <code>io.vertx.ext.web.impl.HttpServerRequestWrapper</code> class by
+ * <code>HttpServerRequestWrapperConstructorInterceptor</code> class.
*/
-public class RouterImplHandleInstrumentation extends
ClassInstanceMethodsEnhancePluginDefine {
+public class HttpServerRequestWrapperConstructorInstrumentation extends
ClassInstanceMethodsEnhancePluginDefine {
- private static final String ENHANCE_CLASS =
"io.vertx.ext.web.impl.RouterImpl";
- private static final String ENHANCE_METHOD = "handle";
- private static final String INTERCEPT_CLASS =
"org.apache.skywalking.apm.plugin.vertx3.RouterImplAcceptInterceptor";
+ 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[0];
+ 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;
- }
- }
- };
+ return new InstanceMethodsInterceptPoint[0];
}
@Override
diff --git
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/HttpServerResponseImplHandleExceptionInstrumentation.java
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/HttpServerResponseImplHandleExceptionInstrumentation.java
index ba7f27b..0bac299 100644
---
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/HttpServerResponseImplHandleExceptionInstrumentation.java
+++
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/HttpServerResponseImplHandleExceptionInstrumentation.java
@@ -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 {
diff --git
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/HttpServerResponseImplEndInstrumentation.java
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/HttpServerResponseImplInstrumentation.java
similarity index 78%
rename from
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/HttpServerResponseImplEndInstrumentation.java
rename to
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/HttpServerResponseImplInstrumentation.java
index 9584194..87d6425 100644
---
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/HttpServerResponseImplEndInstrumentation.java
+++
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/HttpServerResponseImplInstrumentation.java
@@ -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 HttpServerResponseImplEndInstrumentation} enhance the
<code>end</code> method in
+ * {@link HttpServerResponseImplInstrumentation} enhance the
<code>end0/end</code> method in
* <code>io.vertx.core.http.impl.HttpServerResponseImpl</code> class by
- * <code>HttpServerResponseImplEndInterceptor</code> class
+ * <code>HttpServerResponseImplInterceptor</code> class
*/
-public class HttpServerResponseImplEndInstrumentation 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.HttpServerResponseImplEndInterceptor";
+ 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
diff --git
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/RouterImplAcceptInstrumentation.java
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/RouteStateInstrumentation.java
similarity index 71%
copy from
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/RouterImplAcceptInstrumentation.java
copy to
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/RouteStateInstrumentation.java
index 3fddc8b..47d37e5 100644
---
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/RouterImplAcceptInstrumentation.java
+++
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/RouteStateInstrumentation.java
@@ -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 RouterImplAcceptInstrumentation} enhance the <code>accept</code>
method in
- * <code>io.vertx.ext.web.impl.RouterImpl</code> class by
- * <code>RouterImplAcceptInterceptor</code> class.
+ * {@link RouteStateInstrumentation} enhance the <code>handleContext</code>
method in
+ * <code>io.vertx.ext.web.impl.RouteState</code> class by
+ * <code>RouteStateInterceptor</code> class.
*
- * Targets: ver. 3.0.0 - 3.5.4
+ * Ver. 3.8.3+
*/
-public class RouterImplAcceptInstrumentation extends
ClassInstanceMethodsEnhancePluginDefine {
+public class RouteStateInstrumentation extends
ClassInstanceMethodsEnhancePluginDefine {
- private static final String ENHANCE_CLASS =
"io.vertx.ext.web.impl.RouterImpl";
- private static final String ENHANCE_METHOD = "accept";
- private static final String INTERCEPT_CLASS =
"org.apache.skywalking.apm.plugin.vertx3.RouterImplAcceptInterceptor";
+ private static final String ENHANCE_CLASS =
"io.vertx.ext.web.impl.RouteState";
+ 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[0];
+ return new ConstructorInterceptPoint[] {
+ new ConstructorInterceptPoint() {
+ @Override
+ public ElementMatcher<MethodDescription>
getConstructorMatcher() {
+ return takesArgument(8, List.class);
+ }
+
+ @Override
+ public String getConstructorInterceptor() {
+ return INTERCEPT_CLASS;
+ }
+ }
+ };
}
@Override
diff --git
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/RouterImplHandleInstrumentation.java
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/RouterContextImplBaseConstructorInstrumentation.java
similarity index 62%
copy from
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/RouterImplHandleInstrumentation.java
copy to
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/RouterContextImplBaseConstructorInstrumentation.java
index 431bcf2..13912d2 100644
---
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/RouterImplHandleInstrumentation.java
+++
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/RouterContextImplBaseConstructorInstrumentation.java
@@ -26,46 +26,38 @@ 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.named;
+import static net.bytebuddy.matcher.ElementMatchers.any;
/**
- * {@link RouterImplHandleInstrumentation} enhance the <code>handle</code>
method in
- * <code>io.vertx.ext.web.impl.RouterImpl</code> class by
- * <code>RouterImplAcceptInterceptor</code> class.
- *
- * Targets: ver. 3.6.0+
+ * {@link RouterContextImplBaseConstructorInstrumentation} enhance the
constructor in
+ * <code>io.vertx.ext.web.impl.RoutingContextImplBase</code> class by
+ * <code>RoutingContextImplBaseConstructorInterceptor</code> class.
*/
-public class RouterImplHandleInstrumentation extends
ClassInstanceMethodsEnhancePluginDefine {
+public class RouterContextImplBaseConstructorInstrumentation extends
ClassInstanceMethodsEnhancePluginDefine {
- private static final String ENHANCE_CLASS =
"io.vertx.ext.web.impl.RouterImpl";
- private static final String ENHANCE_METHOD = "handle";
- private static final String INTERCEPT_CLASS =
"org.apache.skywalking.apm.plugin.vertx3.RouterImplAcceptInterceptor";
+ 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[0];
+ 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;
- }
- }
- };
+ return new InstanceMethodsInterceptPoint[0];
}
@Override
diff --git
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/RouterImplHandleInstrumentation.java
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/RouterImplHandlerInstrumentation.java
similarity index 86%
copy from
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/RouterImplHandleInstrumentation.java
copy to
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/RouterImplHandlerInstrumentation.java
index 431bcf2..7ae3cf7 100644
---
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/RouterImplHandleInstrumentation.java
+++
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/RouterImplHandlerInstrumentation.java
@@ -29,17 +29,17 @@ import
org.apache.skywalking.apm.agent.core.plugin.match.NameMatch;
import static net.bytebuddy.matcher.ElementMatchers.named;
/**
- * {@link RouterImplHandleInstrumentation} enhance the <code>handle</code>
method in
+ * {@link RouterImplHandlerInstrumentation} enhance the <code>handler</code>
method in
* <code>io.vertx.ext.web.impl.RouterImpl</code> class by
- * <code>RouterImplAcceptInterceptor</code> class.
+ * <code>RouterImplHandlerInterceptor</code> class.
*
- * Targets: ver. 3.6.0+
+ * Ver. 3.0.0 - 3.4.2
*/
-public class RouterImplHandleInstrumentation extends
ClassInstanceMethodsEnhancePluginDefine {
+public class RouterImplHandlerInstrumentation extends
ClassInstanceMethodsEnhancePluginDefine {
- private static final String ENHANCE_CLASS =
"io.vertx.ext.web.impl.RouterImpl";
- private static final String ENHANCE_METHOD = "handle";
- private static final String INTERCEPT_CLASS =
"org.apache.skywalking.apm.plugin.vertx3.RouterImplAcceptInterceptor";
+ private static final String ENHANCE_CLASS =
"io.vertx.ext.web.impl.RouteImpl";
+ private static final String ENHANCE_METHOD = "handler";
+ private static final String INTERCEPT_CLASS =
"org.apache.skywalking.apm.plugin.vertx3.RouterImplHandlerInterceptor";
@Override
public ConstructorInterceptPoint[] getConstructorsInterceptPoints() {
diff --git
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/HttpClientRequestImplEndInstrumentation.java
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/RouterImplInstrumentation.java
similarity index 60%
rename from
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/HttpClientRequestImplEndInstrumentation.java
rename to
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/RouterImplInstrumentation.java
index bc8b2fa..0aa072e 100644
---
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/HttpClientRequestImplEndInstrumentation.java
+++
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/RouterImplInstrumentation.java
@@ -26,54 +26,34 @@ 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 net.bytebuddy.matcher.ElementMatchers.takesArgument;
/**
- * {@link HttpClientRequestImplEndInstrumentation} enhance the
<code>end</code> method in
- * <code>io.vertx.core.http.impl.HttpClientRequestImpl</code> class by
- * <code>HttpClientRequestImplEndInterceptor</code> class
+ * {@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 HttpClientRequestImplEndInstrumentation extends
ClassInstanceMethodsEnhancePluginDefine {
+public class RouterImplInstrumentation 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 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 takesArgument(3, int.class);
- }
-
- @Override
- public String getConstructorInterceptor() {
- return INTERCEPT_CLASS +
"$Version30XTo33XConstructorInterceptor";
- }
- },
+ return new ConstructorInterceptPoint[] {
new ConstructorInterceptPoint() {
@Override
public ElementMatcher<MethodDescription>
getConstructorMatcher() {
- return takesArgument(4, int.class);
+ return any();
}
@Override
public String getConstructorInterceptor() {
- return INTERCEPT_CLASS +
"$Version34XTo37XConstructorInterceptor";
- }
- },
- new ConstructorInterceptPoint() {
- @Override
- public ElementMatcher<MethodDescription>
getConstructorMatcher() {
- return takesArgument(5, int.class);
- }
-
- @Override
- public String getConstructorInterceptor() {
- return INTERCEPT_CLASS +
"$Version38PlusConstructorInterceptor";
+ return INTERCEPT_CLASS;
}
}
};
@@ -81,7 +61,7 @@ public class HttpClientRequestImplEndInstrumentation extends
ClassInstanceMethod
@Override
public InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints()
{
- return new InstanceMethodsInterceptPoint[]{
+ return new InstanceMethodsInterceptPoint[] {
new InstanceMethodsInterceptPoint() {
@Override
public ElementMatcher<MethodDescription>
getMethodsMatcher() {
diff --git
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/RouterImplHandleInstrumentation.java
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/RoutingContextWrapperConstructorInstrumentation.java
similarity index 63%
rename from
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/RouterImplHandleInstrumentation.java
rename to
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/RoutingContextWrapperConstructorInstrumentation.java
index 431bcf2..b010d30 100644
---
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/RouterImplHandleInstrumentation.java
+++
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/RoutingContextWrapperConstructorInstrumentation.java
@@ -26,46 +26,40 @@ 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.named;
+import static net.bytebuddy.matcher.ElementMatchers.any;
/**
- * {@link RouterImplHandleInstrumentation} enhance the <code>handle</code>
method in
- * <code>io.vertx.ext.web.impl.RouterImpl</code> class by
- * <code>RouterImplAcceptInterceptor</code> class.
+ * {@link RoutingContextWrapperConstructorInstrumentation} enhance the
constructor in
+ * <code>io.vertx.ext.web.impl.RoutingContextWrapper</code> class by
+ * <code>RoutingContextWrapperInterceptor</code> class.
*
- * Targets: ver. 3.6.0+
+ * Ver. 3.1.0+
*/
-public class RouterImplHandleInstrumentation extends
ClassInstanceMethodsEnhancePluginDefine {
+public class RoutingContextWrapperConstructorInstrumentation extends
ClassInstanceMethodsEnhancePluginDefine {
- private static final String ENHANCE_CLASS =
"io.vertx.ext.web.impl.RouterImpl";
- private static final String ENHANCE_METHOD = "handle";
- private static final String INTERCEPT_CLASS =
"org.apache.skywalking.apm.plugin.vertx3.RouterImplAcceptInterceptor";
+ 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[0];
+ 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;
- }
- }
- };
+ return new InstanceMethodsInterceptPoint[0];
}
@Override
diff --git
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/RouterImplAcceptInstrumentation.java
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/ServerConnectionHandleMessageInstrumentation.java
similarity index 69%
rename from
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/RouterImplAcceptInstrumentation.java
rename to
apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/ServerConnectionHandleMessageInstrumentation.java
index 3fddc8b..24c1b81 100644
---
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/RouterImplAcceptInstrumentation.java
+++
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/define/ServerConnectionHandleMessageInstrumentation.java
@@ -24,22 +24,21 @@ import
org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterc
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 org.apache.skywalking.apm.agent.core.plugin.match.MultiClassNameMatch;
import static net.bytebuddy.matcher.ElementMatchers.named;
/**
- * {@link RouterImplAcceptInstrumentation} enhance the <code>accept</code>
method in
- * <code>io.vertx.ext.web.impl.RouterImpl</code> class by
- * <code>RouterImplAcceptInterceptor</code> class.
- *
- * Targets: ver. 3.0.0 - 3.5.4
+ * {@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 RouterImplAcceptInstrumentation extends
ClassInstanceMethodsEnhancePluginDefine {
+public class ServerConnectionHandleMessageInstrumentation extends
ClassInstanceMethodsEnhancePluginDefine {
- private static final String ENHANCE_CLASS =
"io.vertx.ext.web.impl.RouterImpl";
- private static final String ENHANCE_METHOD = "accept";
- private static final String INTERCEPT_CLASS =
"org.apache.skywalking.apm.plugin.vertx3.RouterImplAcceptInterceptor";
+ 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() {
@@ -70,6 +69,9 @@ public class RouterImplAcceptInstrumentation extends
ClassInstanceMethodsEnhance
@Override
protected ClassMatch enhanceClass() {
- return NameMatch.byName(ENHANCE_CLASS);
+ return MultiClassNameMatch.byMultiClassMatch(
+ HTTP_SERVER_CONNECTION_ENHANCE_CLASS, //ver. 3.5.1+
+ SERVER_CONNECTION_ENHANCE_CLASS //ver. 3.0.0 - 3.5.0
+ );
}
}
diff --git
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/resources/skywalking-plugin.def
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/resources/skywalking-plugin.def
index 380bee3..94bd3a1 100644
---
a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/resources/skywalking-plugin.def
+++
b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/resources/skywalking-plugin.def
@@ -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.HttpClientRequestImplEndInstrumentation
+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.HttpServerResponseImplEndInstrumentation
+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
diff --git
a/test/plugin/scenarios/vertx-eventbus-3.x-scenario/config/expectedData.yaml
b/test/plugin/scenarios/vertx-eventbus-3.x-scenario/config/expectedData.yaml
index ee80805..50fc7cc 100644
--- a/test/plugin/scenarios/vertx-eventbus-3.x-scenario/config/expectedData.yaml
+++ b/test/plugin/scenarios/vertx-eventbus-3.x-scenario/config/expectedData.yaml
@@ -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}
diff --git
a/test/plugin/scenarios/vertx-eventbus-3.x-scenario/support-version.list
b/test/plugin/scenarios/vertx-eventbus-3.x-scenario/support-version.list
index 071d082..351da62 100644
--- a/test/plugin/scenarios/vertx-eventbus-3.x-scenario/support-version.list
+++ b/test/plugin/scenarios/vertx-eventbus-3.x-scenario/support-version.list
@@ -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
diff --git
a/test/plugin/scenarios/vertx-web-3.54minus-scenario/config/expectedData.yaml
b/test/plugin/scenarios/vertx-web-3.54minus-scenario/config/expectedData.yaml
index eaa009e..cf100f5 100644
---
a/test/plugin/scenarios/vertx-web-3.54minus-scenario/config/expectedData.yaml
+++
b/test/plugin/scenarios/vertx-web-3.54minus-scenario/config/expectedData.yaml
@@ -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
@@ -39,6 +43,48 @@ segmentItems:
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
spanId: 0
spanLayer: Http
@@ -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}
diff --git
a/test/plugin/scenarios/vertx-web-3.54minus-scenario/src/main/java/org/apache/skywalking/apm/testcase/vertxweb/controller/VertxWebController.java
b/test/plugin/scenarios/vertx-web-3.54minus-scenario/src/main/java/org/apache/skywalking/apm/testcase/vertxweb/controller/VertxWebController.java
index 3fb9be7..39cf6e4 100644
---
a/test/plugin/scenarios/vertx-web-3.54minus-scenario/src/main/java/org/apache/skywalking/apm/testcase/vertxweb/controller/VertxWebController.java
+++
b/test/plugin/scenarios/vertx-web-3.54minus-scenario/src/main/java/org/apache/skywalking/apm/testcase/vertxweb/controller/VertxWebController.java
@@ -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) {
diff --git
a/test/plugin/scenarios/vertx-web-3.6plus-scenario/config/expectedData.yaml
b/test/plugin/scenarios/vertx-web-3.6plus-scenario/config/expectedData.yaml
index 2defdef..d22e4f1 100644
--- a/test/plugin/scenarios/vertx-web-3.6plus-scenario/config/expectedData.yaml
+++ b/test/plugin/scenarios/vertx-web-3.6plus-scenario/config/expectedData.yaml
@@ -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
@@ -39,6 +43,48 @@ segmentItems:
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
spanId: 0
spanLayer: Http
@@ -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}
diff --git a/test/plugin/scenarios/vertx-web-3.6plus-scenario/pom.xml
b/test/plugin/scenarios/vertx-web-3.6plus-scenario/pom.xml
index c8b5a4b..d8dbe1d 100644
--- a/test/plugin/scenarios/vertx-web-3.6plus-scenario/pom.xml
+++ b/test/plugin/scenarios/vertx-web-3.6plus-scenario/pom.xml
@@ -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>
diff --git
a/test/plugin/scenarios/vertx-web-3.6plus-scenario/src/main/java/org/apache/skywalking/apm/testcase/vertxweb/controller/VertxWebController.java
b/test/plugin/scenarios/vertx-web-3.6plus-scenario/src/main/java/org/apache/skywalking/apm/testcase/vertxweb/controller/VertxWebController.java
index 34d81d8..4ea37fb 100644
---
a/test/plugin/scenarios/vertx-web-3.6plus-scenario/src/main/java/org/apache/skywalking/apm/testcase/vertxweb/controller/VertxWebController.java
+++
b/test/plugin/scenarios/vertx-web-3.6plus-scenario/src/main/java/org/apache/skywalking/apm/testcase/vertxweb/controller/VertxWebController.java
@@ -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) {
diff --git
a/test/plugin/scenarios/vertx-web-3.6plus-scenario/support-version.list
b/test/plugin/scenarios/vertx-web-3.6plus-scenario/support-version.list
index d6fba3e..83daf2f 100644
--- a/test/plugin/scenarios/vertx-web-3.6plus-scenario/support-version.list
+++ b/test/plugin/scenarios/vertx-web-3.6plus-scenario/support-version.list
@@ -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