Modify catalog
This commit is contained in:
parent
9ff209373e
commit
94dcf96e1f
|
|
@ -53,7 +53,7 @@
|
|||
<module>elastic-job-2.x-plugin</module>
|
||||
<module>mongodb-2.x-plugin</module>
|
||||
<module>httpasyncclient-4.x-plugin</module>
|
||||
<module>servicecomb-java-chassis-plugin</module>
|
||||
<module>servicecomb-plugin</module>
|
||||
</modules>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,26 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>apm-sdk-plugin</artifactId>
|
||||
<groupId>org.apache.skywalking</groupId>
|
||||
<version>5.0.0-alpha</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>servicecomb-plugin</artifactId>
|
||||
|
||||
<modules>
|
||||
<module>servicecomb-java-chassis-0.x-plugin</module>
|
||||
</modules>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>apm-sdk-plugin</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<sdk.plugin.related.dir>/..</sdk.plugin.related.dir>
|
||||
</properties>
|
||||
</project>
|
||||
|
|
@ -3,16 +3,16 @@
|
|||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>apm-sdk-plugin</artifactId>
|
||||
<artifactId>servicecomb-plugin</artifactId>
|
||||
<groupId>org.apache.skywalking</groupId>
|
||||
<version>5.0.0-alpha</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>apm-servicecomb-java-chassis-plugin</artifactId>
|
||||
<artifactId>apm-servicecomb-java-chassis-0.x-plugin</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>servicecomb-java-chassis-plugin</name>
|
||||
<name>servicecomb-java-chassis-0.x-plugin</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
|
||||
|
||||
|
|
@ -18,12 +18,12 @@
|
|||
|
||||
package org.apache.skywalking.apm.plugin.servicecomb;
|
||||
|
||||
import io.servicecomb.core.Invocation;
|
||||
import io.servicecomb.swagger.invocation.InvocationType;
|
||||
import io.servicecomb.swagger.invocation.SwaggerInvocation;
|
||||
import io.servicecomb.swagger.invocation.context.InvocationContext;
|
||||
import java.lang.reflect.Method;
|
||||
import javax.ws.rs.core.Response.StatusType;
|
||||
import io.servicecomb.core.Invocation;
|
||||
import io.servicecomb.swagger.invocation.InvocationType;
|
||||
import io.servicecomb.swagger.invocation.SwaggerInvocation;
|
||||
import io.servicecomb.swagger.invocation.context.InvocationContext;
|
||||
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;
|
||||
|
|
@ -36,7 +36,7 @@ import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInt
|
|||
import org.apache.skywalking.apm.network.trace.component.ComponentsDefine;
|
||||
|
||||
/**
|
||||
* {@link InvocationInterceptor} define how to enhance class {@link Invocation#getHandlerChain()}.
|
||||
* {@link InvocationInterceptor} define how to enhance class {@link Invocation#getHandlerContext()}.
|
||||
*
|
||||
* @author lytscu
|
||||
*/
|
||||
|
|
@ -23,6 +23,7 @@ import io.servicecomb.swagger.invocation.InvocationType;
|
|||
import io.servicecomb.swagger.invocation.SwaggerInvocation;
|
||||
import io.servicecomb.swagger.invocation.context.InvocationContext;
|
||||
import java.lang.reflect.Method;
|
||||
import java.net.URI;
|
||||
import javax.ws.rs.core.Response.StatusType;
|
||||
import org.apache.skywalking.apm.agent.core.context.CarrierItem;
|
||||
import org.apache.skywalking.apm.agent.core.context.ContextCarrier;
|
||||
|
|
@ -60,8 +61,10 @@ public class NextInterceptor implements InstanceMethodsAroundInterceptor {
|
|||
if (isConsumer) {
|
||||
Integer count = (Integer)DEEP.get();
|
||||
try {
|
||||
//When count = 2, you can get the peer
|
||||
if (count == 2) {
|
||||
String peer = invocation.getEndpoint().getAddress().toString();
|
||||
URI uri = new URI(invocation.getEndpoint().toString());
|
||||
String peer = uri.getHost() + ":" + uri.getPort();
|
||||
final ContextCarrier contextCarrier = new ContextCarrier();
|
||||
span = ContextManager.createExitSpan(invocation.getOperationName(), contextCarrier, peer);
|
||||
CarrierItem next = contextCarrier.items();
|
||||
|
|
@ -18,9 +18,9 @@
|
|||
|
||||
package org.apache.skywalking.apm.plugin.servicecomb.define;
|
||||
|
||||
import io.servicecomb.core.Invocation;
|
||||
import net.bytebuddy.description.method.MethodDescription;
|
||||
import net.bytebuddy.matcher.ElementMatcher;
|
||||
import io.servicecomb.core.Invocation;
|
||||
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;
|
||||
|
|
@ -31,8 +31,8 @@ import org.apache.skywalking.apm.plugin.servicecomb.InvocationInterceptor;
|
|||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
|
||||
/**
|
||||
* {@link InvocationInstrumentation} presents that skywalking intercept {@link io.servicecomb.core.Invocation#next(AsyncResponse)}by
|
||||
* using {@link InvocationInterceptor}, and {@link Invocation#getHandlerChain() by using {@link NextInterceptor},
|
||||
* {@link InvocationInstrumentation} presents that skywalking intercept {@link io.servicecomb.core.Invocation#getHandlerContext}by
|
||||
* using {@link InvocationInterceptor}, and {@link Invocation#next by using {@link NextInterceptor},
|
||||
*
|
||||
* @author lytscu
|
||||
*/
|
||||
|
|
@ -60,7 +60,7 @@ public class InvocationInstrumentation extends ClassInstanceMethodsEnhancePlugin
|
|||
new InstanceMethodsInterceptPoint() {
|
||||
@Override
|
||||
public ElementMatcher<MethodDescription> getMethodsMatcher() {
|
||||
return named("getHandlerChain");
|
||||
return named("getHandlerContext");
|
||||
}
|
||||
|
||||
@Override
|
||||
Loading…
Reference in New Issue