Support Spymemcached V2.0
This commit is contained in:
parent
1b6a332468
commit
22deca0484
|
|
@ -1,35 +1,35 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<artifactId>apm-sdk-plugin</artifactId>
|
||||
<version>3.2.2-2017</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>apm-spymemcached-2.x-plugin</artifactId>
|
||||
<name>spymemcached-2.x-plugin</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<artifactId>apm-sdk-plugin</artifactId>
|
||||
<version>3.2.3-2017</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<spymemcached.version>2.11.1</spymemcached.version>
|
||||
</properties>
|
||||
<artifactId>apm-spymemcached-2.x-plugin</artifactId>
|
||||
<name>spymemcached-2.x-plugin</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>net.spy</groupId>
|
||||
<artifactId>spymemcached</artifactId>
|
||||
<version>${spymemcached.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-core</artifactId>
|
||||
<version>2.4.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<spymemcached.version>2.11.1</spymemcached.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>net.spy</groupId>
|
||||
<artifactId>spymemcached</artifactId>
|
||||
<version>${spymemcached.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-core</artifactId>
|
||||
<version>2.4.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
@ -18,15 +18,12 @@ public class MemcachedMethodInterceptor implements InstanceMethodsAroundIntercep
|
|||
@Override
|
||||
public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments,
|
||||
Class<?>[] argumentsTypes, MethodInterceptResult result) throws Throwable {
|
||||
Object[] arguments = allArguments;
|
||||
String peer = String.valueOf(objInst.getSkyWalkingDynamicField());
|
||||
AbstractSpan span = ContextManager.createExitSpan(SPY_MEMCACHE + method.getName(), peer);
|
||||
span.setComponent(ComponentsDefine.MEMCACHE);
|
||||
Tags.DB_TYPE.set(span, ComponentsDefine.MEMCACHE.getName());
|
||||
SpanLayer.asDB(span);
|
||||
if (allArguments.length > 0 && arguments[0] instanceof String) {
|
||||
Tags.DB_STATEMENT.set(span, method.getName() + " " + arguments[0]);
|
||||
}
|
||||
Tags.DB_STATEMENT.set(span, method.getName() + " " + allArguments[0]);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
|
|||
* {@link XMemcachedConstructorWithInetSocketAddressListArgInterceptor} intercepts the constructor with
|
||||
* argument {@link java.net.InetSocketAddress}.
|
||||
*
|
||||
*@author IluckySi
|
||||
* @author IluckySi
|
||||
*
|
||||
*/
|
||||
public class MemcachedInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
|
||||
|
|
|
|||
Loading…
Reference in New Issue