You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2019/03/10 15:41:45 UTC

[GitHub] [incubator-skywalking] wu-sheng commented on a change in pull request #2300: [WIP]Customize Enhance code of plugin

wu-sheng commented on a change in pull request #2300: [WIP]Customize Enhance code of plugin
URL: https://github.com/apache/incubator-skywalking/pull/2300#discussion_r264045026
 
 

 ##########
 File path: docs/en/setup/service-agent/java-agent/customize-enhance-trace.md
 ##########
 @@ -0,0 +1,59 @@
+## Support custom enhance 
+Here is an optional plugin `apm-customize-enhance-plugin`
+
+## Introduce
+- The purpose of this plugin is to achieve Class enhancements to some extent through non-intrusive forms.
+- The core idea is that there is no intrusion, so that no code related to this project appears in the project code.
+- Implemented a custom enhancement of the custom languages, it looks more like [@Trace](Application-toolkit-trace.md) non-intrusive implementation,
+internal tag records need to be used, ActiveSpan.tag to achieve, of course, it is to support static methods, 
+you can use the custom languages to extend the operationName suffix, already log, and tag extension.                                                                                                      
+
+## How to configure
+Implementing enhancements to custom classes requires two steps.
+ 1. Set through the system environment variable, you need to add `skywalking.customize.enhance_file`.
+ 2. Configure your configuration file according to the demo below.
+```xml
+<?xml version="1.0" encoding="UTF-8"?>
+<enhanced>
+    <class class_name="test.apache.skywalking.testcase.customize.service.TestService1">
+        <method method="staticMethod()" operation_name="/is_static_method" static="true"></method>
+        <method method="staticMethod(java.lang.String,int.class,java.util.Map,java.util.List,[Ljava.lang.Object;)" operation_name="/is_static_method_args" static="true">
+            <operation_name_suffix>arg[0]</operation_name_suffix>
+            <operation_name_suffix>arg[1]</operation_name_suffix>
+            <operation_name_suffix>arg[3].[0]</operation_name_suffix>
+            <tag key="tag_1">arg[2].['k1']</tag>
 
 Review comment:
   Look like get k1 from a hashmap field.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services