From 64c658926b2648174806c7155b6fa77f0853a334 Mon Sep 17 00:00:00 2001 From: ascrutae Date: Wed, 27 Jul 2016 18:31:20 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"=E6=8F=90=E4=BA=A4=E6=9C=AA=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E4=BB=A3=E7=A0=81"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f08ca13a15b68e88c88dc0304970936c5abfaca4. --- skywalking-collector/skywalking-agent/pom.xml | 6 + .../skywalking/agent/SkywalkingAgent.java | 18 +- .../agent/transformer/PluginsTransformer.java | 56 +--- skywalking-collector/skywalking-api/pom.xml | 6 + .../ai/cloud/skywalking/plugin/IPlugin.java | 4 +- .../skywalking/plugin/PluginBootstrap.java | 35 ++- .../skywalking/plugin/TracingBootstrap.java | 2 +- .../skywalking/plugin/boot/BootException.java | 2 +- .../plugin/boot/BootPluginDefine.java | 8 +- .../exception/EnhanceClassEmptyException.java | 13 +- .../EnhanceClassNotFoundException.java | 9 +- .../exception/WitnessClassesCannotFound.java | 5 +- .../AbstractClassEnhancePluginDefine.java | 88 +++--- .../plugin/interceptor/EnhanceException.java | 2 +- .../plugin/interceptor/MethodMatcher.java | 68 +++-- .../enhance/ClassConstructorInterceptor.java | 42 +-- .../enhance/ClassEnhancePluginDefine.java | 257 +++++++++++------- .../ClassInstanceMethodsInterceptor.java | 28 +- .../ClassStaticMethodsInterceptor.java | 18 +- .../enhance/OriginCallCodeGenerator.java | 50 +--- .../matcher/AnyMethodsMatcher.java | 14 +- .../ExclusiveObjectDefaultMethodsMatcher.java | 46 ++-- .../matcher/MethodsExclusiveMatcher.java | 34 ++- .../matcher/PrivateMethodMatcher.java | 10 +- .../matcher/SimpleMethodMatcher.java | 46 +--- .../protocol/util/ContextGenerator.java | 8 +- .../instance_method_call_origin_code.conf | 11 - .../static_method_call_origin_code.conf | 7 +- .../assertspandata/SDKGeneratedDataTest.java | 2 +- .../cloud/matcher/ExclusionMatcherTest.java | 4 +- .../ai/cloud/matcher/TestMatcherDefine.java | 2 +- .../test/ai/cloud/plugin/PluginMainTest.java | 4 +- .../cloud/plugin/TestAroundInterceptor.java | 6 +- .../cloud/plugin/TestInterceptorDefine.java | 2 +- .../ai/cloud/serialize/SerializeTest.java | 2 +- .../test/dubbo/consumer/DubboConsumer.java | 4 +- .../plugin/test/dubbo/impl/DubboStart.java | 2 +- .../consumer/DubboxRestConsumer.java | 4 +- .../dubbox283/consumer/DubboxRestStart.java | 2 +- .../consumer/DubboxRestConsumer.java | 4 +- .../dubbox284/consumer/DubboxRestStart.java | 2 +- .../plugin/jdbc/JDBCPluginDefine.java | 4 +- .../plugin/drivermanger/TestMyDriver.java | 2 +- .../skywalking/plugin/h2/H2JDBCTest.java | 8 +- .../plugin/mysql/MysqlJDBCTest.java | 10 +- .../plugin/oracle/OracleJDBCTest.java | 2 +- .../spring-plugin/pom.xml | 2 +- .../target/maven-archiver/pom.properties | 5 - .../compile/default-compile/createdFiles.lst | 3 - .../compile/default-compile/inputFiles.lst | 3 - .../skywalking-sdk-plugin/web-plugin/pom.xml | 2 +- 51 files changed, 473 insertions(+), 501 deletions(-) delete mode 100644 skywalking-collector/skywalking-sdk-plugin/tomcat-7.x-8.x-plugin/target/maven-archiver/pom.properties delete mode 100644 skywalking-collector/skywalking-sdk-plugin/tomcat-7.x-8.x-plugin/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst delete mode 100644 skywalking-collector/skywalking-sdk-plugin/tomcat-7.x-8.x-plugin/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst diff --git a/skywalking-collector/skywalking-agent/pom.xml b/skywalking-collector/skywalking-agent/pom.xml index f975b5554..d5479b675 100644 --- a/skywalking-collector/skywalking-agent/pom.xml +++ b/skywalking-collector/skywalking-agent/pom.xml @@ -17,6 +17,8 @@ UTF-8 com.ai.cloud.skywalking.agent.SkywalkingAgent + net.bytebuddy + com.ai.cloud.skywalking.api.dependencies.net.bytebuddy io.netty com.ai.cloud.skywalking.api.dependencies.io.netty com.google.protobuf @@ -83,6 +85,10 @@ + + ${shade.net.bytebuddy.source} + ${shade.net.bytebuddy.target} + ${shade.io.netty.source} ${shade.io.netty.target} diff --git a/skywalking-collector/skywalking-agent/src/main/java/com/ai/cloud/skywalking/agent/SkywalkingAgent.java b/skywalking-collector/skywalking-agent/src/main/java/com/ai/cloud/skywalking/agent/SkywalkingAgent.java index be1e39bab..7aab8ae7b 100644 --- a/skywalking-collector/skywalking-agent/src/main/java/com/ai/cloud/skywalking/agent/SkywalkingAgent.java +++ b/skywalking-collector/skywalking-agent/src/main/java/com/ai/cloud/skywalking/agent/SkywalkingAgent.java @@ -1,35 +1,23 @@ package com.ai.cloud.skywalking.agent; -import com.ai.cloud.skywalking.agent.transformer.PluginsTransformer; -import com.ai.cloud.skywalking.conf.AuthDesc; import com.ai.cloud.skywalking.conf.Config; import com.ai.cloud.skywalking.conf.ConfigInitializer; -import com.ai.cloud.skywalking.plugin.IPlugin; import com.ai.cloud.skywalking.plugin.PluginBootstrap; -import com.ai.cloud.skywalking.plugin.PluginCfg; -import com.ai.cloud.skywalking.plugin.interceptor.AbstractClassEnhancePluginDefine; -import com.ai.cloud.skywalking.plugin.interceptor.enhance.ClassEnhancePluginDefine; import com.ai.cloud.skywalking.transformer.ClassTransformer; import java.lang.instrument.Instrumentation; -import java.util.List; -import java.util.Map; public class SkywalkingAgent { public static void premain(String agentArgs, Instrumentation inst) { ConfigInitializer.initialize(); - PluginBootstrap bootstrap = new PluginBootstrap(); - Map pluginDefineMap = bootstrap.loadPlugins(); - - if (AuthDesc.isAuth()) { - inst.addTransformer(new PluginsTransformer(pluginDefineMap)); - } - if (Config.SkyWalking.ALL_METHOD_MONITOR) { String interceptorPackage = System.getProperty("interceptor.package", ""); inst.addTransformer(new ClassTransformer(interceptorPackage)); } + + PluginBootstrap bootstrap = new PluginBootstrap(); + bootstrap.start(); } } diff --git a/skywalking-collector/skywalking-agent/src/main/java/com/ai/cloud/skywalking/agent/transformer/PluginsTransformer.java b/skywalking-collector/skywalking-agent/src/main/java/com/ai/cloud/skywalking/agent/transformer/PluginsTransformer.java index 60ed15f29..4a1552a77 100644 --- a/skywalking-collector/skywalking-agent/src/main/java/com/ai/cloud/skywalking/agent/transformer/PluginsTransformer.java +++ b/skywalking-collector/skywalking-agent/src/main/java/com/ai/cloud/skywalking/agent/transformer/PluginsTransformer.java @@ -1,55 +1,7 @@ package com.ai.cloud.skywalking.agent.transformer; -import com.ai.cloud.skywalking.logging.LogManager; -import com.ai.cloud.skywalking.logging.Logger; -import com.ai.cloud.skywalking.plugin.interceptor.enhance.ClassEnhancePluginDefine; -import javassist.ClassPool; -import javassist.CtClass; - -import java.lang.instrument.ClassFileTransformer; -import java.lang.instrument.IllegalClassFormatException; -import java.security.ProtectionDomain; -import java.util.Map; - -public class PluginsTransformer implements ClassFileTransformer { - - private Logger logger = LogManager.getLogger(PluginsTransformer.class); - - private Map pluginDefineMap; - - - public PluginsTransformer(Map pluginDefineMap) { - this.pluginDefineMap = pluginDefineMap; - } - - @Override - public byte[] transform(ClassLoader loader, String className, Class classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws IllegalClassFormatException { - if (pluginDefineMap.isEmpty()) { - return classfileBuffer; - } - - if (className.startsWith("com/ai/cloud/skywalking")){ - return classfileBuffer; - } - - ClassEnhancePluginDefine pluginDefine = pluginDefineMap.get(className.replaceAll("/", ".")); - if (pluginDefine != null) { - ClassPool classPool = ClassPool.getDefault(); - try { - CtClass ctClass = classPool.get(className.replaceAll("/", ".")); - if (ctClass.isInterface()) { - return classfileBuffer; - } - - pluginDefine.enhance(ctClass); - - return ctClass.toBytecode(); - } catch (Exception e) { - logger.error("Failed to enhance class[" + className + "]", e); - return classfileBuffer; - } - } - - return classfileBuffer; - } +/** + * Created by xin on 16/7/24. + */ +public class PluginsTransformer { } diff --git a/skywalking-collector/skywalking-api/pom.xml b/skywalking-collector/skywalking-api/pom.xml index d27bf42ee..f5876477c 100644 --- a/skywalking-collector/skywalking-api/pom.xml +++ b/skywalking-collector/skywalking-api/pom.xml @@ -26,6 +26,12 @@ 1.0-Final + + net.bytebuddy + byte-buddy + 1.3.0 + + io.netty netty-all diff --git a/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/IPlugin.java b/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/IPlugin.java index 00956556a..ecfadcb2f 100644 --- a/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/IPlugin.java +++ b/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/IPlugin.java @@ -1,8 +1,6 @@ package com.ai.cloud.skywalking.plugin; -import com.ai.cloud.skywalking.plugin.exception.PluginException; - public interface IPlugin { - byte[] define() throws PluginException; + public void define() throws PluginException; } diff --git a/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/PluginBootstrap.java b/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/PluginBootstrap.java index 16c748ad7..94e82d381 100644 --- a/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/PluginBootstrap.java +++ b/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/PluginBootstrap.java @@ -3,57 +3,54 @@ package com.ai.cloud.skywalking.plugin; import com.ai.cloud.skywalking.conf.AuthDesc; import com.ai.cloud.skywalking.logging.LogManager; import com.ai.cloud.skywalking.logging.Logger; -import com.ai.cloud.skywalking.plugin.interceptor.enhance.ClassEnhancePluginDefine; -import javassist.ClassPool; +import net.bytebuddy.pool.TypePool; import java.net.URL; -import java.util.HashMap; import java.util.List; -import java.util.Map; public class PluginBootstrap { private static Logger logger = LogManager.getLogger(PluginBootstrap.class); - public static ClassPool CLASS_TYPE_POOL = null; + public static TypePool CLASS_TYPE_POOL = null; - public Map loadPlugins() { + public void start() { if (!AuthDesc.isAuth()) { - return null; + return; } - CLASS_TYPE_POOL = ClassPool.getDefault(); + CLASS_TYPE_POOL = TypePool.Default.ofClassPath(); PluginResourcesResolver resolver = new PluginResourcesResolver(); List resources = resolver.getResources(); if (resources == null || resources.size() == 0) { logger.info("no plugin files (skywalking-plugin.properties) found, continue to start application."); - return new HashMap(); + return; } for (URL pluginUrl : resources) { try { PluginCfg.CFG.load(pluginUrl.openStream()); } catch (Throwable t) { - logger.error("plugin [{}] init failure.", new Object[] {pluginUrl}, t); + logger.error("plugin [{}] init failure.", new Object[]{pluginUrl}, t); } } - List pluginClassList = PluginCfg.CFG.getPluginClassList(); + List pluginClassList = PluginCfg.CFG + .getPluginClassList(); - Map pluginDefineMap = new HashMap(); for (String pluginClassName : pluginClassList) { try { - logger.debug("prepare to enhance class by plugin {}.", pluginClassName); - IPlugin plugin = (IPlugin) Class.forName(pluginClassName).newInstance(); - if (plugin instanceof ClassEnhancePluginDefine) { - pluginDefineMap.put(pluginClassName, (ClassEnhancePluginDefine) plugin); - } + logger.debug("prepare to enhance class by plugin {}.", + pluginClassName); + IPlugin plugin = (IPlugin) Class.forName( + pluginClassName).newInstance(); + plugin.define(); } catch (Throwable t) { - logger.error("prepare to enhance class by plugin [{}] failure.", new Object[] {pluginClassName}, t); + logger.error("prepare to enhance class by plugin [{}] failure.", + new Object[]{pluginClassName}, t); } } - return pluginDefineMap; } } diff --git a/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/TracingBootstrap.java b/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/TracingBootstrap.java index d0f8e4b67..aa17bb438 100644 --- a/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/TracingBootstrap.java +++ b/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/TracingBootstrap.java @@ -29,7 +29,7 @@ public class TracingBootstrap { try { PluginBootstrap bootstrap = new PluginBootstrap(); - bootstrap.loadPlugins(); + bootstrap.start(); } catch (Throwable t) { logger.error("PluginBootstrap start failure.", t); } diff --git a/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/boot/BootException.java b/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/boot/BootException.java index 4bd7c5d4e..95b17f9f9 100644 --- a/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/boot/BootException.java +++ b/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/boot/BootException.java @@ -1,6 +1,6 @@ package com.ai.cloud.skywalking.plugin.boot; -import com.ai.cloud.skywalking.plugin.exception.PluginException; +import com.ai.cloud.skywalking.plugin.PluginException; public class BootException extends PluginException { private static final long serialVersionUID = 8618884011525098003L; diff --git a/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/boot/BootPluginDefine.java b/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/boot/BootPluginDefine.java index 480f38a62..b0a61a3fe 100644 --- a/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/boot/BootPluginDefine.java +++ b/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/boot/BootPluginDefine.java @@ -1,15 +1,15 @@ package com.ai.cloud.skywalking.plugin.boot; import com.ai.cloud.skywalking.plugin.IPlugin; -import com.ai.cloud.skywalking.plugin.exception.PluginException; +import com.ai.cloud.skywalking.plugin.PluginException; public abstract class BootPluginDefine implements IPlugin { @Override - public byte[] define() throws PluginException { - return this.boot(); + public void define() throws PluginException { + this.boot(); } - protected abstract byte[] boot() throws BootException; + protected abstract void boot() throws BootException; } diff --git a/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/exception/EnhanceClassEmptyException.java b/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/exception/EnhanceClassEmptyException.java index 46de8b78e..eb25bd0de 100644 --- a/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/exception/EnhanceClassEmptyException.java +++ b/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/exception/EnhanceClassEmptyException.java @@ -1,12 +1,7 @@ package com.ai.cloud.skywalking.plugin.exception; -public class EnhanceClassEmptyException extends PluginException{ - - public EnhanceClassEmptyException(String message) { - super(message); - } - - public EnhanceClassEmptyException(String message, Throwable cause) { - super(message, cause); - } +/** + * Created by xin on 16/7/25. + */ +public class EnhanceClassEmptyException { } diff --git a/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/exception/EnhanceClassNotFoundException.java b/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/exception/EnhanceClassNotFoundException.java index c13bfc90e..ef7ac0a23 100644 --- a/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/exception/EnhanceClassNotFoundException.java +++ b/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/exception/EnhanceClassNotFoundException.java @@ -1,8 +1,7 @@ package com.ai.cloud.skywalking.plugin.exception; -public class EnhanceClassNotFoundException extends PluginException{ - - public EnhanceClassNotFoundException(String message) { - super(message); - } +/** + * Created by xin on 16/7/25. + */ +public class EnhanceClassNotFoundException { } diff --git a/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/exception/WitnessClassesCannotFound.java b/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/exception/WitnessClassesCannotFound.java index ee4cfad8b..bb12bbba3 100644 --- a/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/exception/WitnessClassesCannotFound.java +++ b/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/exception/WitnessClassesCannotFound.java @@ -3,8 +3,5 @@ package com.ai.cloud.skywalking.plugin.exception; /** * Created by xin on 16/7/25. */ -public class WitnessClassesCannotFound extends PluginException { - public WitnessClassesCannotFound(String message) { - super(message); - } +public class WitnessClassesCannotFound { } diff --git a/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/AbstractClassEnhancePluginDefine.java b/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/AbstractClassEnhancePluginDefine.java index 7c19c8edd..4cff5b2e1 100644 --- a/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/AbstractClassEnhancePluginDefine.java +++ b/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/AbstractClassEnhancePluginDefine.java @@ -3,13 +3,13 @@ package com.ai.cloud.skywalking.plugin.interceptor; import com.ai.cloud.skywalking.logging.LogManager; import com.ai.cloud.skywalking.logging.Logger; import com.ai.cloud.skywalking.plugin.IPlugin; -import com.ai.cloud.skywalking.plugin.exception.EnhanceClassEmptyException; -import com.ai.cloud.skywalking.plugin.exception.EnhanceClassNotFoundException; -import com.ai.cloud.skywalking.plugin.exception.PluginException; -import com.ai.cloud.skywalking.plugin.exception.WitnessClassesCannotFound; +import com.ai.cloud.skywalking.plugin.PluginException; import com.ai.cloud.skywalking.protocol.util.StringUtil; -import javassist.ClassPool; -import javassist.CtClass; +import net.bytebuddy.ByteBuddy; +import net.bytebuddy.dynamic.ClassFileLocator; +import net.bytebuddy.dynamic.DynamicType; +import net.bytebuddy.dynamic.loading.ClassLoadingStrategy; +import net.bytebuddy.pool.TypePool.Resolution; import static com.ai.cloud.skywalking.plugin.PluginBootstrap.CLASS_TYPE_POOL; @@ -17,58 +17,64 @@ public abstract class AbstractClassEnhancePluginDefine implements IPlugin { private static Logger logger = LogManager.getLogger(AbstractClassEnhancePluginDefine.class); @Override - public byte[] define() throws PluginException { + public void define() throws PluginException { String interceptorDefineClassName = this.getClass().getName(); String enhanceOriginClassName = enhanceClassName(); if (StringUtil.isEmpty(enhanceOriginClassName)) { - logger.warn("classname of being intercepted is not defined by {}.", interceptorDefineClassName); - throw new EnhanceClassEmptyException("class name of being is not deined by " + interceptorDefineClassName); + logger.warn("classname of being intercepted is not defined by {}.", + interceptorDefineClassName); + return; } - logger.debug("prepare to enhance class {} by {}.", enhanceOriginClassName, interceptorDefineClassName); + logger.debug("prepare to enhance class {} by {}.", + enhanceOriginClassName, interceptorDefineClassName); - CtClass ctClass = findEnhanceClasses(interceptorDefineClassName, enhanceOriginClassName); - - if (ctClass == null) { - logger.warn("class {} can't be resolved, enhance by {} failue.", enhanceOriginClassName, interceptorDefineClassName); - throw new EnhanceClassNotFoundException("class " + enhanceOriginClassName + " can't be resolved, enhance by " + interceptorDefineClassName + " failue."); + Resolution resolution = CLASS_TYPE_POOL.describe(enhanceOriginClassName); + if (!resolution.isResolved()) { + logger.warn("class {} can't be resolved, enhance by {} failue.", + enhanceOriginClassName, interceptorDefineClassName); + return; } /** * find witness classes for enhance class */ String[] witnessClasses = witnessClasses(); - if (witnessClasses != null) { - for (String witnessClassName : witnessClasses) { - try { - CtClass witnessClass = CLASS_TYPE_POOL.get(witnessClassName); - if (witnessClass != null) { - logger.warn("enhance class {} by plugin {} is not working. Because witness class {} is not existed.", enhanceOriginClassName, interceptorDefineClassName, - witnessClass); - throw new WitnessClassesCannotFound( - "enhance class " + enhanceOriginClassName + " by plugin " + interceptorDefineClassName + " is not working. Because witness class " + witnessClass - + " is not existed."); - } - } catch (Exception e) { - + if(witnessClasses != null) { + for (String witnessClass : witnessClasses) { + Resolution witnessClassResolution = CLASS_TYPE_POOL.describe(witnessClass); + if (!witnessClassResolution.isResolved()) { + logger.warn("enhance class {} by plugin {} is not working. Because witness class {} is not existed.", enhanceOriginClassName, interceptorDefineClassName, witnessClass); + return; } } } - return enhance(ctClass); + /** + * find origin class source code for interceptor + */ + DynamicType.Builder newClassBuilder = new ByteBuddy() + .rebase(resolution.resolve(), + ClassFileLocator.ForClassLoader.ofClassPath()); + + newClassBuilder = this.enhance(enhanceOriginClassName, newClassBuilder); + + /** + * naming class as origin class name, make and load class to + * classloader. + */ + newClassBuilder + .name(enhanceOriginClassName) + .make() + .load(ClassLoader.getSystemClassLoader(), + ClassLoadingStrategy.Default.INJECTION).getLoaded(); + + logger.debug("enhance class {} by {} completely.", + enhanceOriginClassName, interceptorDefineClassName); } - private CtClass findEnhanceClasses(String interceptorDefineClassName, String enhanceOriginClassName) throws EnhanceClassNotFoundException { - try { - ClassPool classPool = ClassPool.getDefault(); - return classPool.get(enhanceOriginClassName); - } catch (Exception e) { - throw new EnhanceClassNotFoundException("class " + enhanceOriginClassName + " can't be resolved, enhance by " + interceptorDefineClassName + " failue."); - } - } - - protected abstract byte[] enhance(CtClass ctClass) throws PluginException; + protected abstract DynamicType.Builder enhance(String enhanceOriginClassName, DynamicType.Builder newClassBuilder) throws PluginException; /** * 返回要被增强的类,应当返回类全名 @@ -83,7 +89,7 @@ public abstract class AbstractClassEnhancePluginDefine implements IPlugin { * * @return */ - protected String[] witnessClasses() { - return new String[] {}; + protected String[] witnessClasses(){ + return new String[]{}; } } diff --git a/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/EnhanceException.java b/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/EnhanceException.java index 0181cb01d..1cdd22061 100644 --- a/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/EnhanceException.java +++ b/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/EnhanceException.java @@ -1,6 +1,6 @@ package com.ai.cloud.skywalking.plugin.interceptor; -import com.ai.cloud.skywalking.plugin.exception.PluginException; +import com.ai.cloud.skywalking.plugin.PluginException; public class EnhanceException extends PluginException { private static final long serialVersionUID = -2234782755784217255L; diff --git a/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/MethodMatcher.java b/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/MethodMatcher.java index 33df29d21..2375b270c 100644 --- a/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/MethodMatcher.java +++ b/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/MethodMatcher.java @@ -1,6 +1,9 @@ package com.ai.cloud.skywalking.plugin.interceptor; -import javassist.CtMethod; +import net.bytebuddy.description.method.MethodDescription; +import net.bytebuddy.matcher.ElementMatcher; + +import static net.bytebuddy.matcher.ElementMatchers.*; public abstract class MethodMatcher { @@ -42,29 +45,48 @@ public abstract class MethodMatcher { this.modifier = modifier; } + public abstract ElementMatcher.Junction buildMatcher(); + protected String getMethodMatchDescribe() { return methodMatchDescribe; } - - public abstract boolean match(CtMethod ctMethod); - - public enum Modifier { - Public(0x00000001), - Default(0x00000000), - Private(0x00000002), - Protected(0x00000004); - - private int value; - - - Modifier(int value) { - this.value = value; + protected ElementMatcher.Junction mergeArgumentsIfNecessary(ElementMatcher.Junction matcher) { + if (argTypeArray != null) { + matcher = matcher.and(takesArguments(argTypeArray)); } + if (argNum > -1) { + matcher = matcher.and(takesArguments(argNum)); + } - public int getValue() { - return value; + if (modifier != null) { + matcher = matcher.and(modifier.elementMatcher()); + } + + return matcher; + } + + public enum Modifier { + Public, Default, Private, Protected; + + private ElementMatcher.Junction elementMatcher() { + switch (this) { + case Private: { + return isPrivate(); + } + case Default: { + return isPackagePrivate(); + } + case Public: { + return isPublic(); + } + case Protected: { + return isProtected(); + } + default: + return isPublic(); + } } } @@ -72,7 +94,7 @@ public abstract class MethodMatcher { public String toString() { StringBuilder stringBuilder = new StringBuilder("method name=" + getMethodMatchDescribe()); if (getModifier() != null) { - stringBuilder.insert(0, getModifier() + " "); + stringBuilder.insert(0, getModifier() + " "); } if (getArgNum() > -1) { @@ -83,11 +105,11 @@ public abstract class MethodMatcher { stringBuilder.append(", types of arguments are "); boolean isFirst = true; for (Class argType : getArgTypeArray()) { - if (isFirst) { - isFirst = false; - } else { - stringBuilder.append(","); - } + if(isFirst){ + isFirst = false; + }else{ + stringBuilder.append(","); + } stringBuilder.append(argType.getName()); } } diff --git a/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/enhance/ClassConstructorInterceptor.java b/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/enhance/ClassConstructorInterceptor.java index 8034bf9ce..c85d925bc 100644 --- a/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/enhance/ClassConstructorInterceptor.java +++ b/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/enhance/ClassConstructorInterceptor.java @@ -2,27 +2,37 @@ package com.ai.cloud.skywalking.plugin.interceptor.enhance; import com.ai.cloud.skywalking.logging.LogManager; import com.ai.cloud.skywalking.logging.Logger; +import net.bytebuddy.implementation.bind.annotation.AllArguments; +import net.bytebuddy.implementation.bind.annotation.FieldProxy; +import net.bytebuddy.implementation.bind.annotation.RuntimeType; +import net.bytebuddy.implementation.bind.annotation.This; + import com.ai.cloud.skywalking.plugin.interceptor.EnhancedClassInstanceContext; public class ClassConstructorInterceptor { - private static Logger logger = LogManager.getLogger(ClassConstructorInterceptor.class); + private static Logger logger = LogManager + .getLogger(ClassConstructorInterceptor.class); - private InstanceMethodsAroundInterceptor interceptor; + private InstanceMethodsAroundInterceptor interceptor; - public ClassConstructorInterceptor(InstanceMethodsAroundInterceptor interceptor) { - this.interceptor = interceptor; - } + public ClassConstructorInterceptor(InstanceMethodsAroundInterceptor interceptor) { + this.interceptor = interceptor; + } - public void intercept(Object obj, Object instanceContext, Object[] allArguments) { - try { - EnhancedClassInstanceContext context = new EnhancedClassInstanceContext(); - // accessor.setValue(context); - instanceContext = context; - ConstructorInvokeContext interceptorContext = new ConstructorInvokeContext(obj, allArguments); - interceptor.onConstruct(context, interceptorContext); - } catch (Throwable t) { - logger.error("ClassConstructorInterceptor failue.", t); - } + @RuntimeType + public void intercept( + @This Object obj, + @FieldProxy(ClassEnhancePluginDefine.contextAttrName) FieldSetter accessor, + @AllArguments Object[] allArguments) { + try { + EnhancedClassInstanceContext context = new EnhancedClassInstanceContext(); + accessor.setValue(context); + ConstructorInvokeContext interceptorContext = new ConstructorInvokeContext(obj, + allArguments); + interceptor.onConstruct(context, interceptorContext); + } catch (Throwable t) { + logger.error("ClassConstructorInterceptor failue.", t); + } - } + } } diff --git a/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/enhance/ClassEnhancePluginDefine.java b/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/enhance/ClassEnhancePluginDefine.java index b48f162f2..28d55a313 100644 --- a/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/enhance/ClassEnhancePluginDefine.java +++ b/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/enhance/ClassEnhancePluginDefine.java @@ -1,129 +1,182 @@ package com.ai.cloud.skywalking.plugin.interceptor.enhance; +import static net.bytebuddy.matcher.ElementMatchers.any; +import static net.bytebuddy.matcher.ElementMatchers.not; + import com.ai.cloud.skywalking.logging.LogManager; import com.ai.cloud.skywalking.logging.Logger; -import com.ai.cloud.skywalking.plugin.exception.PluginException; +import net.bytebuddy.description.method.MethodDescription; +import net.bytebuddy.dynamic.DynamicType; +import net.bytebuddy.implementation.MethodDelegation; +import net.bytebuddy.implementation.SuperMethodCall; +import net.bytebuddy.implementation.bind.annotation.FieldProxy; +import net.bytebuddy.matcher.ElementMatcher; +import net.bytebuddy.matcher.ElementMatchers; + +import com.ai.cloud.skywalking.plugin.PluginException; import com.ai.cloud.skywalking.plugin.interceptor.AbstractClassEnhancePluginDefine; +import com.ai.cloud.skywalking.plugin.interceptor.EnhanceException; import com.ai.cloud.skywalking.plugin.interceptor.EnhancedClassInstanceContext; import com.ai.cloud.skywalking.plugin.interceptor.MethodMatcher; -import javassist.*; - -import java.lang.reflect.Modifier; public abstract class ClassEnhancePluginDefine extends AbstractClassEnhancePluginDefine { - private static Logger logger = LogManager.getLogger(ClassEnhancePluginDefine.class); + private static Logger logger = LogManager + .getLogger(ClassEnhancePluginDefine.class); - public static final String contextAttrName = "_$EnhancedClassInstanceContext"; + public static final String contextAttrName = "_$EnhancedClassInstanceContext"; - public byte[] enhance(CtClass ctClass) throws PluginException { - try { - CtMethod[] ctMethod = ctClass.getDeclaredMethods(); - for (CtMethod method : ctMethod) { - if (Modifier.isStatic(method.getModifiers())) { - this.enhanceClass(ctClass, method); - } else { - this.enhanceInstance(ctClass, method); - } - } + protected DynamicType.Builder enhance(String enhanceOriginClassName, + DynamicType.Builder newClassBuilder) throws PluginException { + newClassBuilder = this.enhanceClass(enhanceOriginClassName, newClassBuilder); + + newClassBuilder = this.enhanceInstance(enhanceOriginClassName, newClassBuilder); + + return newClassBuilder; + } - return ctClass.toBytecode(); - } catch (Exception e) { - throw new PluginException("Can not compile the class", e); - } - } + private DynamicType.Builder enhanceInstance(String enhanceOriginClassName, + DynamicType.Builder newClassBuilder) throws PluginException { + MethodMatcher[] methodMatchers = getInstanceMethodsMatchers(); + if(methodMatchers == null){ + return newClassBuilder; + } + + + /** + * alter class source code.
+ * + * new class need:
+ * 1.add field '_$EnhancedClassInstanceContext' of type + * EnhancedClassInstanceContext
+ * + * 2.intercept constructor by default, and intercept method which it's + * required by interceptorDefineClass.
+ */ + InstanceMethodsAroundInterceptor interceptor = getInstanceMethodsInterceptor(); + if (interceptor == null) { + throw new EnhanceException("no InstanceMethodsAroundInterceptor instance. "); + } - private void enhanceClass(CtClass ctClass, CtMethod method) throws CannotCompileException, NotFoundException { - boolean isMatch = false; - for (MethodMatcher methodMatcher : getStaticMethodsMatchers()) { - if (methodMatcher.match(method)) { - isMatch = true; - break; - } - } + newClassBuilder = newClassBuilder + .defineField(contextAttrName, + EnhancedClassInstanceContext.class) + .constructor(any()) + .intercept( + SuperMethodCall.INSTANCE.andThen(MethodDelegation.to( + new ClassConstructorInterceptor(interceptor)) + .appendParameterBinder( + FieldProxy.Binder.install( + FieldGetter.class, + FieldSetter.class)))); - if (isMatch) { - // 修改方法名, - String methodName = method.getName(); - String newMethodName = methodName + "_$SkywalkingEnhance"; - method.setName(newMethodName); + ClassInstanceMethodsInterceptor classMethodInterceptor = new ClassInstanceMethodsInterceptor( + interceptor); - CtMethod newMethod = new CtMethod(method.getReturnType(), methodName, method.getParameterTypes(), method.getDeclaringClass()); - newMethod.setBody( - "{ new " + ClassStaticMethodsInterceptor.class.getName() + "(new " + getStaticMethodsInterceptor().getClass().getName() + ").intercept($class,$args,\"" - + methodName + "\"," + OriginCallCodeGenerator.generateStaticMethodOriginCallCode(ctClass.getName(), newMethodName) + ");}"); + StringBuilder enhanceRules = new StringBuilder( + "\nprepare to enhance class [" + enhanceOriginClassName + + "] instance methods as following rules:\n"); + int ruleIdx = 1; + for (MethodMatcher methodMatcher : methodMatchers) { + enhanceRules.append("\t" + ruleIdx++ + ". " + methodMatcher + "\n"); + } + logger.debug(enhanceRules); + ElementMatcher.Junction matcher = null; + for (MethodMatcher methodMatcher : methodMatchers) { + logger.debug("enhance class {} instance methods by rule: {}", + enhanceOriginClassName, methodMatcher); + if (matcher == null) { + matcher = methodMatcher.buildMatcher(); + continue; + } - ctClass.addMethod(newMethod); - } + matcher = matcher.or(methodMatcher.buildMatcher()); - } + } - private void enhanceInstance(CtClass ctClass, CtMethod method) throws CannotCompileException, NotFoundException { - // 添加一个字段,并且带上get/set方法 - CtField ctField = CtField.make("{public " + EnhancedClassInstanceContext.class.getName() + " " + contextAttrName + ";}", ctClass); - ctClass.addMethod( - CtMethod.make("public " + EnhancedClassInstanceContext.class.getName() + " get" + contextAttrName + "(){ return this." + contextAttrName + ";}", ctClass)); - ctClass.addMethod(CtMethod.make( - "public void set" + contextAttrName + "(" + EnhancedClassInstanceContext.class.getName() + " " + contextAttrName + "){this." + contextAttrName + "=" - + contextAttrName + ";}", ctClass)); + /** + * exclude static methods. + */ + matcher = matcher.and(not(ElementMatchers.isStatic())); + newClassBuilder = newClassBuilder.method(matcher).intercept( + MethodDelegation.to(classMethodInterceptor)); + return newClassBuilder; + } + + /** + * 返回需要被增强的方法列表 + * + * @return + */ + protected abstract MethodMatcher[] getInstanceMethodsMatchers(); - // 初始化构造函数 - CtConstructor[] constructors = ctClass.getDeclaredConstructors(); - for (CtConstructor constructor : constructors) { - constructor.insertAfter(" new " + ClassConstructorInterceptor.class.getName() + "(new " + getInstanceMethodsInterceptor().getClass().getName() + "()).intercept($0,$0." - + contextAttrName + ",$args);"); - } + /** + * 返回增强拦截器的实现
+ * 每个拦截器在同一个被增强类的内部,保持单例 + * + * @return + */ + protected abstract InstanceMethodsAroundInterceptor getInstanceMethodsInterceptor(); + + private DynamicType.Builder enhanceClass(String enhanceOriginClassName, + DynamicType.Builder newClassBuilder) throws PluginException { + MethodMatcher[] methodMatchers = getStaticMethodsMatchers(); + if(methodMatchers == null){ + return newClassBuilder; + } + + StaticMethodsAroundInterceptor interceptor = getStaticMethodsInterceptor(); + if (interceptor == null) { + throw new EnhanceException("no StaticMethodsAroundInterceptor instance. "); + } + + + ClassStaticMethodsInterceptor classMethodInterceptor = new ClassStaticMethodsInterceptor( + interceptor); - boolean isMatch = false; - for (MethodMatcher methodMatcher : getInstanceMethodsMatchers()) { - if (methodMatcher.match(method)) { - isMatch = true; - break; - } - } + StringBuilder enhanceRules = new StringBuilder( + "\nprepare to enhance class [" + enhanceOriginClassName + + "] static methods as following rules:\n"); + int ruleIdx = 1; + for (MethodMatcher methodMatcher : methodMatchers) { + enhanceRules.append("\t" + ruleIdx++ + ". " + methodMatcher + "\n"); + } + logger.debug(enhanceRules); + ElementMatcher.Junction matcher = null; + for (MethodMatcher methodMatcher : methodMatchers) { + logger.debug("enhance class {} static methods by rule: {}", + enhanceOriginClassName, methodMatcher); + if (matcher == null) { + matcher = methodMatcher.buildMatcher(); + continue; + } - if (isMatch) { - // 修改方法名, - String methodName = method.getName(); - String newMethodName = methodName + "_$SkywalkingEnhance"; - method.setName(newMethodName); - CtMethod newMethod = new CtMethod(method.getReturnType(), methodName, method.getParameterTypes(), method.getDeclaringClass()); + matcher = matcher.or(methodMatcher.buildMatcher()); - newMethod.setBody( - "{ new " + ClassInstanceMethodsInterceptor.class.getName() + "(new " + getInstanceMethodsInterceptor().getClass().getName() + "()).intercept($0,$args,\"" - + methodName + "\"," + OriginCallCodeGenerator.generateInstanceMethodOriginCallCode("$0", methodName) + ",$0." + contextAttrName + ");}"); + } - ctClass.addMethod(newMethod); - } - } + /** + * restrict static methods. + */ + matcher = matcher.and(ElementMatchers.isStatic()); + newClassBuilder = newClassBuilder.method(matcher).intercept( + MethodDelegation.to(classMethodInterceptor)); - /** - * 返回需要被增强的方法列表 - * - * @return - */ - protected abstract MethodMatcher[] getInstanceMethodsMatchers(); + return newClassBuilder; + } + + /** + * 返回需要被增强的方法列表 + * + * @return + */ + protected abstract MethodMatcher[] getStaticMethodsMatchers(); - /** - * 返回增强拦截器的实现
- * 每个拦截器在同一个被增强类的内部,保持单例 - * - * @return - */ - protected abstract InstanceMethodsAroundInterceptor getInstanceMethodsInterceptor(); - - /** - * 返回需要被增强的方法列表 - * - * @return - */ - protected abstract MethodMatcher[] getStaticMethodsMatchers(); - - /** - * 返回增强拦截器的实现
- * 每个拦截器在同一个被增强类的内部,保持单例 - * - * @return - */ - protected abstract StaticMethodsAroundInterceptor getStaticMethodsInterceptor(); + /** + * 返回增强拦截器的实现
+ * 每个拦截器在同一个被增强类的内部,保持单例 + * + * @return + */ + protected abstract StaticMethodsAroundInterceptor getStaticMethodsInterceptor(); } diff --git a/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/enhance/ClassInstanceMethodsInterceptor.java b/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/enhance/ClassInstanceMethodsInterceptor.java index 79a5900eb..04f4d05fd 100644 --- a/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/enhance/ClassInstanceMethodsInterceptor.java +++ b/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/enhance/ClassInstanceMethodsInterceptor.java @@ -3,6 +3,10 @@ package com.ai.cloud.skywalking.plugin.interceptor.enhance; import com.ai.cloud.skywalking.logging.LogManager; import com.ai.cloud.skywalking.logging.Logger; import com.ai.cloud.skywalking.plugin.interceptor.EnhancedClassInstanceContext; +import net.bytebuddy.implementation.bind.annotation.*; + +import java.lang.reflect.Method; +import java.util.concurrent.Callable; /** * 类方法拦截、控制器 @@ -10,7 +14,8 @@ import com.ai.cloud.skywalking.plugin.interceptor.EnhancedClassInstanceContext; * @author wusheng */ public class ClassInstanceMethodsInterceptor { - private static Logger logger = LogManager.getLogger(ClassInstanceMethodsInterceptor.class); + private static Logger logger = LogManager + .getLogger(ClassInstanceMethodsInterceptor.class); private InstanceMethodsAroundInterceptor interceptor; @@ -18,13 +23,22 @@ public class ClassInstanceMethodsInterceptor { this.interceptor = interceptor; } - public Object intercept(Object obj, Object[] allArguments, String methodName, OriginCall zuper, EnhancedClassInstanceContext instanceContext) throws Exception { - InstanceMethodInvokeContext interceptorContext = new InstanceMethodInvokeContext(obj, methodName, allArguments); + @RuntimeType + public Object intercept( + @This Object obj, + @AllArguments Object[] allArguments, + @Origin Method method, + @SuperCall Callable zuper, + @FieldValue(ClassEnhancePluginDefine.contextAttrName) EnhancedClassInstanceContext instanceContext) + throws Exception { + InstanceMethodInvokeContext interceptorContext = new InstanceMethodInvokeContext(obj, + method.getName(), allArguments); MethodInterceptResult result = new MethodInterceptResult(); try { interceptor.beforeMethod(instanceContext, interceptorContext, result); } catch (Throwable t) { - logger.error("class[{}] before method[{}] intercept failue:{}", new Object[] {obj.getClass(), methodName, t.getMessage()}, t); + logger.error("class[{}] before method[{}] intercept failue:{}", + new Object[]{obj.getClass(), method.getName(), t.getMessage()}, t); } if (!result.isContinue()) { return result._ret(); @@ -37,14 +51,16 @@ public class ClassInstanceMethodsInterceptor { try { interceptor.handleMethodException(t, instanceContext, interceptorContext, ret); } catch (Throwable t2) { - logger.error("class[{}] handle method[{}] exception failue:{}", new Object[] {obj.getClass(), methodName, t2.getMessage()}, t2); + logger.error("class[{}] handle method[{}] exception failue:{}", + new Object[]{obj.getClass(), method.getName(), t2.getMessage()}, t2); } throw t; } finally { try { ret = interceptor.afterMethod(instanceContext, interceptorContext, ret); } catch (Throwable t) { - logger.error("class[{}] after method[{}] intercept failue:{}", new Object[] {obj.getClass(), methodName, t.getMessage()}, t); + logger.error("class[{}] after method[{}] intercept failue:{}", + new Object[]{obj.getClass(), method.getName(), t.getMessage()}, t); } } return ret; diff --git a/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/enhance/ClassStaticMethodsInterceptor.java b/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/enhance/ClassStaticMethodsInterceptor.java index a0cfed24b..364f8f716 100644 --- a/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/enhance/ClassStaticMethodsInterceptor.java +++ b/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/enhance/ClassStaticMethodsInterceptor.java @@ -2,6 +2,13 @@ package com.ai.cloud.skywalking.plugin.interceptor.enhance; import com.ai.cloud.skywalking.logging.LogManager; import com.ai.cloud.skywalking.logging.Logger; +import net.bytebuddy.implementation.bind.annotation.AllArguments; +import net.bytebuddy.implementation.bind.annotation.Origin; +import net.bytebuddy.implementation.bind.annotation.RuntimeType; +import net.bytebuddy.implementation.bind.annotation.SuperCall; + +import java.lang.reflect.Method; +import java.util.concurrent.Callable; /** * 类静态方法拦截、控制器 @@ -17,13 +24,14 @@ public class ClassStaticMethodsInterceptor { this.interceptor = interceptor; } - public Object intercept(Class clazz, Object[] allArguments, String methodName, OriginCall zuper) throws Exception { - MethodInvokeContext interceptorContext = new MethodInvokeContext(methodName, allArguments); + @RuntimeType + public Object intercept(@Origin Class clazz, @AllArguments Object[] allArguments, @Origin Method method, @SuperCall Callable zuper) throws Exception { + MethodInvokeContext interceptorContext = new MethodInvokeContext(method.getName(), allArguments); MethodInterceptResult result = new MethodInterceptResult(); try { interceptor.beforeMethod(interceptorContext, result); } catch (Throwable t) { - logger.error("class[{}] before static method[{}] intercept failue:{}", new Object[] {clazz, methodName, t.getMessage()}, t); + logger.error("class[{}] before static method[{}] intercept failue:{}", new Object[] {clazz, method.getName(), t.getMessage()}, t); } if (!result.isContinue()) { return result._ret(); @@ -36,14 +44,14 @@ public class ClassStaticMethodsInterceptor { try { interceptor.handleMethodException(t, interceptorContext, ret); } catch (Throwable t2) { - logger.error("class[{}] handle static method[{}] exception failue:{}", new Object[] {clazz, methodName, t2.getMessage()}, t2); + logger.error("class[{}] handle static method[{}] exception failue:{}", new Object[] {clazz, method.getName(), t2.getMessage()}, t2); } throw t; } finally { try { ret = interceptor.afterMethod(interceptorContext, ret); } catch (Throwable t) { - logger.error("class[{}] after static method[{}] intercept failue:{}", new Object[] {clazz, methodName, t.getMessage()}, t); + logger.error("class[{}] after static method[{}] intercept failue:{}", new Object[] {clazz, method.getName(), t.getMessage()}, t); } } return ret; diff --git a/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/enhance/OriginCallCodeGenerator.java b/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/enhance/OriginCallCodeGenerator.java index 72d110b03..bcd16d9ba 100644 --- a/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/enhance/OriginCallCodeGenerator.java +++ b/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/enhance/OriginCallCodeGenerator.java @@ -1,51 +1,7 @@ package com.ai.cloud.skywalking.plugin.interceptor.enhance; -import com.ai.cloud.skywalking.logging.LogManager; -import com.ai.cloud.skywalking.logging.Logger; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; - +/** + * Created by xin on 16/7/26. + */ public class OriginCallCodeGenerator { - private static Logger logger = LogManager.getLogger(OriginCallCodeGenerator.class); - private static String staticMethodOriginCallCode; - private static String instanceMethodOriginCallCode; - - static { - try { - instanceMethodOriginCallCode = loadInstanceMethodOriginCallCode(); - staticMethodOriginCallCode = loadStaticMethodOriginCallCode(); - } catch (Exception e) { - - } - } - - private static String loadInstanceMethodOriginCallCode() throws IOException { - return loadCodeSegment("/instance_method_call_origin_code.conf"); - } - - private static String loadStaticMethodOriginCallCode() throws IOException { - return loadCodeSegment("/static_method_call_origin_code.conf"); - } - - private static String loadCodeSegment(String fileName) throws IOException { - BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(OriginCallCodeGenerator.class.getResourceAsStream(fileName))); - StringBuilder code = new StringBuilder(); - String codeSegment; - while ((codeSegment = bufferedReader.readLine()) != null) { - code.append(codeSegment); - } - - return code.toString(); - } - - public static String generateInstanceMethodOriginCallCode(String originObject, String methodName) { - return instanceMethodOriginCallCode.toString().replaceAll("%origin_object%", originObject).replaceAll("%method_name%", methodName); - } - - public static String generateStaticMethodOriginCallCode(String className, String methodName) { - return staticMethodOriginCallCode.toString().replaceAll("%class_name%", className).replaceAll("%method_name%", methodName); - } - } diff --git a/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/matcher/AnyMethodsMatcher.java b/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/matcher/AnyMethodsMatcher.java index 6e73f622d..12d1b5a86 100644 --- a/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/matcher/AnyMethodsMatcher.java +++ b/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/matcher/AnyMethodsMatcher.java @@ -1,6 +1,9 @@ package com.ai.cloud.skywalking.plugin.interceptor.matcher; -import javassist.CtMethod; +import net.bytebuddy.description.method.MethodDescription; +import net.bytebuddy.matcher.ElementMatcher; + +import static net.bytebuddy.matcher.ElementMatchers.any; public class AnyMethodsMatcher extends ExclusiveObjectDefaultMethodsMatcher { @@ -8,14 +11,13 @@ public class AnyMethodsMatcher extends ExclusiveObjectDefaultMethodsMatcher { super("any method"); } + @Override + public ElementMatcher.Junction match() { + return any(); + } @Override public String toString() { return getMethodMatchDescribe(); } - - @Override - public boolean matchMethod(CtMethod ctMethod) { - return true; - } } diff --git a/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/matcher/ExclusiveObjectDefaultMethodsMatcher.java b/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/matcher/ExclusiveObjectDefaultMethodsMatcher.java index bf10081ae..6da3fbf02 100644 --- a/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/matcher/ExclusiveObjectDefaultMethodsMatcher.java +++ b/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/matcher/ExclusiveObjectDefaultMethodsMatcher.java @@ -1,37 +1,51 @@ package com.ai.cloud.skywalking.plugin.interceptor.matcher; import com.ai.cloud.skywalking.plugin.interceptor.MethodMatcher; -import javassist.CtMethod; +import net.bytebuddy.description.method.MethodDescription; +import net.bytebuddy.matcher.ElementMatcher; + +import static net.bytebuddy.matcher.ElementMatchers.not; public abstract class ExclusiveObjectDefaultMethodsMatcher extends MethodMatcher { - private static final MethodMatcher[] EXCLUSIVE_DEFAULT_METHOD_NAME = - new MethodMatcher[] {new SimpleMethodMatcher(Modifier.Public, "finalize", 0), new SimpleMethodMatcher(Modifier.Public, "wait", long.class, int.class), - new SimpleMethodMatcher(Modifier.Public, "wait", long.class), new SimpleMethodMatcher(Modifier.Public, "wait", 0), - new SimpleMethodMatcher(Modifier.Public, "equals", Object.class), new SimpleMethodMatcher(Modifier.Public, "toString", 0), - new SimpleMethodMatcher(Modifier.Public, "hashCode", 0), new SimpleMethodMatcher(Modifier.Public, "getClass", 0), - new SimpleMethodMatcher(Modifier.Public, "clone", 0), new SimpleMethodMatcher(Modifier.Public, "notify", 0), - new SimpleMethodMatcher(Modifier.Public, "notifyAll", 0)}; + private static final MethodMatcher[] EXCLUSIVE_DEFAULT_METHOD_NAME = new MethodMatcher[]{ + new SimpleMethodMatcher(Modifier.Public, "finalize", 0), + new SimpleMethodMatcher(Modifier.Public, "wait", long.class, int.class), + new SimpleMethodMatcher(Modifier.Public, "wait", long.class), + new SimpleMethodMatcher(Modifier.Public, "wait", 0), + new SimpleMethodMatcher(Modifier.Public, "equals", Object.class), + new SimpleMethodMatcher(Modifier.Public, "toString", 0), + new SimpleMethodMatcher(Modifier.Public, "hashCode", 0), + new SimpleMethodMatcher(Modifier.Public, "getClass", 0), + new SimpleMethodMatcher(Modifier.Public, "clone", 0), + new SimpleMethodMatcher(Modifier.Public, "notify", 0), + new SimpleMethodMatcher(Modifier.Public, "notifyAll", 0) + }; public ExclusiveObjectDefaultMethodsMatcher(String methodMatchDescribe) { super(methodMatchDescribe); } @Override - public boolean match(CtMethod ctMethod) { - return this.matchMethod(ctMethod) && excludeObjectDefaultMethod(ctMethod); + public ElementMatcher.Junction buildMatcher() { + return this.match().and(excludeObjectDefaultMethod()); } - - protected boolean excludeObjectDefaultMethod(CtMethod ctMethod) { + protected ElementMatcher.Junction excludeObjectDefaultMethod() { + ElementMatcher.Junction exclusiveMatcher = null; for (MethodMatcher methodMatcher : EXCLUSIVE_DEFAULT_METHOD_NAME) { - if (methodMatcher.match(ctMethod)) { - return false; + if (exclusiveMatcher == null) { + exclusiveMatcher = methodMatcher.buildMatcher(); + continue; } + + exclusiveMatcher = exclusiveMatcher.or(methodMatcher.buildMatcher()); + } - return true; + return not(exclusiveMatcher); } - public abstract boolean matchMethod(CtMethod ctMethod); + public abstract ElementMatcher.Junction match(); + } diff --git a/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/matcher/MethodsExclusiveMatcher.java b/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/matcher/MethodsExclusiveMatcher.java index 8a9a3221e..120a04447 100644 --- a/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/matcher/MethodsExclusiveMatcher.java +++ b/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/matcher/MethodsExclusiveMatcher.java @@ -1,12 +1,15 @@ package com.ai.cloud.skywalking.plugin.interceptor.matcher; import com.ai.cloud.skywalking.plugin.interceptor.MethodMatcher; -import javassist.CtMethod; +import net.bytebuddy.description.method.MethodDescription; +import net.bytebuddy.matcher.ElementMatcher; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import static net.bytebuddy.matcher.ElementMatchers.not; + public class MethodsExclusiveMatcher extends ExclusiveObjectDefaultMethodsMatcher { private List matchers = new ArrayList(); @@ -23,25 +26,30 @@ public class MethodsExclusiveMatcher extends ExclusiveObjectDefaultMethodsMatche this.matchers.addAll(Arrays.asList(matchers)); } + @Override + public ElementMatcher.Junction match() { + ElementMatcher.Junction result = null; + + for (MethodMatcher matcher : matchers) { + if (result == null) { + result = matcher.buildMatcher(); + continue; + } + + result = result.or(matcher.buildMatcher()); + } + + return not(result); + } + @Override public String toString() { StringBuilder stringBuilder = new StringBuilder("exclude following method(s): "); int idx = 1; for (MethodMatcher methodMatcher : matchers) { - stringBuilder.append(idx++ + "." + methodMatcher.toString() + ". "); + stringBuilder.append(idx++ + "." + methodMatcher.toString() + ". "); } return stringBuilder.toString(); } - - @Override - public boolean matchMethod(CtMethod ctMethod) { - boolean result = false; - for (MethodMatcher methodMatcher : matchers) { - if (methodMatcher.match(ctMethod)) { - result = result || result; - } - } - return !result; - } } diff --git a/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/matcher/PrivateMethodMatcher.java b/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/matcher/PrivateMethodMatcher.java index 9671ded88..2d7f414b4 100644 --- a/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/matcher/PrivateMethodMatcher.java +++ b/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/matcher/PrivateMethodMatcher.java @@ -1,7 +1,11 @@ package com.ai.cloud.skywalking.plugin.interceptor.matcher; import com.ai.cloud.skywalking.plugin.interceptor.MethodMatcher; -import javassist.CtMethod; +import net.bytebuddy.description.method.MethodDescription; +import net.bytebuddy.matcher.ElementMatcher; +import net.bytebuddy.matcher.ElementMatchers; + +import static net.bytebuddy.matcher.ElementMatchers.any; public class PrivateMethodMatcher extends MethodMatcher { public PrivateMethodMatcher() { @@ -9,8 +13,8 @@ public class PrivateMethodMatcher extends MethodMatcher { } @Override - public boolean match(CtMethod ctMethod) { - return java.lang.reflect.Modifier.isPrivate(ctMethod.getModifiers()); + public ElementMatcher.Junction buildMatcher() { + return any().and(ElementMatchers.isPrivate()); } @Override diff --git a/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/matcher/SimpleMethodMatcher.java b/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/matcher/SimpleMethodMatcher.java index 5ccee25f6..d651475d5 100644 --- a/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/matcher/SimpleMethodMatcher.java +++ b/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/plugin/interceptor/matcher/SimpleMethodMatcher.java @@ -1,8 +1,10 @@ package com.ai.cloud.skywalking.plugin.interceptor.matcher; +import static net.bytebuddy.matcher.ElementMatchers.named; +import net.bytebuddy.description.method.MethodDescription; +import net.bytebuddy.matcher.ElementMatcher; + import com.ai.cloud.skywalking.plugin.interceptor.MethodMatcher; -import javassist.CtMethod; -import javassist.NotFoundException; public class SimpleMethodMatcher extends MethodMatcher { @@ -31,42 +33,10 @@ public class SimpleMethodMatcher extends MethodMatcher { super(modifier, methodMatchDescribe, argTypeArray); } + @Override - public boolean match(CtMethod ctMethod) { - int result = 1; - try { - result <<= matchArgTypeArrayIfNecessary(ctMethod); - result <<= matchArgNumIfNecessary(ctMethod); - result <<= matchModifierIfNecessary(ctMethod); - return result == 1 ? true : false; - } catch (Exception e) { - return false; - } + public ElementMatcher.Junction buildMatcher() { + ElementMatcher.Junction matcher = named(getMethodMatchDescribe()); + return mergeArgumentsIfNecessary(matcher); } - - private int matchModifierIfNecessary(CtMethod ctMethod) { - if (getModifier() != null) { - return getModifier().getValue() == ctMethod.getModifiers() ? 0 : 1; - } - return 0; - } - - private int matchArgNumIfNecessary(CtMethod ctMethod) throws NotFoundException { - if (getArgNum() > -1) { - return getArgNum() == ctMethod.getParameterTypes().length ? 0 : 1; - } - return 0; - } - - private int matchArgTypeArrayIfNecessary(CtMethod ctMethod) throws NotFoundException { - if (getArgTypeArray() != null) { - for (int i = 0; i < getArgTypeArray().length; i++) { - if (!getArgTypeArray()[i].getName().equals(ctMethod.getParameterTypes()[i].getName())) { - return 1; - } - } - } - return 0; - } - } diff --git a/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/protocol/util/ContextGenerator.java b/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/protocol/util/ContextGenerator.java index 62430044d..45267faca 100644 --- a/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/protocol/util/ContextGenerator.java +++ b/skywalking-collector/skywalking-api/src/main/java/com/ai/cloud/skywalking/protocol/util/ContextGenerator.java @@ -37,13 +37,7 @@ public final class ContextGenerator { spanData = new Span(TraceIdGenerator.generate(), Config.SkyWalking.APPLICATION_CODE, Config.SkyWalking.USER_ID); } else { // 如果不为空,则将当前的Context存放到上下文 - Span previousSpanData = CurrentThreadSpanStack.peek(); - if (previousSpanData == null){ - spanData = new Span(context.getTraceId(), context.getParentLevel(), context.getLevelId(), Config.SkyWalking.APPLICATION_CODE, Config.SkyWalking.USER_ID); - }else{ - spanData = new Span(previousSpanData.getTraceId(), Config.SkyWalking.APPLICATION_CODE, Config.SkyWalking.USER_ID); - spanData.setParentLevel(previousSpanData.getParentLevel() + "." + previousSpanData.getLevelId()); - } + spanData = new Span(context.getTraceId(), context.getParentLevel(), context.getLevelId(), Config.SkyWalking.APPLICATION_CODE, Config.SkyWalking.USER_ID); } spanData.setStartDate(System.currentTimeMillis()); diff --git a/skywalking-collector/skywalking-api/src/main/resources/instance_method_call_origin_code.conf b/skywalking-collector/skywalking-api/src/main/resources/instance_method_call_origin_code.conf index cb9aff289..e69de29bb 100644 --- a/skywalking-collector/skywalking-api/src/main/resources/instance_method_call_origin_code.conf +++ b/skywalking-collector/skywalking-api/src/main/resources/instance_method_call_origin_code.conf @@ -1,11 +0,0 @@ -new com.ai.cloud.skywalking.plugin.interceptor.enhance.OriginCall(%origin_object%){ - private Object _this; - - public com.ai.cloud.skywalking.plugin.interceptor.enhance.OriginCall(Object _this){ - this._this = _this; - } - - public Object call(){ - return _this.%method_name%($$); - } -} diff --git a/skywalking-collector/skywalking-api/src/main/resources/static_method_call_origin_code.conf b/skywalking-collector/skywalking-api/src/main/resources/static_method_call_origin_code.conf index ef2e15c6a..4c658f62c 100644 --- a/skywalking-collector/skywalking-api/src/main/resources/static_method_call_origin_code.conf +++ b/skywalking-collector/skywalking-api/src/main/resources/static_method_call_origin_code.conf @@ -1,6 +1 @@ -new com.ai.cloud.skywalking.plugin.interceptor.enhance.OriginCall(){ - - public Object call(){ - return %class_name%.%method_name%($$); - } -} +new Origin diff --git a/skywalking-collector/skywalking-api/src/test/java/test/ai/cloud/assertspandata/SDKGeneratedDataTest.java b/skywalking-collector/skywalking-api/src/test/java/test/ai/cloud/assertspandata/SDKGeneratedDataTest.java index 97c7650e5..a287bef47 100644 --- a/skywalking-collector/skywalking-api/src/test/java/test/ai/cloud/assertspandata/SDKGeneratedDataTest.java +++ b/skywalking-collector/skywalking-api/src/test/java/test/ai/cloud/assertspandata/SDKGeneratedDataTest.java @@ -15,7 +15,7 @@ public class SDKGeneratedDataTest { @Test public void traceTreeAssertTest() { Config.Consumer.MAX_CONSUMER = 0; - Span testSpan = new Span("1.0b.1465224457414.7e57f54.22905.61.2691", "", 0, "sample-application", "5"); + Span testSpan = new Span("1.0b.1465224457414.7e57f54.22905.61.2691", "", 0, "test-application", "5"); RequestSpan requestSpan = RequestSpan.RequestSpanBuilder.newBuilder(testSpan).viewPoint("http://hire.asiainfo.com/Aisse-Mobile-Web/aisseWorkPage/submitReimbursement").build(); ContextBuffer.save(requestSpan); diff --git a/skywalking-collector/skywalking-api/src/test/java/test/ai/cloud/matcher/ExclusionMatcherTest.java b/skywalking-collector/skywalking-api/src/test/java/test/ai/cloud/matcher/ExclusionMatcherTest.java index 787e51fdd..ee0255cc1 100644 --- a/skywalking-collector/skywalking-api/src/test/java/test/ai/cloud/matcher/ExclusionMatcherTest.java +++ b/skywalking-collector/skywalking-api/src/test/java/test/ai/cloud/matcher/ExclusionMatcherTest.java @@ -9,8 +9,8 @@ import com.ai.cloud.skywalking.plugin.PluginBootstrap; public class ExclusionMatcherTest extends TestCase{ @Test public void testMatcher() throws ClassNotFoundException, IllegalAccessException, InstantiationException, InterruptedException { - //new PluginBootstrap().start(); - TestMatcherClass testMatcherClass = (TestMatcherClass) Class.forName("sample.ai.cloud.matcher.TestMatcherClass").newInstance(); + new PluginBootstrap().start(); + TestMatcherClass testMatcherClass = (TestMatcherClass) Class.forName("test.ai.cloud.matcher.TestMatcherClass").newInstance(); testMatcherClass.set(); testMatcherClass.seta("a"); diff --git a/skywalking-collector/skywalking-api/src/test/java/test/ai/cloud/matcher/TestMatcherDefine.java b/skywalking-collector/skywalking-api/src/test/java/test/ai/cloud/matcher/TestMatcherDefine.java index 81cdeebe7..9c424f7c4 100644 --- a/skywalking-collector/skywalking-api/src/test/java/test/ai/cloud/matcher/TestMatcherDefine.java +++ b/skywalking-collector/skywalking-api/src/test/java/test/ai/cloud/matcher/TestMatcherDefine.java @@ -11,7 +11,7 @@ import com.ai.cloud.skywalking.plugin.interceptor.matcher.PrivateMethodMatcher; public class TestMatcherDefine extends ClassInstanceMethodsEnhancePluginDefine { @Override public String enhanceClassName() { - return "sample.ai.cloud.matcher.TestMatcherClass"; + return "test.ai.cloud.matcher.TestMatcherClass"; } @Override diff --git a/skywalking-collector/skywalking-api/src/test/java/test/ai/cloud/plugin/PluginMainTest.java b/skywalking-collector/skywalking-api/src/test/java/test/ai/cloud/plugin/PluginMainTest.java index ad87e19d6..b41d38d25 100644 --- a/skywalking-collector/skywalking-api/src/test/java/test/ai/cloud/plugin/PluginMainTest.java +++ b/skywalking-collector/skywalking-api/src/test/java/test/ai/cloud/plugin/PluginMainTest.java @@ -12,13 +12,13 @@ public class PluginMainTest { IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException, ClassNotFoundException { TracingBootstrap - .main(new String[] { "sample.ai.cloud.plugin.PluginMainTest" }); + .main(new String[] { "test.ai.cloud.plugin.PluginMainTest" }); } public static void main(String[] args) throws InstantiationException, IllegalAccessException, ClassNotFoundException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException { long start = System.currentTimeMillis(); - BeInterceptedClass inst = (BeInterceptedClass) Class.forName("sample.ai.cloud.plugin.BeInterceptedClass").newInstance(); + BeInterceptedClass inst = (BeInterceptedClass) Class.forName("test.ai.cloud.plugin.BeInterceptedClass").newInstance(); inst.printabc(); long end = System.currentTimeMillis(); System.out.println(end - start + "ms"); diff --git a/skywalking-collector/skywalking-api/src/test/java/test/ai/cloud/plugin/TestAroundInterceptor.java b/skywalking-collector/skywalking-api/src/test/java/test/ai/cloud/plugin/TestAroundInterceptor.java index e481f53dd..7e146e9da 100644 --- a/skywalking-collector/skywalking-api/src/test/java/test/ai/cloud/plugin/TestAroundInterceptor.java +++ b/skywalking-collector/skywalking-api/src/test/java/test/ai/cloud/plugin/TestAroundInterceptor.java @@ -10,18 +10,18 @@ public class TestAroundInterceptor implements InstanceMethodsAroundInterceptor { @Override public void onConstruct(EnhancedClassInstanceContext context, ConstructorInvokeContext interceptorContext) { - context.set("sample.key", "123"); + context.set("test.key", "123"); System.out.println("onConstruct, args size=" + interceptorContext.allArguments().length); } @Override public void beforeMethod(EnhancedClassInstanceContext context, InstanceMethodInvokeContext interceptorContext, MethodInterceptResult result) { - System.out.println("beforeMethod : " + context.get("sample.key", String.class)); + System.out.println("beforeMethod : " + context.get("test.key", String.class)); } @Override public Object afterMethod(EnhancedClassInstanceContext context, InstanceMethodInvokeContext interceptorContext, Object ret) { - System.out.println("afterMethod: " + context.get("sample.key", String.class)); + System.out.println("afterMethod: " + context.get("test.key", String.class)); return ret; } diff --git a/skywalking-collector/skywalking-api/src/test/java/test/ai/cloud/plugin/TestInterceptorDefine.java b/skywalking-collector/skywalking-api/src/test/java/test/ai/cloud/plugin/TestInterceptorDefine.java index 98b3b12fc..ae0b805c4 100644 --- a/skywalking-collector/skywalking-api/src/test/java/test/ai/cloud/plugin/TestInterceptorDefine.java +++ b/skywalking-collector/skywalking-api/src/test/java/test/ai/cloud/plugin/TestInterceptorDefine.java @@ -10,7 +10,7 @@ public class TestInterceptorDefine extends ClassEnhancePluginDefine { @Override public String enhanceClassName() { - return "sample.ai.cloud.plugin.BeInterceptedClass"; + return "test.ai.cloud.plugin.BeInterceptedClass"; } @Override diff --git a/skywalking-collector/skywalking-api/src/test/java/test/ai/cloud/serialize/SerializeTest.java b/skywalking-collector/skywalking-api/src/test/java/test/ai/cloud/serialize/SerializeTest.java index 8771e7411..a4775c427 100644 --- a/skywalking-collector/skywalking-api/src/test/java/test/ai/cloud/serialize/SerializeTest.java +++ b/skywalking-collector/skywalking-api/src/test/java/test/ai/cloud/serialize/SerializeTest.java @@ -8,7 +8,7 @@ import com.ai.cloud.skywalking.protocol.common.SpanType; public class SerializeTest { public static void main(String[] args) throws InterruptedException { while (true) { - Span spandata = new Span("1.0b.1461060884539.7d6d06e.22489.1271.103", "", 0, "sample-application", "test"); + Span spandata = new Span("1.0b.1461060884539.7d6d06e.22489.1271.103", "", 0, "test-application", "test"); spandata.setSpanType(SpanType.LOCAL); spandata.setStartDate(System.currentTimeMillis() - 1000 * 60); AckSpan requestSpan = new AckSpan(spandata); diff --git a/skywalking-collector/skywalking-sdk-plugin/dubbo-plugin/src/test/java/com/ai/cloud/skywalking/plugin/test/dubbo/consumer/DubboConsumer.java b/skywalking-collector/skywalking-sdk-plugin/dubbo-plugin/src/test/java/com/ai/cloud/skywalking/plugin/test/dubbo/consumer/DubboConsumer.java index 770e572d7..924817064 100644 --- a/skywalking-collector/skywalking-sdk-plugin/dubbo-plugin/src/test/java/com/ai/cloud/skywalking/plugin/test/dubbo/consumer/DubboConsumer.java +++ b/skywalking-collector/skywalking-sdk-plugin/dubbo-plugin/src/test/java/com/ai/cloud/skywalking/plugin/test/dubbo/consumer/DubboConsumer.java @@ -15,7 +15,7 @@ public class DubboConsumer { @Test public void test() throws InvocationTargetException, NoSuchMethodException, ClassNotFoundException, IllegalAccessException { TracingBootstrap - .main(new String[]{"com.ai.cloud.skywalking.plugin.sample.dubbo.consumer.DubboConsumer"}); + .main(new String[]{"com.ai.cloud.skywalking.plugin.test.dubbo.consumer.DubboConsumer"}); } public static void main(String[] args) throws InterruptedException { @@ -23,7 +23,7 @@ public class DubboConsumer { IDubboInterA dubboInterA = context.getBean(IDubboInterA.class); dubboInterA.doBusiness("AAAAA"); RequestSpanAssert.assertEquals(new String[][]{ - {"0", "dubbo://127.0.0.1:20880/com.ai.cloud.skywalking.plugin.sample.dubbo.interfaces.IDubboInterA.doBusiness(String)", ""} + {"0", "dubbo://127.0.0.1:20880/com.ai.cloud.skywalking.plugin.test.dubbo.interfaces.IDubboInterA.doBusiness(String)", ""} }); } } diff --git a/skywalking-collector/skywalking-sdk-plugin/dubbo-plugin/src/test/java/com/ai/cloud/skywalking/plugin/test/dubbo/impl/DubboStart.java b/skywalking-collector/skywalking-sdk-plugin/dubbo-plugin/src/test/java/com/ai/cloud/skywalking/plugin/test/dubbo/impl/DubboStart.java index b5e6d7400..9f48f0781 100644 --- a/skywalking-collector/skywalking-sdk-plugin/dubbo-plugin/src/test/java/com/ai/cloud/skywalking/plugin/test/dubbo/impl/DubboStart.java +++ b/skywalking-collector/skywalking-sdk-plugin/dubbo-plugin/src/test/java/com/ai/cloud/skywalking/plugin/test/dubbo/impl/DubboStart.java @@ -11,7 +11,7 @@ public class DubboStart { @Test public void test() throws InvocationTargetException, NoSuchMethodException, ClassNotFoundException, IllegalAccessException { TracingBootstrap - .main(new String[]{"com.ai.cloud.skywalking.plugin.sample.dubbo.impl.DubboStart"}); + .main(new String[]{"com.ai.cloud.skywalking.plugin.test.dubbo.impl.DubboStart"}); } public static void main(String[] args) throws InterruptedException { diff --git a/skywalking-collector/skywalking-sdk-plugin/dubbo-plugin/src/test/java/com/ai/cloud/skywalking/plugin/test/dubbox283/consumer/DubboxRestConsumer.java b/skywalking-collector/skywalking-sdk-plugin/dubbo-plugin/src/test/java/com/ai/cloud/skywalking/plugin/test/dubbox283/consumer/DubboxRestConsumer.java index 9360a7417..d8a7cb13d 100644 --- a/skywalking-collector/skywalking-sdk-plugin/dubbo-plugin/src/test/java/com/ai/cloud/skywalking/plugin/test/dubbox283/consumer/DubboxRestConsumer.java +++ b/skywalking-collector/skywalking-sdk-plugin/dubbo-plugin/src/test/java/com/ai/cloud/skywalking/plugin/test/dubbox283/consumer/DubboxRestConsumer.java @@ -20,7 +20,7 @@ public class DubboxRestConsumer { @Test public void test() throws InvocationTargetException, NoSuchMethodException, ClassNotFoundException, IllegalAccessException { - TracingBootstrap.main(new String[] {"com.ai.cloud.skywalking.plugin.sample.dubbox283.consumer.DubboxRestConsumer"}); + TracingBootstrap.main(new String[] {"com.ai.cloud.skywalking.plugin.test.dubbox283.consumer.DubboxRestConsumer"}); } public static void main(String[] args) throws IOException, URISyntaxException, InterruptedException { @@ -29,6 +29,6 @@ public class DubboxRestConsumer { IDubboxRestInterA dubboxRestInterA = context.getBean(IDubboxRestInterA.class); dubboxRestInterA.doBusiness(new DubboxRestInterAParameter("AAAAA")); RequestSpanAssert.assertEquals(new String[][] { - {"0", "rest://127.0.0.1:20880/com.ai.cloud.skywalking.plugin.sample.dubbox283.interfaces.IDubboxRestInterA.doBusiness(DubboxRestInterAParameter)", ""}}); + {"0", "rest://127.0.0.1:20880/com.ai.cloud.skywalking.plugin.test.dubbox283.interfaces.IDubboxRestInterA.doBusiness(DubboxRestInterAParameter)", ""}}); } } diff --git a/skywalking-collector/skywalking-sdk-plugin/dubbo-plugin/src/test/java/com/ai/cloud/skywalking/plugin/test/dubbox283/consumer/DubboxRestStart.java b/skywalking-collector/skywalking-sdk-plugin/dubbo-plugin/src/test/java/com/ai/cloud/skywalking/plugin/test/dubbox283/consumer/DubboxRestStart.java index 28991934c..96116300e 100644 --- a/skywalking-collector/skywalking-sdk-plugin/dubbo-plugin/src/test/java/com/ai/cloud/skywalking/plugin/test/dubbox283/consumer/DubboxRestStart.java +++ b/skywalking-collector/skywalking-sdk-plugin/dubbo-plugin/src/test/java/com/ai/cloud/skywalking/plugin/test/dubbox283/consumer/DubboxRestStart.java @@ -12,7 +12,7 @@ public class DubboxRestStart { @Test public void test() throws InvocationTargetException, NoSuchMethodException, ClassNotFoundException, IllegalAccessException { TracingBootstrap - .main(new String[]{"com.ai.cloud.skywalking.plugin.sample.dubbox283.consumer.DubboxRestStart"}); + .main(new String[]{"com.ai.cloud.skywalking.plugin.test.dubbox283.consumer.DubboxRestStart"}); } public static void main(String[] args) throws InterruptedException { diff --git a/skywalking-collector/skywalking-sdk-plugin/dubbo-plugin/src/test/java/com/ai/cloud/skywalking/plugin/test/dubbox284/consumer/DubboxRestConsumer.java b/skywalking-collector/skywalking-sdk-plugin/dubbo-plugin/src/test/java/com/ai/cloud/skywalking/plugin/test/dubbox284/consumer/DubboxRestConsumer.java index 0eb6e5cbc..84b81083d 100644 --- a/skywalking-collector/skywalking-sdk-plugin/dubbo-plugin/src/test/java/com/ai/cloud/skywalking/plugin/test/dubbox284/consumer/DubboxRestConsumer.java +++ b/skywalking-collector/skywalking-sdk-plugin/dubbo-plugin/src/test/java/com/ai/cloud/skywalking/plugin/test/dubbox284/consumer/DubboxRestConsumer.java @@ -19,7 +19,7 @@ public class DubboxRestConsumer { @Test public void test() throws InvocationTargetException, NoSuchMethodException, ClassNotFoundException, IllegalAccessException { - TracingBootstrap.main(new String[] {"com.ai.cloud.skywalking.plugin.sample.dubbox284.consumer.DubboxRestConsumer"}); + TracingBootstrap.main(new String[] {"com.ai.cloud.skywalking.plugin.test.dubbox284.consumer.DubboxRestConsumer"}); } public static void main(String[] args) throws IOException, URISyntaxException, InterruptedException { @@ -27,6 +27,6 @@ public class DubboxRestConsumer { IDubboxRestInterA dubboxRestInterA = context.getBean(IDubboxRestInterA.class); dubboxRestInterA.doBusiness(new DubboxRestInterAParameter("AAAAA")); RequestSpanAssert.assertEquals(new String[][] { - {"0", "rest://127.0.0.1:20880/com.ai.cloud.skywalking.plugin.sample.dubbox284.interfaces.IDubboxRestInterA.doBusiness(DubboxRestInterAParameter)", ""}}); + {"0", "rest://127.0.0.1:20880/com.ai.cloud.skywalking.plugin.test.dubbox284.interfaces.IDubboxRestInterA.doBusiness(DubboxRestInterAParameter)", ""}}); } } diff --git a/skywalking-collector/skywalking-sdk-plugin/dubbo-plugin/src/test/java/com/ai/cloud/skywalking/plugin/test/dubbox284/consumer/DubboxRestStart.java b/skywalking-collector/skywalking-sdk-plugin/dubbo-plugin/src/test/java/com/ai/cloud/skywalking/plugin/test/dubbox284/consumer/DubboxRestStart.java index b5ddf898c..2c384bc59 100644 --- a/skywalking-collector/skywalking-sdk-plugin/dubbo-plugin/src/test/java/com/ai/cloud/skywalking/plugin/test/dubbox284/consumer/DubboxRestStart.java +++ b/skywalking-collector/skywalking-sdk-plugin/dubbo-plugin/src/test/java/com/ai/cloud/skywalking/plugin/test/dubbox284/consumer/DubboxRestStart.java @@ -12,7 +12,7 @@ public class DubboxRestStart { @Test public void test() throws InvocationTargetException, NoSuchMethodException, ClassNotFoundException, IllegalAccessException { TracingBootstrap - .main(new String[]{"com.ai.cloud.skywalking.plugin.sample.dubbox284.consumer.DubboxRestStart"}); + .main(new String[]{"com.ai.cloud.skywalking.plugin.test.dubbox284.consumer.DubboxRestStart"}); } public static void main(String[] args) throws InterruptedException { diff --git a/skywalking-collector/skywalking-sdk-plugin/jdbc-plugin/src/main/java/com/ai/cloud/skywalking/plugin/jdbc/JDBCPluginDefine.java b/skywalking-collector/skywalking-sdk-plugin/jdbc-plugin/src/main/java/com/ai/cloud/skywalking/plugin/jdbc/JDBCPluginDefine.java index 585ff63f7..93e5b6c8c 100644 --- a/skywalking-collector/skywalking-sdk-plugin/jdbc-plugin/src/main/java/com/ai/cloud/skywalking/plugin/jdbc/JDBCPluginDefine.java +++ b/skywalking-collector/skywalking-sdk-plugin/jdbc-plugin/src/main/java/com/ai/cloud/skywalking/plugin/jdbc/JDBCPluginDefine.java @@ -15,7 +15,7 @@ public class JDBCPluginDefine extends BootPluginDefine { private static Logger logger = LogManager.getLogger(JDBCPluginDefine.class); @Override - protected byte[] boot() throws BootException { + protected void boot() throws BootException { try { Class classes = Class.forName("java.sql.DriverInfo"); Object traceDriverInfo = newDriverInfoInstance(classes); @@ -31,8 +31,6 @@ public class JDBCPluginDefine extends BootPluginDefine { e); TracingDriver.registerDriver(); } - - return null; } private Object newDriverInfoInstance(Class classes) throws NoSuchMethodException, InstantiationException, IllegalAccessException, java.lang.reflect.InvocationTargetException { diff --git a/skywalking-collector/skywalking-sdk-plugin/jdbc-plugin/src/test/java/test/ai/cloud/skywalking/plugin/drivermanger/TestMyDriver.java b/skywalking-collector/skywalking-sdk-plugin/jdbc-plugin/src/test/java/test/ai/cloud/skywalking/plugin/drivermanger/TestMyDriver.java index 2cd9fb7f5..aa00c7168 100644 --- a/skywalking-collector/skywalking-sdk-plugin/jdbc-plugin/src/test/java/test/ai/cloud/skywalking/plugin/drivermanger/TestMyDriver.java +++ b/skywalking-collector/skywalking-sdk-plugin/jdbc-plugin/src/test/java/test/ai/cloud/skywalking/plugin/drivermanger/TestMyDriver.java @@ -10,7 +10,7 @@ import java.sql.SQLException; */ public class TestMyDriver { public static void main(String[] args) throws ClassNotFoundException, SQLException { - Class.forName("sample.ai.cloud.skywalking.plugin.drivermanger.MyDriver"); + Class.forName("test.ai.cloud.skywalking.plugin.drivermanger.MyDriver"); String url = "jdbc:oracle:thin:@10.1.130.239:1521:ora"; Connection con = DriverManager.getConnection(url, "edc_export", "edc_export"); con.setAutoCommit(false); diff --git a/skywalking-collector/skywalking-sdk-plugin/jdbc-plugin/src/test/java/test/ai/cloud/skywalking/plugin/h2/H2JDBCTest.java b/skywalking-collector/skywalking-sdk-plugin/jdbc-plugin/src/test/java/test/ai/cloud/skywalking/plugin/h2/H2JDBCTest.java index cdd679f24..3d208f312 100644 --- a/skywalking-collector/skywalking-sdk-plugin/jdbc-plugin/src/test/java/test/ai/cloud/skywalking/plugin/h2/H2JDBCTest.java +++ b/skywalking-collector/skywalking-sdk-plugin/jdbc-plugin/src/test/java/test/ai/cloud/skywalking/plugin/h2/H2JDBCTest.java @@ -18,7 +18,7 @@ public class H2JDBCTest { public static void main(String[] args) throws ClassNotFoundException, SQLException, InterruptedException { Class.forName("org.h2.Driver"); - String url = "jdbc:h2:" + H2JDBCTest.class.getResource("/") + "sample.db"; + String url = "jdbc:h2:" + H2JDBCTest.class.getResource("/") + "test.db"; Connection con = DriverManager.getConnection(url); con.setAutoCommit(false); @@ -28,9 +28,9 @@ public class H2JDBCTest { con.commit(); con.close(); RequestSpanAssert.assertEquals( - new String[][]{{"0", "jdbc:h2:" +H2JDBCTest.class.getResource("/") + "sample.db" + "(null)", "preaparedStatement.executeUpdate:select 1 from dual where 1=?"}, - {"0", "jdbc:h2:" +H2JDBCTest.class.getResource("/") + "sample.db" + "(null)", "connection.commit"}, - {"0", "jdbc:h2:" +H2JDBCTest.class.getResource("/") + "sample.db" + "(null)", "connection.close"},}, true); + new String[][]{{"0", "jdbc:h2:" +H2JDBCTest.class.getResource("/") + "test.db" + "(null)", "preaparedStatement.executeUpdate:select 1 from dual where 1=?"}, + {"0", "jdbc:h2:" +H2JDBCTest.class.getResource("/") + "test.db" + "(null)", "connection.commit"}, + {"0", "jdbc:h2:" +H2JDBCTest.class.getResource("/") + "test.db" + "(null)", "connection.close"},}, true); } } diff --git a/skywalking-collector/skywalking-sdk-plugin/jdbc-plugin/src/test/java/test/ai/cloud/skywalking/plugin/mysql/MysqlJDBCTest.java b/skywalking-collector/skywalking-sdk-plugin/jdbc-plugin/src/test/java/test/ai/cloud/skywalking/plugin/mysql/MysqlJDBCTest.java index f82b22e05..d93214333 100644 --- a/skywalking-collector/skywalking-sdk-plugin/jdbc-plugin/src/test/java/test/ai/cloud/skywalking/plugin/mysql/MysqlJDBCTest.java +++ b/skywalking-collector/skywalking-sdk-plugin/jdbc-plugin/src/test/java/test/ai/cloud/skywalking/plugin/mysql/MysqlJDBCTest.java @@ -14,12 +14,12 @@ public class MysqlJDBCTest { @Test public void testMySqlJDBC() throws InvocationTargetException, NoSuchMethodException, ClassNotFoundException, IllegalAccessException { - TracingBootstrap.main(new String[] {"sample.ai.cloud.skywalking.plugin.mysql.MysqlJDBCTest"}); + TracingBootstrap.main(new String[] {"test.ai.cloud.skywalking.plugin.mysql.MysqlJDBCTest"}); } public static void main(String[] args) throws ClassNotFoundException, SQLException, InterruptedException { Class.forName("com.mysql.jdbc.Driver"); - String url = "tracing:jdbc:mysql://127.0.0.1:3306/sample?user=root&password=root"; + String url = "tracing:jdbc:mysql://127.0.0.1:3306/test?user=root&password=root"; Connection con = DriverManager.getConnection(url); con.setAutoCommit(false); @@ -29,9 +29,9 @@ public class MysqlJDBCTest { con.commit(); con.close(); RequestSpanAssert.assertEquals( - new String[][] {{"0", "jdbc:mysql://127.0.0.1:3306/sample?user=root&password=root(null)", "preaparedStatement.executeUpdate:select 1 from dual where 1=?"}, - {"0", "jdbc:mysql://127.0.0.1:3306/sample?user=root&password=root(null)", "connection.commit"}, - {"0", "jdbc:mysql://127.0.0.1:3306/sample?user=root&password=root(null)", "connection.close"},}, true); + new String[][] {{"0", "jdbc:mysql://127.0.0.1:3306/test?user=root&password=root(null)", "preaparedStatement.executeUpdate:select 1 from dual where 1=?"}, + {"0", "jdbc:mysql://127.0.0.1:3306/test?user=root&password=root(null)", "connection.commit"}, + {"0", "jdbc:mysql://127.0.0.1:3306/test?user=root&password=root(null)", "connection.close"},}, true); } diff --git a/skywalking-collector/skywalking-sdk-plugin/jdbc-plugin/src/test/java/test/ai/cloud/skywalking/plugin/oracle/OracleJDBCTest.java b/skywalking-collector/skywalking-sdk-plugin/jdbc-plugin/src/test/java/test/ai/cloud/skywalking/plugin/oracle/OracleJDBCTest.java index 874495cb7..fa0bf6b86 100644 --- a/skywalking-collector/skywalking-sdk-plugin/jdbc-plugin/src/test/java/test/ai/cloud/skywalking/plugin/oracle/OracleJDBCTest.java +++ b/skywalking-collector/skywalking-sdk-plugin/jdbc-plugin/src/test/java/test/ai/cloud/skywalking/plugin/oracle/OracleJDBCTest.java @@ -20,7 +20,7 @@ public class OracleJDBCTest { NoSuchMethodException, ClassNotFoundException, IllegalAccessException { TracingBootstrap - .main(new String[]{"sample.ai.cloud.skywalking.plugin.oracle.OracleJDBCTest"}); + .main(new String[]{"test.ai.cloud.skywalking.plugin.oracle.OracleJDBCTest"}); } public static void main(String[] args) throws ClassNotFoundException, diff --git a/skywalking-collector/skywalking-sdk-plugin/spring-plugin/pom.xml b/skywalking-collector/skywalking-sdk-plugin/spring-plugin/pom.xml index 62bd3545e..4999ab091 100644 --- a/skywalking-collector/skywalking-sdk-plugin/spring-plugin/pom.xml +++ b/skywalking-collector/skywalking-sdk-plugin/spring-plugin/pom.xml @@ -52,7 +52,7 @@ com.ai.cloud skywalking-auth ${project.version} - sample + test
--> diff --git a/skywalking-collector/skywalking-sdk-plugin/tomcat-7.x-8.x-plugin/target/maven-archiver/pom.properties b/skywalking-collector/skywalking-sdk-plugin/tomcat-7.x-8.x-plugin/target/maven-archiver/pom.properties deleted file mode 100644 index 35499f84c..000000000 --- a/skywalking-collector/skywalking-sdk-plugin/tomcat-7.x-8.x-plugin/target/maven-archiver/pom.properties +++ /dev/null @@ -1,5 +0,0 @@ -#Generated by Maven -#Mon Jul 25 22:41:11 CST 2016 -version=1.0-Final -groupId=com.ai.cloud -artifactId=tomcat-7.x-8.x-plugin diff --git a/skywalking-collector/skywalking-sdk-plugin/tomcat-7.x-8.x-plugin/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/skywalking-collector/skywalking-sdk-plugin/tomcat-7.x-8.x-plugin/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst deleted file mode 100644 index 1f4e0fe40..000000000 --- a/skywalking-collector/skywalking-sdk-plugin/tomcat-7.x-8.x-plugin/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst +++ /dev/null @@ -1,3 +0,0 @@ -com/ai/cloud/skywalking/plugin/tomcat78x/TomcatPluginInterceptor.class -com/ai/cloud/skywalking/plugin/tomcat78x/WebBuriedPointType.class -com/ai/cloud/skywalking/plugin/tomcat78x/define/TomcatPluginDefine.class diff --git a/skywalking-collector/skywalking-sdk-plugin/tomcat-7.x-8.x-plugin/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/skywalking-collector/skywalking-sdk-plugin/tomcat-7.x-8.x-plugin/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst deleted file mode 100644 index 4ad1c6fd9..000000000 --- a/skywalking-collector/skywalking-sdk-plugin/tomcat-7.x-8.x-plugin/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst +++ /dev/null @@ -1,3 +0,0 @@ -/Users/xin/workbench/sky-walking/skywalking-collector/skywalking-sdk-plugin/tomcat-7.x-8.x-plugin/src/main/java/com/ai/cloud/skywalking/plugin/tomcat78x/TomcatPluginInterceptor.java -/Users/xin/workbench/sky-walking/skywalking-collector/skywalking-sdk-plugin/tomcat-7.x-8.x-plugin/src/main/java/com/ai/cloud/skywalking/plugin/tomcat78x/define/TomcatPluginDefine.java -/Users/xin/workbench/sky-walking/skywalking-collector/skywalking-sdk-plugin/tomcat-7.x-8.x-plugin/src/main/java/com/ai/cloud/skywalking/plugin/tomcat78x/WebBuriedPointType.java diff --git a/skywalking-collector/skywalking-sdk-plugin/web-plugin/pom.xml b/skywalking-collector/skywalking-sdk-plugin/web-plugin/pom.xml index 4a265deff..c1a414900 100644 --- a/skywalking-collector/skywalking-sdk-plugin/web-plugin/pom.xml +++ b/skywalking-collector/skywalking-sdk-plugin/web-plugin/pom.xml @@ -28,7 +28,7 @@ com.ai.cloud skywalking-auth ${project.version} - sample + test -->