Increased Vert.x support (#4840)
This commit is contained in:
parent
deccc262f3
commit
705f97f27a
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
package org.apache.skywalking.apm.plugin.vertx3;
|
||||
|
||||
import io.vertx.core.http.HttpClientRequest;
|
||||
import io.vertx.ext.web.client.impl.HttpContext;
|
||||
import org.apache.skywalking.apm.agent.core.context.ContextManager;
|
||||
import org.apache.skywalking.apm.agent.core.context.tag.Tags;
|
||||
import org.apache.skywalking.apm.agent.core.context.trace.AbstractSpan;
|
||||
import org.apache.skywalking.apm.agent.core.context.trace.SpanLayer;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult;
|
||||
import org.apache.skywalking.apm.network.trace.component.ComponentsDefine;
|
||||
import org.apache.skywalking.apm.plugin.vertx3.HttpClientRequestImplInterceptor.HttpClientRequestContext;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
public class HttpContextHandleDispatchResponseInterceptor implements InstanceMethodsAroundInterceptor {
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("rawtypes")
|
||||
public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
|
||||
MethodInterceptResult result) throws Throwable {
|
||||
HttpContext httpContext = (HttpContext) objInst;
|
||||
HttpClientRequest clientRequest = httpContext.clientRequest();
|
||||
VertxContext context = ((HttpClientRequestContext) ((EnhancedInstance) clientRequest)
|
||||
.getSkyWalkingDynamicField()).vertxContext;
|
||||
Tags.STATUS_CODE.set(context.getSpan(), Integer.toString(httpContext.clientResponse().statusCode()));
|
||||
context.getSpan().asyncFinish();
|
||||
|
||||
AbstractSpan span = ContextManager.createLocalSpan("#" + context.getSpan().getOperationName());
|
||||
span.setComponent(ComponentsDefine.VERTX);
|
||||
SpanLayer.asHttp(span);
|
||||
ContextManager.continued(context.getContextSnapshot());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
|
||||
Object ret) throws Throwable {
|
||||
ContextManager.stopSpan();
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments,
|
||||
Class<?>[] argumentsTypes, Throwable t) {
|
||||
ContextManager.activeSpan().errorOccurred().log(t);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
package org.apache.skywalking.apm.plugin.vertx3;
|
||||
|
||||
import org.apache.skywalking.apm.agent.core.context.ContextManager;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult;
|
||||
import org.apache.skywalking.apm.plugin.vertx3.HttpClientRequestImplInterceptor.HttpClientRequestContext;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
public class HttpContextSendRequestInterceptor implements InstanceMethodsAroundInterceptor {
|
||||
|
||||
@Override
|
||||
public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
|
||||
MethodInterceptResult result) throws Throwable {
|
||||
HttpClientRequestContext requestContext = (HttpClientRequestContext) ((EnhancedInstance) allArguments[0])
|
||||
.getSkyWalkingDynamicField();
|
||||
requestContext.usingWebClient = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
|
||||
Object ret) throws Throwable {
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments,
|
||||
Class<?>[] argumentsTypes, Throwable t) {
|
||||
ContextManager.activeSpan().errorOccurred().log(t);
|
||||
}
|
||||
}
|
||||
|
|
@ -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]);
|
||||
}
|
||||
}
|
||||
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -0,0 +1,62 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
package org.apache.skywalking.apm.plugin.vertx3;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.vertx.core.http.HttpServerResponse;
|
||||
import org.apache.skywalking.apm.agent.core.context.ContextManager;
|
||||
import org.apache.skywalking.apm.agent.core.context.tag.Tags;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceConstructorInterceptor;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
public class HttpServerResponseImplInterceptor implements InstanceMethodsAroundInterceptor,
|
||||
InstanceConstructorInterceptor {
|
||||
|
||||
@Override
|
||||
public void onConstruct(EnhancedInstance objInst, Object[] allArguments) {
|
||||
objInst.setSkyWalkingDynamicField(((EnhancedInstance) allArguments[1]).getSkyWalkingDynamicField());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
|
||||
MethodInterceptResult result) throws Throwable {
|
||||
if ((VertxContext.VERTX_VERSION < 36 && allArguments[0] instanceof ByteBuf)
|
||||
|| ((VertxContext.VERTX_VERSION >= 36 && VertxContext.VERTX_VERSION <= 37) || allArguments.length == 2)) {
|
||||
VertxContext context = (VertxContext) objInst.getSkyWalkingDynamicField();
|
||||
Tags.STATUS_CODE.set(context.getSpan(), Integer.toString(((HttpServerResponse) objInst).getStatusCode()));
|
||||
context.getSpan().asyncFinish();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
|
||||
Object ret) throws Throwable {
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments,
|
||||
Class<?>[] argumentsTypes, Throwable t) {
|
||||
ContextManager.activeSpan().errorOccurred().log(t);
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
@ -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]));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
|
@ -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.getUri()), contextCarrier);
|
||||
span.setComponent(ComponentsDefine.VERTX);
|
||||
SpanLayer.asHttp(span);
|
||||
Tags.HTTP.METHOD.set(span, request.getMethod().toString());
|
||||
Tags.URL.set(span, request.getUri());
|
||||
|
||||
objInst.setSkyWalkingDynamicField(new VertxContext(ContextManager.capture(), span.prepareForAsync()));
|
||||
}
|
||||
|
||||
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());
|
||||
|
||||
((EnhancedInstance) request.response()).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;
|
||||
}
|
||||
|
||||
|
|
@ -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 {
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -0,0 +1,75 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
package org.apache.skywalking.apm.plugin.vertx3.define;
|
||||
|
||||
import net.bytebuddy.description.method.MethodDescription;
|
||||
import net.bytebuddy.matcher.ElementMatcher;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.match.NameMatch;
|
||||
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
|
||||
/**
|
||||
* {@link HttpContextHandleDispatchResponseInstrumentation} enhance the <code>handleDispatchResponse</code> method in
|
||||
* <code>io.vertx.ext.web.client.impl.HttpContext</code> class by
|
||||
* <code>HttpContextHandleDispatchResponseInterceptor</code> class.
|
||||
*
|
||||
* Ver. 3.6.0+
|
||||
*/
|
||||
public class HttpContextHandleDispatchResponseInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
|
||||
|
||||
private static final String ENHANCE_CLASS = "io.vertx.ext.web.client.impl.HttpContext";
|
||||
private static final String ENHANCE_METHOD = "handleDispatchResponse";
|
||||
private static final String INTERCEPT_CLASS = "org.apache.skywalking.apm.plugin.vertx3.HttpContextHandleDispatchResponseInterceptor";
|
||||
|
||||
@Override
|
||||
public ConstructorInterceptPoint[] getConstructorsInterceptPoints() {
|
||||
return new ConstructorInterceptPoint[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints() {
|
||||
return new InstanceMethodsInterceptPoint[] {
|
||||
new InstanceMethodsInterceptPoint() {
|
||||
@Override
|
||||
public ElementMatcher<MethodDescription> getMethodsMatcher() {
|
||||
return named(ENHANCE_METHOD);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMethodsInterceptor() {
|
||||
return INTERCEPT_CLASS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOverrideArgs() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ClassMatch enhanceClass() {
|
||||
return NameMatch.byName(ENHANCE_CLASS);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,73 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
package org.apache.skywalking.apm.plugin.vertx3.define;
|
||||
|
||||
import net.bytebuddy.description.method.MethodDescription;
|
||||
import net.bytebuddy.matcher.ElementMatcher;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.match.NameMatch;
|
||||
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
|
||||
/**
|
||||
* {@link HttpContextSendRequestInstrumentation} enhance the <code>sendRequest</code> method in
|
||||
* <code>io.vertx.ext.web.client.impl.HttpContext</code> class by
|
||||
* <code>HttpContextSendRequestInterceptor</code> class.
|
||||
*/
|
||||
public class HttpContextSendRequestInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
|
||||
|
||||
private static final String ENHANCE_CLASS = "io.vertx.ext.web.client.impl.HttpContext";
|
||||
private static final String ENHANCE_METHOD = "sendRequest";
|
||||
private static final String INTERCEPT_CLASS = "org.apache.skywalking.apm.plugin.vertx3.HttpContextSendRequestInterceptor";
|
||||
|
||||
@Override
|
||||
public ConstructorInterceptPoint[] getConstructorsInterceptPoints() {
|
||||
return new ConstructorInterceptPoint[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints() {
|
||||
return new InstanceMethodsInterceptPoint[] {
|
||||
new InstanceMethodsInterceptPoint() {
|
||||
@Override
|
||||
public ElementMatcher<MethodDescription> getMethodsMatcher() {
|
||||
return named(ENHANCE_METHOD);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMethodsInterceptor() {
|
||||
return INTERCEPT_CLASS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOverrideArgs() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ClassMatch enhanceClass() {
|
||||
return NameMatch.byName(ENHANCE_CLASS);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
package org.apache.skywalking.apm.plugin.vertx3.define;
|
||||
|
||||
import net.bytebuddy.description.method.MethodDescription;
|
||||
import net.bytebuddy.matcher.ElementMatcher;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.match.NameMatch;
|
||||
|
||||
import static net.bytebuddy.matcher.ElementMatchers.any;
|
||||
|
||||
/**
|
||||
* {@link HttpServerRequestImplConstructorInstrumentation} enhance the constructor in
|
||||
* <code>io.vertx.core.http.impl.HttpServerRequestImpl</code> class by
|
||||
* <code>HttpServerRequestImplConstructorInterceptor</code> class.
|
||||
*/
|
||||
public class HttpServerRequestImplConstructorInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
|
||||
|
||||
private static final String ENHANCE_CLASS = "io.vertx.core.http.impl.HttpServerRequestImpl";
|
||||
private static final String INTERCEPT_CLASS = "org.apache.skywalking.apm.plugin.vertx3.HttpServerRequestImplConstructorInterceptor";
|
||||
|
||||
@Override
|
||||
public ConstructorInterceptPoint[] getConstructorsInterceptPoints() {
|
||||
return new ConstructorInterceptPoint[] {
|
||||
new ConstructorInterceptPoint() {
|
||||
@Override
|
||||
public ElementMatcher<MethodDescription> getConstructorMatcher() {
|
||||
return any();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getConstructorInterceptor() {
|
||||
return INTERCEPT_CLASS;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints() {
|
||||
return new InstanceMethodsInterceptPoint[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ClassMatch enhanceClass() {
|
||||
return NameMatch.byName(ENHANCE_CLASS);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
package org.apache.skywalking.apm.plugin.vertx3.define;
|
||||
|
||||
import net.bytebuddy.description.method.MethodDescription;
|
||||
import net.bytebuddy.matcher.ElementMatcher;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.match.NameMatch;
|
||||
|
||||
import static net.bytebuddy.matcher.ElementMatchers.any;
|
||||
|
||||
/**
|
||||
* {@link HttpServerRequestWrapperConstructorInstrumentation} enhance the constructor in
|
||||
* <code>io.vertx.ext.web.impl.HttpServerRequestWrapper</code> class by
|
||||
* <code>HttpServerRequestWrapperConstructorInterceptor</code> class.
|
||||
*/
|
||||
public class HttpServerRequestWrapperConstructorInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
|
||||
|
||||
private static final String ENHANCE_CLASS = "io.vertx.ext.web.impl.HttpServerRequestWrapper";
|
||||
private static final String INTERCEPT_CLASS = "org.apache.skywalking.apm.plugin.vertx3.HttpServerRequestWrapperConstructorInterceptor";
|
||||
|
||||
@Override
|
||||
public ConstructorInterceptPoint[] getConstructorsInterceptPoints() {
|
||||
return new ConstructorInterceptPoint[] {
|
||||
new ConstructorInterceptPoint() {
|
||||
@Override
|
||||
public ElementMatcher<MethodDescription> getConstructorMatcher() {
|
||||
return any();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getConstructorInterceptor() {
|
||||
return INTERCEPT_CLASS;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints() {
|
||||
return new InstanceMethodsInterceptPoint[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ClassMatch enhanceClass() {
|
||||
return NameMatch.byName(ENHANCE_CLASS);
|
||||
}
|
||||
}
|
||||
|
|
@ -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 {
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
package org.apache.skywalking.apm.plugin.vertx3.define;
|
||||
|
||||
import net.bytebuddy.description.method.MethodDescription;
|
||||
import net.bytebuddy.matcher.ElementMatcher;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.match.NameMatch;
|
||||
|
||||
import static net.bytebuddy.matcher.ElementMatchers.any;
|
||||
|
||||
/**
|
||||
* {@link RouterContextImplBaseConstructorInstrumentation} enhance the constructor in
|
||||
* <code>io.vertx.ext.web.impl.RoutingContextImplBase</code> class by
|
||||
* <code>RoutingContextImplBaseConstructorInterceptor</code> class.
|
||||
*/
|
||||
public class RouterContextImplBaseConstructorInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
|
||||
|
||||
private static final String ENHANCE_CLASS = "io.vertx.ext.web.impl.RoutingContextImplBase";
|
||||
private static final String INTERCEPT_CLASS = "org.apache.skywalking.apm.plugin.vertx3.RoutingContextImplBaseConstructorInterceptor";
|
||||
|
||||
@Override
|
||||
public ConstructorInterceptPoint[] getConstructorsInterceptPoints() {
|
||||
return new ConstructorInterceptPoint[] {
|
||||
new ConstructorInterceptPoint() {
|
||||
@Override
|
||||
public ElementMatcher<MethodDescription> getConstructorMatcher() {
|
||||
return any();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getConstructorInterceptor() {
|
||||
return INTERCEPT_CLASS;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints() {
|
||||
return new InstanceMethodsInterceptPoint[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ClassMatch enhanceClass() {
|
||||
return NameMatch.byName(ENHANCE_CLASS);
|
||||
}
|
||||
}
|
||||
|
|
@ -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() {
|
||||
|
|
@ -0,0 +1,88 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
package org.apache.skywalking.apm.plugin.vertx3.define;
|
||||
|
||||
import net.bytebuddy.description.method.MethodDescription;
|
||||
import net.bytebuddy.matcher.ElementMatcher;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.match.NameMatch;
|
||||
|
||||
import static net.bytebuddy.matcher.ElementMatchers.any;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
|
||||
/**
|
||||
* {@link RouterImplInstrumentation} enhance the <code>handleContext</code> method in
|
||||
* <code>io.vertx.ext.web.impl.RouterImpl</code> class by
|
||||
* <code>RouteStateInterceptor</code> class.
|
||||
*
|
||||
* Ver. 3.0.0 - 3.8.2
|
||||
*/
|
||||
public class RouterImplInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
|
||||
|
||||
private static final String ENHANCE_CLASS = "io.vertx.ext.web.impl.RouteImpl";
|
||||
private static final String ENHANCE_METHOD = "handleContext";
|
||||
private static final String INTERCEPT_CLASS = "org.apache.skywalking.apm.plugin.vertx3.RouteStateInterceptor";
|
||||
|
||||
@Override
|
||||
public ConstructorInterceptPoint[] getConstructorsInterceptPoints() {
|
||||
return new ConstructorInterceptPoint[] {
|
||||
new ConstructorInterceptPoint() {
|
||||
@Override
|
||||
public ElementMatcher<MethodDescription> getConstructorMatcher() {
|
||||
return any();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getConstructorInterceptor() {
|
||||
return INTERCEPT_CLASS;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints() {
|
||||
return new InstanceMethodsInterceptPoint[] {
|
||||
new InstanceMethodsInterceptPoint() {
|
||||
@Override
|
||||
public ElementMatcher<MethodDescription> getMethodsMatcher() {
|
||||
return named(ENHANCE_METHOD);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMethodsInterceptor() {
|
||||
return INTERCEPT_CLASS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOverrideArgs() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ClassMatch enhanceClass() {
|
||||
return NameMatch.byName(ENHANCE_CLASS);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
package org.apache.skywalking.apm.plugin.vertx3.define;
|
||||
|
||||
import net.bytebuddy.description.method.MethodDescription;
|
||||
import net.bytebuddy.matcher.ElementMatcher;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.match.NameMatch;
|
||||
|
||||
import static net.bytebuddy.matcher.ElementMatchers.any;
|
||||
|
||||
/**
|
||||
* {@link RoutingContextWrapperConstructorInstrumentation} enhance the constructor in
|
||||
* <code>io.vertx.ext.web.impl.RoutingContextWrapper</code> class by
|
||||
* <code>RoutingContextWrapperInterceptor</code> class.
|
||||
*
|
||||
* Ver. 3.1.0+
|
||||
*/
|
||||
public class RoutingContextWrapperConstructorInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
|
||||
|
||||
private static final String ENHANCE_CLASS = "io.vertx.ext.web.impl.RoutingContextWrapper";
|
||||
private static final String INTERCEPT_CLASS = "org.apache.skywalking.apm.plugin.vertx3.RoutingContextWrapperConstructorInterceptor";
|
||||
|
||||
@Override
|
||||
public ConstructorInterceptPoint[] getConstructorsInterceptPoints() {
|
||||
return new ConstructorInterceptPoint[] {
|
||||
new ConstructorInterceptPoint() {
|
||||
@Override
|
||||
public ElementMatcher<MethodDescription> getConstructorMatcher() {
|
||||
return any();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getConstructorInterceptor() {
|
||||
return INTERCEPT_CLASS;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints() {
|
||||
return new InstanceMethodsInterceptPoint[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ClassMatch enhanceClass() {
|
||||
return NameMatch.byName(ENHANCE_CLASS);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
package org.apache.skywalking.apm.plugin.vertx3.define;
|
||||
|
||||
import net.bytebuddy.description.method.MethodDescription;
|
||||
import net.bytebuddy.matcher.ElementMatcher;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.match.MultiClassNameMatch;
|
||||
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
|
||||
/**
|
||||
* {@link ServerConnectionHandleMessageInstrumentation} enhance the <code>handleMessage</code> method in
|
||||
* <code>io.vertx.core.http.impl.ServerConnection</code> and <code>io.vertx.core.http.impl.Http1xServerConnection</code>
|
||||
* classes by <code>ServerConnectionHandleMessageInterceptor</code> class.
|
||||
*/
|
||||
public class ServerConnectionHandleMessageInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
|
||||
|
||||
private static final String SERVER_CONNECTION_ENHANCE_CLASS = "io.vertx.core.http.impl.ServerConnection";
|
||||
private static final String HTTP_SERVER_CONNECTION_ENHANCE_CLASS = "io.vertx.core.http.impl.Http1xServerConnection";
|
||||
private static final String ENHANCE_METHOD = "handleMessage";
|
||||
private static final String INTERCEPT_CLASS = "org.apache.skywalking.apm.plugin.vertx3.ServerConnectionHandleMessageInterceptor";
|
||||
|
||||
@Override
|
||||
public ConstructorInterceptPoint[] getConstructorsInterceptPoints() {
|
||||
return new ConstructorInterceptPoint[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints() {
|
||||
return new InstanceMethodsInterceptPoint[] {
|
||||
new InstanceMethodsInterceptPoint() {
|
||||
@Override
|
||||
public ElementMatcher<MethodDescription> getMethodsMatcher() {
|
||||
return named(ENHANCE_METHOD);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMethodsInterceptor() {
|
||||
return INTERCEPT_CLASS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOverrideArgs() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ClassMatch enhanceClass() {
|
||||
return MultiClassNameMatch.byMultiClassMatch(
|
||||
HTTP_SERVER_CONNECTION_ENHANCE_CLASS, //ver. 3.5.1+
|
||||
SERVER_CONNECTION_ENHANCE_CLASS //ver. 3.0.0 - 3.5.0
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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,31 +43,8 @@ segmentItems:
|
|||
spans:
|
||||
- operationName: /vertx-web-3_54minus-scenario/case/healthCheck
|
||||
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: HEAD}
|
||||
- {key: url, value: /vertx-web-3_54minus-scenario/case/healthCheck}
|
||||
- {key: status_code, value: '200'}
|
||||
refs:
|
||||
- {parentEndpoint: /vertx-web-3_54minus-scenario/case/web-case, 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
|
||||
operationId: 0
|
||||
parentSpanId: 0
|
||||
spanId: 1
|
||||
parentSpanId: 1
|
||||
spanId: 2
|
||||
spanLayer: Http
|
||||
startTime: nq 0
|
||||
endTime: nq 0
|
||||
|
|
@ -76,6 +57,10 @@ segmentItems:
|
|||
- {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
|
||||
|
|
@ -94,6 +79,95 @@ segmentItems:
|
|||
- {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
|
||||
startTime: nq 0
|
||||
endTime: nq 0
|
||||
componentId: 59
|
||||
isError: false
|
||||
spanType: Entry
|
||||
peer: ''
|
||||
skipAnalysis: false
|
||||
tags:
|
||||
- {key: http.method, value: HEAD}
|
||||
- {key: url, value: /vertx-web-3_54minus-scenario/case/healthCheck}
|
||||
- {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: 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
|
||||
spanLayer: Http
|
||||
startTime: nq 0
|
||||
endTime: nq 0
|
||||
componentId: 59
|
||||
isError: false
|
||||
spanType: Exit
|
||||
peer: localhost:8080
|
||||
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'}
|
||||
- operationName: '#/vertx-web-3_54minus-scenario/case/healthCheck'
|
||||
operationId: 0
|
||||
parentSpanId: -1
|
||||
|
|
@ -108,6 +182,25 @@ segmentItems:
|
|||
skipAnalysis: false
|
||||
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/web-case/withBodyHandler'
|
||||
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/healthCheck', networkAddress: '',
|
||||
refType: CrossThread, parentSpanId: 1, parentTraceSegmentId: not null,
|
||||
parentServiceInstance: not null, parentService: vertx-web-3.54minus-scenario,
|
||||
traceId: not null}
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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,31 +43,8 @@ segmentItems:
|
|||
spans:
|
||||
- operationName: /vertx-web-3_6plus-scenario/case/healthCheck
|
||||
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: HEAD}
|
||||
- {key: url, value: /vertx-web-3_6plus-scenario/case/healthCheck}
|
||||
- {key: status_code, value: '200'}
|
||||
refs:
|
||||
- {parentEndpoint: /vertx-web-3_6plus-scenario/case/web-case, 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
|
||||
operationId: 0
|
||||
parentSpanId: 0
|
||||
spanId: 1
|
||||
parentSpanId: 1
|
||||
spanId: 2
|
||||
spanLayer: Http
|
||||
startTime: nq 0
|
||||
endTime: nq 0
|
||||
|
|
@ -76,6 +57,10 @@ segmentItems:
|
|||
- {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
|
||||
|
|
@ -94,6 +79,95 @@ segmentItems:
|
|||
- {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
|
||||
startTime: nq 0
|
||||
endTime: nq 0
|
||||
componentId: 59
|
||||
isError: false
|
||||
spanType: Entry
|
||||
peer: ''
|
||||
skipAnalysis: false
|
||||
tags:
|
||||
- {key: http.method, value: HEAD}
|
||||
- {key: url, value: /vertx-web-3_6plus-scenario/case/healthCheck}
|
||||
- {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: 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
|
||||
spanLayer: Http
|
||||
startTime: nq 0
|
||||
endTime: nq 0
|
||||
componentId: 59
|
||||
isError: false
|
||||
spanType: Exit
|
||||
peer: localhost:8080
|
||||
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'}
|
||||
- operationName: '#/vertx-web-3_6plus-scenario/case/healthCheck'
|
||||
operationId: 0
|
||||
parentSpanId: -1
|
||||
|
|
@ -108,6 +182,25 @@ segmentItems:
|
|||
skipAnalysis: false
|
||||
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/web-case/withBodyHandler'
|
||||
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/healthCheck', networkAddress: '',
|
||||
refType: CrossThread, parentSpanId: 1, parentTraceSegmentId: not null,
|
||||
parentServiceInstance: not null, parentService: vertx-web-3.6plus-scenario,
|
||||
traceId: not null}
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue