You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2021/09/14 01:31:30 UTC

[skywalking-java] branch main updated: Add thrift plugin support thrift TMultiplexedProcessor. (#22)

This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/skywalking-java.git


The following commit(s) were added to refs/heads/main by this push:
     new 0e45ed0  Add thrift plugin support thrift TMultiplexedProcessor. (#22)
0e45ed0 is described below

commit 0e45ed0b1379abd49863a8878d10903a3d5f76e9
Author: zifeihan <zi...@apache.org>
AuthorDate: Tue Sep 14 09:31:24 2021 +0800

    Add thrift plugin support thrift TMultiplexedProcessor. (#22)
---
 .github/PULL_REQUEST_TEMPLATE                      |   6 +-
 CHANGES.md                                         |   1 +
 .../plugin/thrift/TBaseProcessorInterceptor.java   |  14 ++-
 ....java => TMultiplexedProcessorInterceptor.java} |  16 ++-
 ...plexedProcessorRegisterDefaultInterceptor.java} |  44 ++++----
 ... TMultiplexedProcessorRegisterInterceptor.java} |  46 +++++----
 .../TMultiplexedProcessorInstrumentation.java      | 115 +++++++++++++++++++++
 .../src/main/resources/skywalking-plugin.def       |   1 +
 8 files changed, 191 insertions(+), 52 deletions(-)

diff --git a/.github/PULL_REQUEST_TEMPLATE b/.github/PULL_REQUEST_TEMPLATE
index 583367a..7e09707 100644
--- a/.github/PULL_REQUEST_TEMPLATE
+++ b/.github/PULL_REQUEST_TEMPLATE
@@ -13,14 +13,14 @@
 
 <!-- ==== 🔌 Remove this line WHEN AND ONLY WHEN you're adding a new plugin, follow the checklist 👇 ====
 ### Add an agent plugin to support <framework name>
-- [ ] Add a test case for the new plugin, refer to [the doc](https://github.com/apache/skywalking/blob/master/docs/en/guides/Plugin-test.md)
-- [ ] Add a component id in [the component-libraries.yml](https://github.com/apache/skywalking/blob/master/oap-server/server-bootstrap/src/main/resources/component-libraries.yml)
+- [ ] Add a test case for the new plugin, refer to [the doc](https://github.com/apache/skywalking-java/blob/main/docs/en/setup/service-agent/java-agent/Plugin-test.md)
+- [ ] Add a component id in [the component-libraries.yml](https://github.com/apache/skywalking/blob/master/oap-server/server-starter/src/main/resources/component-libraries.yml)
 - [ ] Add a logo in [the UI repo](https://github.com/apache/skywalking-rocketbot-ui/tree/master/src/views/components/topology/assets)
      ==== 🔌 Remove this line WHEN AND ONLY WHEN you're adding a new plugin, follow the checklist 👆 ==== -->
 
 <!-- ==== 📈 Remove this line WHEN AND ONLY WHEN you're improving the performance, follow the checklist 👇 ====
 ### Improve the performance of <class or module or ...>
-- [ ] Add a benchmark for the improvement, refer to [the existing ones](https://github.com/apache/skywalking/blob/master/apm-commons/apm-datacarrier/src/test/java/org/apache/skywalking/apm/commons/datacarrier/LinkedArrayBenchmark.java)
+- [ ] Add a benchmark for the improvement, refer to [the existing ones](https://github.com/apache/skywalking-java/blob/main/apm-commons/apm-datacarrier/src/test/java/org/apache/skywalking/apm/commons/datacarrier/LinkedArrayBenchmark.java)
 - [ ] The benchmark result.
 ```text
 <Paste the benchmark results here>
diff --git a/CHANGES.md b/CHANGES.md
index a393f32..0961d7b 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -17,6 +17,7 @@ Release Notes.
 * Support mTLS for gRPC channel.
 * fix the bug that plugin record wrong time elapse for lettuce plugin
 * fix the bug that the wrong db.instance value displayed on Skywalking-UI when existing multi-database-instance on same host port pair.
+* Add thrift plugin support thrift TMultiplexedProcessor.
 
 #### Documentation
 
diff --git a/apm-sniffer/apm-sdk-plugin/thrift-plugin/src/main/java/org/apache/skywalking/apm/plugin/thrift/TBaseProcessorInterceptor.java b/apm-sniffer/apm-sdk-plugin/thrift-plugin/src/main/java/org/apache/skywalking/apm/plugin/thrift/TBaseProcessorInterceptor.java
index 5f3ba80..83513e3 100644
--- a/apm-sniffer/apm-sdk-plugin/thrift-plugin/src/main/java/org/apache/skywalking/apm/plugin/thrift/TBaseProcessorInterceptor.java
+++ b/apm-sniffer/apm-sdk-plugin/thrift-plugin/src/main/java/org/apache/skywalking/apm/plugin/thrift/TBaseProcessorInterceptor.java
@@ -51,8 +51,10 @@ public class TBaseProcessorInterceptor implements InstanceConstructorInterceptor
                              Object[] allArguments,
                              Class<?>[] argumentsTypes,
                              MethodInterceptResult result) throws Throwable {
-        ServerInProtocolWrapper in = (ServerInProtocolWrapper) allArguments[0];
-        in.initial(new Context(processMap));
+        if (allArguments[0] instanceof ServerInProtocolWrapper) {
+            ServerInProtocolWrapper in = (ServerInProtocolWrapper) allArguments[0];
+            in.initial(new Context(processMap));
+        }
     }
 
     @Override
@@ -61,7 +63,9 @@ public class TBaseProcessorInterceptor implements InstanceConstructorInterceptor
                               Object[] allArguments,
                               Class<?>[] argumentsTypes,
                               Object ret) throws Throwable {
-        ContextManager.stopSpan();
+        if (allArguments[0] instanceof ServerInProtocolWrapper) {
+            ContextManager.stopSpan();
+        }
         return ret;
     }
 
@@ -71,6 +75,8 @@ public class TBaseProcessorInterceptor implements InstanceConstructorInterceptor
                                       Object[] allArguments,
                                       Class<?>[] argumentsTypes,
                                       Throwable t) {
-        ContextManager.activeSpan().log(t);
+        if (allArguments[0] instanceof ServerInProtocolWrapper) {
+            ContextManager.activeSpan().log(t);
+        }
     }
 }
diff --git a/apm-sniffer/apm-sdk-plugin/thrift-plugin/src/main/java/org/apache/skywalking/apm/plugin/thrift/TBaseProcessorInterceptor.java b/apm-sniffer/apm-sdk-plugin/thrift-plugin/src/main/java/org/apache/skywalking/apm/plugin/thrift/TMultiplexedProcessorInterceptor.java
similarity index 81%
copy from apm-sniffer/apm-sdk-plugin/thrift-plugin/src/main/java/org/apache/skywalking/apm/plugin/thrift/TBaseProcessorInterceptor.java
copy to apm-sniffer/apm-sdk-plugin/thrift-plugin/src/main/java/org/apache/skywalking/apm/plugin/thrift/TMultiplexedProcessorInterceptor.java
index 5f3ba80..953e4ae 100644
--- a/apm-sniffer/apm-sdk-plugin/thrift-plugin/src/main/java/org/apache/skywalking/apm/plugin/thrift/TBaseProcessorInterceptor.java
+++ b/apm-sniffer/apm-sdk-plugin/thrift-plugin/src/main/java/org/apache/skywalking/apm/plugin/thrift/TMultiplexedProcessorInterceptor.java
@@ -19,8 +19,11 @@
 package org.apache.skywalking.apm.plugin.thrift;
 
 import java.lang.reflect.Method;
+import java.util.HashMap;
 import java.util.Map;
 import org.apache.skywalking.apm.agent.core.context.ContextManager;
+import org.apache.skywalking.apm.agent.core.logging.api.ILog;
+import org.apache.skywalking.apm.agent.core.logging.api.LogManager;
 import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
 import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceConstructorInterceptor;
 import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
@@ -29,20 +32,22 @@ import org.apache.skywalking.apm.plugin.thrift.wrapper.Context;
 import org.apache.skywalking.apm.plugin.thrift.wrapper.ServerInProtocolWrapper;
 import org.apache.thrift.ProcessFunction;
 import org.apache.thrift.TBaseAsyncProcessor;
-import org.apache.thrift.TBaseProcessor;
 
 /**
  * To wrap the ProcessFunction for getting arguments of method.
  *
  * @see TBaseAsyncProcessor
  * @see TBaseProcessorInterceptor
+ * @see TMultiplexedProcessorInterceptor
  */
-public class TBaseProcessorInterceptor implements InstanceConstructorInterceptor, InstanceMethodsAroundInterceptor {
-    private Map<String, ProcessFunction> processMap;
+public class TMultiplexedProcessorInterceptor implements InstanceConstructorInterceptor, InstanceMethodsAroundInterceptor {
+    private Map<String, ProcessFunction> processMap = new HashMap<>();
+
+    private static final ILog LOGGER = LogManager.getLogger(TMultiplexedProcessorInterceptor.class);
 
     @Override
-    public void onConstruct(EnhancedInstance objInst, Object[] allArguments) {
-        processMap = ((TBaseProcessor) objInst).getProcessMapView();
+    public void onConstruct(final EnhancedInstance objInst, final Object[] allArguments) throws Throwable {
+        objInst.setSkyWalkingDynamicField(processMap);
     }
 
     @Override
@@ -51,6 +56,7 @@ public class TBaseProcessorInterceptor implements InstanceConstructorInterceptor
                              Object[] allArguments,
                              Class<?>[] argumentsTypes,
                              MethodInterceptResult result) throws Throwable {
+
         ServerInProtocolWrapper in = (ServerInProtocolWrapper) allArguments[0];
         in.initial(new Context(processMap));
     }
diff --git a/apm-sniffer/apm-sdk-plugin/thrift-plugin/src/main/java/org/apache/skywalking/apm/plugin/thrift/TBaseProcessorInterceptor.java b/apm-sniffer/apm-sdk-plugin/thrift-plugin/src/main/java/org/apache/skywalking/apm/plugin/thrift/TMultiplexedProcessorRegisterDefaultInterceptor.java
similarity index 62%
copy from apm-sniffer/apm-sdk-plugin/thrift-plugin/src/main/java/org/apache/skywalking/apm/plugin/thrift/TBaseProcessorInterceptor.java
copy to apm-sniffer/apm-sdk-plugin/thrift-plugin/src/main/java/org/apache/skywalking/apm/plugin/thrift/TMultiplexedProcessorRegisterDefaultInterceptor.java
index 5f3ba80..3b2e542 100644
--- a/apm-sniffer/apm-sdk-plugin/thrift-plugin/src/main/java/org/apache/skywalking/apm/plugin/thrift/TBaseProcessorInterceptor.java
+++ b/apm-sniffer/apm-sdk-plugin/thrift-plugin/src/main/java/org/apache/skywalking/apm/plugin/thrift/TMultiplexedProcessorRegisterDefaultInterceptor.java
@@ -19,31 +19,21 @@
 package org.apache.skywalking.apm.plugin.thrift;
 
 import java.lang.reflect.Method;
+import java.util.HashMap;
 import java.util.Map;
-import org.apache.skywalking.apm.agent.core.context.ContextManager;
+import org.apache.skywalking.apm.agent.core.logging.api.ILog;
+import org.apache.skywalking.apm.agent.core.logging.api.LogManager;
 import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
-import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceConstructorInterceptor;
 import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
 import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult;
-import org.apache.skywalking.apm.plugin.thrift.wrapper.Context;
-import org.apache.skywalking.apm.plugin.thrift.wrapper.ServerInProtocolWrapper;
 import org.apache.thrift.ProcessFunction;
 import org.apache.thrift.TBaseAsyncProcessor;
 import org.apache.thrift.TBaseProcessor;
+import org.apache.thrift.TProcessor;
 
-/**
- * To wrap the ProcessFunction for getting arguments of method.
- *
- * @see TBaseAsyncProcessor
- * @see TBaseProcessorInterceptor
- */
-public class TBaseProcessorInterceptor implements InstanceConstructorInterceptor, InstanceMethodsAroundInterceptor {
-    private Map<String, ProcessFunction> processMap;
+public class TMultiplexedProcessorRegisterDefaultInterceptor implements InstanceMethodsAroundInterceptor {
 
-    @Override
-    public void onConstruct(EnhancedInstance objInst, Object[] allArguments) {
-        processMap = ((TBaseProcessor) objInst).getProcessMapView();
-    }
+    private static final ILog LOGGER = LogManager.getLogger(TMultiplexedProcessorRegisterDefaultInterceptor.class);
 
     @Override
     public void beforeMethod(EnhancedInstance objInst,
@@ -51,8 +41,10 @@ public class TBaseProcessorInterceptor implements InstanceConstructorInterceptor
                              Object[] allArguments,
                              Class<?>[] argumentsTypes,
                              MethodInterceptResult result) throws Throwable {
-        ServerInProtocolWrapper in = (ServerInProtocolWrapper) allArguments[0];
-        in.initial(new Context(processMap));
+
+        Map<String, ProcessFunction> processMap = (Map<String, ProcessFunction>) objInst.getSkyWalkingDynamicField();
+        TProcessor processor = (TProcessor) allArguments[0];
+        processMap.putAll(getProcessMap(processor));
     }
 
     @Override
@@ -61,7 +53,6 @@ public class TBaseProcessorInterceptor implements InstanceConstructorInterceptor
                               Object[] allArguments,
                               Class<?>[] argumentsTypes,
                               Object ret) throws Throwable {
-        ContextManager.stopSpan();
         return ret;
     }
 
@@ -71,6 +62,19 @@ public class TBaseProcessorInterceptor implements InstanceConstructorInterceptor
                                       Object[] allArguments,
                                       Class<?>[] argumentsTypes,
                                       Throwable t) {
-        ContextManager.activeSpan().log(t);
+    }
+
+    private Map<String, ProcessFunction> getProcessMap(TProcessor processor) {
+        Map<String, ProcessFunction> hashMap = new HashMap<>();
+        if (processor instanceof TBaseProcessor) {
+            Map<String, ProcessFunction> processMapView = ((TBaseProcessor) processor).getProcessMapView();
+            hashMap.putAll(processMapView);
+        } else if (processor instanceof TBaseAsyncProcessor) {
+            Map<String, ProcessFunction> processMapView = ((TBaseProcessor) processor).getProcessMapView();
+            hashMap.putAll(processMapView);
+        } else {
+            LOGGER.warn("Not support this processor:{}", processor.getClass().getName());
+        }
+        return hashMap;
     }
 }
diff --git a/apm-sniffer/apm-sdk-plugin/thrift-plugin/src/main/java/org/apache/skywalking/apm/plugin/thrift/TBaseProcessorInterceptor.java b/apm-sniffer/apm-sdk-plugin/thrift-plugin/src/main/java/org/apache/skywalking/apm/plugin/thrift/TMultiplexedProcessorRegisterInterceptor.java
similarity index 58%
copy from apm-sniffer/apm-sdk-plugin/thrift-plugin/src/main/java/org/apache/skywalking/apm/plugin/thrift/TBaseProcessorInterceptor.java
copy to apm-sniffer/apm-sdk-plugin/thrift-plugin/src/main/java/org/apache/skywalking/apm/plugin/thrift/TMultiplexedProcessorRegisterInterceptor.java
index 5f3ba80..6750d7c 100644
--- a/apm-sniffer/apm-sdk-plugin/thrift-plugin/src/main/java/org/apache/skywalking/apm/plugin/thrift/TBaseProcessorInterceptor.java
+++ b/apm-sniffer/apm-sdk-plugin/thrift-plugin/src/main/java/org/apache/skywalking/apm/plugin/thrift/TMultiplexedProcessorRegisterInterceptor.java
@@ -19,31 +19,22 @@
 package org.apache.skywalking.apm.plugin.thrift;
 
 import java.lang.reflect.Method;
+import java.util.HashMap;
 import java.util.Map;
-import org.apache.skywalking.apm.agent.core.context.ContextManager;
+import org.apache.skywalking.apm.agent.core.logging.api.ILog;
+import org.apache.skywalking.apm.agent.core.logging.api.LogManager;
 import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
-import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceConstructorInterceptor;
 import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
 import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult;
-import org.apache.skywalking.apm.plugin.thrift.wrapper.Context;
-import org.apache.skywalking.apm.plugin.thrift.wrapper.ServerInProtocolWrapper;
 import org.apache.thrift.ProcessFunction;
 import org.apache.thrift.TBaseAsyncProcessor;
 import org.apache.thrift.TBaseProcessor;
+import org.apache.thrift.TProcessor;
+import org.apache.thrift.protocol.TMultiplexedProtocol;
 
-/**
- * To wrap the ProcessFunction for getting arguments of method.
- *
- * @see TBaseAsyncProcessor
- * @see TBaseProcessorInterceptor
- */
-public class TBaseProcessorInterceptor implements InstanceConstructorInterceptor, InstanceMethodsAroundInterceptor {
-    private Map<String, ProcessFunction> processMap;
+public class TMultiplexedProcessorRegisterInterceptor implements InstanceMethodsAroundInterceptor {
 
-    @Override
-    public void onConstruct(EnhancedInstance objInst, Object[] allArguments) {
-        processMap = ((TBaseProcessor) objInst).getProcessMapView();
-    }
+    private static final ILog LOGGER = LogManager.getLogger(TMultiplexedProcessorRegisterInterceptor.class);
 
     @Override
     public void beforeMethod(EnhancedInstance objInst,
@@ -51,8 +42,11 @@ public class TBaseProcessorInterceptor implements InstanceConstructorInterceptor
                              Object[] allArguments,
                              Class<?>[] argumentsTypes,
                              MethodInterceptResult result) throws Throwable {
-        ServerInProtocolWrapper in = (ServerInProtocolWrapper) allArguments[0];
-        in.initial(new Context(processMap));
+
+        Map<String, ProcessFunction> processMap = (Map<String, ProcessFunction>) objInst.getSkyWalkingDynamicField();
+        String serviceName = (String) allArguments[0];
+        TProcessor processor = (TProcessor) allArguments[1];
+        processMap.putAll(getProcessMap(serviceName, processor));
     }
 
     @Override
@@ -61,7 +55,6 @@ public class TBaseProcessorInterceptor implements InstanceConstructorInterceptor
                               Object[] allArguments,
                               Class<?>[] argumentsTypes,
                               Object ret) throws Throwable {
-        ContextManager.stopSpan();
         return ret;
     }
 
@@ -71,6 +64,19 @@ public class TBaseProcessorInterceptor implements InstanceConstructorInterceptor
                                       Object[] allArguments,
                                       Class<?>[] argumentsTypes,
                                       Throwable t) {
-        ContextManager.activeSpan().log(t);
+    }
+
+    private Map<String, ProcessFunction> getProcessMap(String serviceName, TProcessor processor) {
+        Map<String, ProcessFunction> hashMap = new HashMap<>();
+        if (processor instanceof TBaseProcessor) {
+            Map<String, ProcessFunction> processMapView = ((TBaseProcessor) processor).getProcessMapView();
+            processMapView.forEach((k, v) -> hashMap.put(serviceName + TMultiplexedProtocol.SEPARATOR + k, v));
+        } else if (processor instanceof TBaseAsyncProcessor) {
+            Map<String, ProcessFunction> processMapView = ((TBaseAsyncProcessor) processor).getProcessMapView();
+            processMapView.forEach((k, v) -> hashMap.put(serviceName + TMultiplexedProtocol.SEPARATOR + k, v));
+        } else {
+            LOGGER.warn("Not support this processor:{}", processor.getClass().getName());
+        }
+        return hashMap;
     }
 }
diff --git a/apm-sniffer/apm-sdk-plugin/thrift-plugin/src/main/java/org/apache/skywalking/apm/plugin/thrift/define/TMultiplexedProcessorInstrumentation.java b/apm-sniffer/apm-sdk-plugin/thrift-plugin/src/main/java/org/apache/skywalking/apm/plugin/thrift/define/TMultiplexedProcessorInstrumentation.java
new file mode 100644
index 0000000..8109761
--- /dev/null
+++ b/apm-sniffer/apm-sdk-plugin/thrift-plugin/src/main/java/org/apache/skywalking/apm/plugin/thrift/define/TMultiplexedProcessorInstrumentation.java
@@ -0,0 +1,115 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.plugin.thrift.define;
+
+import net.bytebuddy.description.method.MethodDescription;
+import net.bytebuddy.matcher.ElementMatcher;
+import net.bytebuddy.matcher.ElementMatchers;
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint;
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint;
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine;
+import org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch;
+import org.apache.skywalking.apm.agent.core.plugin.match.NameMatch;
+
+public class TMultiplexedProcessorInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
+    private static final String ENHANCE_CLASS = "org.apache.thrift.TMultiplexedProcessor";
+    private static final String INTERCEPTOR_CLASS = "org.apache.skywalking.apm.plugin.thrift.TMultiplexedProcessorInterceptor";
+    private static final String REGISTER_PROCESSOR_INTERCEPTOR_CLASS = "org.apache.skywalking.apm.plugin.thrift.TMultiplexedProcessorRegisterInterceptor";
+    private static final String REGISTER_DEFAULT_INTERCEPTOR_CLASS = "org.apache.skywalking.apm.plugin.thrift.TMultiplexedProcessorRegisterDefaultInterceptor";
+
+    @Override
+    public ConstructorInterceptPoint[] getConstructorsInterceptPoints() {
+        return new ConstructorInterceptPoint[] {
+            new ConstructorInterceptPoint() {
+                @Override
+                public ElementMatcher<MethodDescription> getConstructorMatcher() {
+                    return ElementMatchers.any();
+                }
+
+                @Override
+                public String getConstructorInterceptor() {
+                    return INTERCEPTOR_CLASS;
+                }
+            }
+        };
+    }
+
+    @Override
+    public InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints() {
+        return new InstanceMethodsInterceptPoint[] {
+            new InstanceMethodsInterceptPoint() {
+
+                @Override
+                public ElementMatcher<MethodDescription> getMethodsMatcher() {
+                    return ElementMatchers.named("process").and(ElementMatchers.takesArguments(2));
+                }
+
+                @Override
+                public String getMethodsInterceptor() {
+                    return INTERCEPTOR_CLASS;
+                }
+
+                @Override
+                public boolean isOverrideArgs() {
+                    return false;
+                }
+            },
+            new InstanceMethodsInterceptPoint() {
+
+                @Override
+                public ElementMatcher<MethodDescription> getMethodsMatcher() {
+                    return ElementMatchers.named("registerProcessor").and(ElementMatchers.takesArguments(2));
+                }
+
+                @Override
+                public String getMethodsInterceptor() {
+                    return REGISTER_PROCESSOR_INTERCEPTOR_CLASS;
+                }
+
+                @Override
+                public boolean isOverrideArgs() {
+                    return false;
+                }
+            },
+            new InstanceMethodsInterceptPoint() {
+
+                @Override
+                public ElementMatcher<MethodDescription> getMethodsMatcher() {
+                    return ElementMatchers.named("registerDefault");
+                }
+
+                @Override
+                public String getMethodsInterceptor() {
+                    return REGISTER_DEFAULT_INTERCEPTOR_CLASS;
+                }
+
+                @Override
+                public boolean isOverrideArgs() {
+                    return false;
+                }
+            }
+        };
+    }
+
+    @Override
+    protected ClassMatch enhanceClass() {
+        return NameMatch.byName(ENHANCE_CLASS);
+    }
+
+}
diff --git a/apm-sniffer/apm-sdk-plugin/thrift-plugin/src/main/resources/skywalking-plugin.def b/apm-sniffer/apm-sdk-plugin/thrift-plugin/src/main/resources/skywalking-plugin.def
index efc0123..8693c56 100644
--- a/apm-sniffer/apm-sdk-plugin/thrift-plugin/src/main/resources/skywalking-plugin.def
+++ b/apm-sniffer/apm-sdk-plugin/thrift-plugin/src/main/resources/skywalking-plugin.def
@@ -20,4 +20,5 @@ thrift=org.apache.skywalking.apm.plugin.thrift.define.client.TAsyncMethodCallIns
 thrift=org.apache.skywalking.apm.plugin.thrift.define.client.TServiceClientInstrumentation
 thrift=org.apache.skywalking.apm.plugin.thrift.define.TBaseProcessorInstrumentation
 thrift=org.apache.skywalking.apm.plugin.thrift.define.TBaseAsyncProcessorInstrumentation
+thrift=org.apache.skywalking.apm.plugin.thrift.define.TMultiplexedProcessorInstrumentation
 thrift=org.apache.skywalking.apm.plugin.thrift.define.transport.TSocketInstrumentation