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 0fc3cd86e8 Add a plugin that supports the Solon framework. (#697)
0fc3cd86e8 is described below

commit 0fc3cd86e8c2261bedb417f971e319e5d582e4af
Author: 寻找的人 <1312544...@qq.com>
AuthorDate: Sat Jun 29 09:44:23 2024 +0800

    Add a plugin that supports the Solon framework. (#697)
---
 .github/workflows/plugins-test.3.yaml              |   1 +
 CHANGES.md                                         |   2 +
 .../network/trace/component/ComponentsDefine.java  |   1 +
 apm-sniffer/apm-sdk-plugin/pom.xml                 |   1 +
 .../apm-sdk-plugin/solon-2.x-plugin/pom.xml        |  48 ++++++++++
 .../solon/SolonActionExecuteInterceptor.java       | 104 ++++++++++++++++++++
 .../apm/plugin/solon/SolonPluginConfig.java        |  43 +++++++++
 .../solon/define/SolonActionInstrumentation.java   |  66 +++++++++++++
 .../src/main/resources/skywalking-plugin.def       |  17 ++++
 apm-sniffer/config/agent.config                    |   6 ++
 .../setup/service-agent/java-agent/Plugin-list.md  |   1 +
 .../service-agent/java-agent/Supported-list.md     |   1 +
 .../service-agent/java-agent/configurations.md     |   5 +-
 .../scenarios/solon-2.x-scenario/bin/startup.sh    |  21 +++++
 .../solon-2.x-scenario/config/expectedData.yaml    |  99 +++++++++++++++++++
 .../scenarios/solon-2.x-scenario/configuration.yml |  20 ++++
 test/plugin/scenarios/solon-2.x-scenario/pom.xml   | 105 +++++++++++++++++++++
 .../src/main/assembly/assembly.xml                 |  41 ++++++++
 .../skywalking/apm/testcase/sc/solon/App.java      |  29 ++++++
 .../testcase/sc/solon/controller/Controller.java   |  55 +++++++++++
 .../apm/testcase/sc/solon/service/TestService.java |  43 +++++++++
 .../solon-2.x-scenario/src/main/resources/app.yml  |  18 ++++
 .../solon-2.x-scenario/support-version.list        |  18 ++++
 23 files changed, 744 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/plugins-test.3.yaml 
b/.github/workflows/plugins-test.3.yaml
index 264529fdd3..5960da690a 100644
--- a/.github/workflows/plugins-test.3.yaml
+++ b/.github/workflows/plugins-test.3.yaml
@@ -107,6 +107,7 @@ jobs:
           - grpc-generic-call-scenario
           - shenyu-2.4.x-grpc-scenario
           - shenyu-2.4.x-sofarpc-scenario
+          - solon-2.x-scenario
     steps:
       - uses: actions/checkout@v2
         with:
diff --git a/CHANGES.md b/CHANGES.md
index 54f7900e25..f80f1f151b 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -20,6 +20,8 @@ Release Notes.
 * Fixed the invalid issue in the isInterface method in PluginFinder.
 * Fix the opentracing toolkit SPI config
 * Improve 4x performance of ContextManagerExtendService.createTraceContext()
+* Add a plugin that supports the Solon framework.
+
 
 All issues and pull requests are 
[here](https://github.com/apache/skywalking/milestone/213?closed=1)
 
diff --git 
a/apm-protocol/apm-network/src/main/java/org/apache/skywalking/apm/network/trace/component/ComponentsDefine.java
 
b/apm-protocol/apm-network/src/main/java/org/apache/skywalking/apm/network/trace/component/ComponentsDefine.java
index b7307ebac7..101abcdb5e 100755
--- 
a/apm-protocol/apm-network/src/main/java/org/apache/skywalking/apm/network/trace/component/ComponentsDefine.java
+++ 
b/apm-protocol/apm-network/src/main/java/org/apache/skywalking/apm/network/trace/component/ComponentsDefine.java
@@ -257,5 +257,6 @@ public class ComponentsDefine {
 
     public static final OfficialComponent OCEANBASE_JDBC_DRIVER = new 
OfficialComponent(157, "OceanBase-jdbc-driver");
 
+    public static final OfficialComponent SOLON_MVC = new 
OfficialComponent(158, "SolonMVC");
 
 }
diff --git a/apm-sniffer/apm-sdk-plugin/pom.xml 
b/apm-sniffer/apm-sdk-plugin/pom.xml
index bce4312dfc..bc2aa1f68c 100644
--- a/apm-sniffer/apm-sdk-plugin/pom.xml
+++ b/apm-sniffer/apm-sdk-plugin/pom.xml
@@ -137,6 +137,7 @@
         <module>rocketMQ-client-java-5.x-plugin</module>
         <module>activemq-artemis-jakarta-client-2.x-plugin</module>
         <module>c3p0-0.9.x-plugin</module>
+        <module>solon-2.x-plugin</module>
     </modules>
     <packaging>pom</packaging>
 
diff --git a/apm-sniffer/apm-sdk-plugin/solon-2.x-plugin/pom.xml 
b/apm-sniffer/apm-sdk-plugin/solon-2.x-plugin/pom.xml
new file mode 100644
index 0000000000..ca4dc473d2
--- /dev/null
+++ b/apm-sniffer/apm-sdk-plugin/solon-2.x-plugin/pom.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0"?>
+<!--
+  ~ 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.
+  ~
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <artifactId>apm-sdk-plugin</artifactId>
+        <groupId>org.apache.skywalking</groupId>
+        <version>9.3.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>solon-2.x-plugin</artifactId>
+    <packaging>jar</packaging>
+
+    <name>solon-2.x-plugin</name>
+    <url>http://maven.apache.org</url>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <apache-httpclient.version>4.3</apache-httpclient.version>
+        <junit.version>4.12</junit.version>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.noear</groupId>
+            <artifactId>solon-lib</artifactId>
+            <version>2.8.3</version>
+            <scope>provided</scope>
+        </dependency>
+    </dependencies>
+</project>
diff --git 
a/apm-sniffer/apm-sdk-plugin/solon-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/solon/SolonActionExecuteInterceptor.java
 
b/apm-sniffer/apm-sdk-plugin/solon-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/solon/SolonActionExecuteInterceptor.java
new file mode 100644
index 0000000000..239e21cb80
--- /dev/null
+++ 
b/apm-sniffer/apm-sdk-plugin/solon-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/solon/SolonActionExecuteInterceptor.java
@@ -0,0 +1,104 @@
+/*
+ * 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.solon;
+
+import lombok.extern.slf4j.Slf4j;
+import org.apache.skywalking.apm.agent.core.context.CarrierItem;
+import org.apache.skywalking.apm.agent.core.context.ContextCarrier;
+import org.apache.skywalking.apm.agent.core.context.ContextManager;
+import org.apache.skywalking.apm.agent.core.context.tag.Tags;
+import org.apache.skywalking.apm.agent.core.context.trace.AbstractSpan;
+import org.apache.skywalking.apm.agent.core.context.trace.SpanLayer;
+import 
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
+import 
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.v2.InstanceMethodsAroundInterceptorV2;
+import 
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.v2.MethodInvocationContext;
+import org.apache.skywalking.apm.network.trace.component.ComponentsDefine;
+import org.apache.skywalking.apm.util.StringUtil;
+import org.noear.solon.core.NvMap;
+import org.noear.solon.core.handle.Context;
+
+import java.lang.reflect.Method;
+
+@Slf4j
+public class SolonActionExecuteInterceptor implements 
InstanceMethodsAroundInterceptorV2 {
+
+    @Override
+    public void beforeMethod(EnhancedInstance objInst, Method method, Object[] 
allArguments, Class<?>[] argumentsTypes, MethodInvocationContext context) 
throws Throwable {
+        Context ctx = (Context) allArguments[0];
+        ContextCarrier contextCarrier = new ContextCarrier();
+        CarrierItem next = contextCarrier.items();
+        while (next.hasNext()) {
+            next = next.next();
+            next.setHeadValue(ctx.header(next.getHeadKey()));
+        }
+        String operationName = ctx.method() + ":" + ctx.path();
+        AbstractSpan span = ContextManager.createEntrySpan(operationName, 
contextCarrier);
+        span.setComponent(ComponentsDefine.SOLON_MVC);
+        SpanLayer.asHttp(span);
+        Tags.URL.set(span, ctx.url());
+        Tags.HTTP.METHOD.set(span, ctx.method());
+        if (SolonPluginConfig.Plugin.Solon.INCLUDE_HTTP_HEADERS != null && 
!SolonPluginConfig.Plugin.Solon.INCLUDE_HTTP_HEADERS.isEmpty()) {
+            NvMap includeHeaders = new NvMap();
+            for (String header : 
SolonPluginConfig.Plugin.Solon.INCLUDE_HTTP_HEADERS) {
+                String value = ctx.header(header);
+                if (StringUtil.isNotBlank(value)) {
+                    includeHeaders.put(header, value);
+                }
+            }
+            Tags.HTTP.HEADERS.set(span, includeHeaders.toString());
+        }
+        if (SolonPluginConfig.Plugin.Solon.HTTP_BODY_LENGTH_THRESHOLD != 0) {
+            String body = ctx.body();
+            if (StringUtil.isNotBlank(body)) {
+                if (SolonPluginConfig.Plugin.Solon.HTTP_BODY_LENGTH_THRESHOLD 
> 0 && body.length() > 
SolonPluginConfig.Plugin.Solon.HTTP_BODY_LENGTH_THRESHOLD) {
+                    body = body.substring(0, 
SolonPluginConfig.Plugin.Solon.HTTP_BODY_LENGTH_THRESHOLD);
+                }
+                Tags.HTTP.BODY.set(span, body);
+            }
+        }
+        if (SolonPluginConfig.Plugin.Solon.HTTP_PARAMS_LENGTH_THRESHOLD != 0) {
+            String param = ctx.paramMap().toString();
+            if (SolonPluginConfig.Plugin.Solon.HTTP_PARAMS_LENGTH_THRESHOLD > 
0 && param.length() > 
SolonPluginConfig.Plugin.Solon.HTTP_PARAMS_LENGTH_THRESHOLD) {
+                param = param.substring(0, 
SolonPluginConfig.Plugin.Solon.HTTP_PARAMS_LENGTH_THRESHOLD);
+            }
+            Tags.HTTP.PARAMS.set(span, param);
+        }
+    }
+
+    @Override
+    public Object afterMethod(EnhancedInstance objInst, Method method, 
Object[] allArguments, Class<?>[] argumentsTypes, Object ret, 
MethodInvocationContext context) {
+        Context ctx = (Context) allArguments[0];
+        Tags.HTTP_RESPONSE_STATUS_CODE.set(ContextManager.activeSpan(), 
ctx.status());
+        if (ctx.errors != null && context.getContext() == null) {
+            AbstractSpan activeSpan = ContextManager.activeSpan();
+            activeSpan.errorOccurred();
+            activeSpan.log(ctx.errors);
+        }
+        ContextManager.stopSpan();
+        return ret;
+    }
+
+    @Override
+    public void handleMethodException(EnhancedInstance objInst, Method method, 
Object[] allArguments, Class<?>[] argumentsTypes, Throwable t, 
MethodInvocationContext context) {
+        AbstractSpan activeSpan = ContextManager.activeSpan();
+        activeSpan.errorOccurred();
+        activeSpan.log(t);
+        context.setContext(true);
+    }
+}
diff --git 
a/apm-sniffer/apm-sdk-plugin/solon-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/solon/SolonPluginConfig.java
 
b/apm-sniffer/apm-sdk-plugin/solon-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/solon/SolonPluginConfig.java
new file mode 100644
index 0000000000..63a3f3ba98
--- /dev/null
+++ 
b/apm-sniffer/apm-sdk-plugin/solon-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/solon/SolonPluginConfig.java
@@ -0,0 +1,43 @@
+/*
+ * 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.solon;
+
+import org.apache.skywalking.apm.agent.core.boot.PluginConfig;
+
+import java.util.List;
+
+public class SolonPluginConfig {
+    public static class Plugin {
+        @PluginConfig(root = SolonPluginConfig.class)
+        public static class Solon {
+            /**
+             * Define the max length of collected HTTP parameters. The default 
value(=0) means not collecting.
+             */
+            public static int HTTP_PARAMS_LENGTH_THRESHOLD = 0;
+            /**
+             * Define the max length of collected HTTP body. The default 
value(=0) means not collecting.
+             */
+            public static int HTTP_BODY_LENGTH_THRESHOLD = 0;
+            /**
+             * It controls what header data should be collected, values must 
be in lower case, if empty, no header data will be collected. default is empty.
+             */
+            public static List<String> INCLUDE_HTTP_HEADERS ;
+        }
+    }
+}
diff --git 
a/apm-sniffer/apm-sdk-plugin/solon-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/solon/define/SolonActionInstrumentation.java
 
b/apm-sniffer/apm-sdk-plugin/solon-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/solon/define/SolonActionInstrumentation.java
new file mode 100644
index 0000000000..d41d15ed45
--- /dev/null
+++ 
b/apm-sniffer/apm-sdk-plugin/solon-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/solon/define/SolonActionInstrumentation.java
@@ -0,0 +1,66 @@
+/*
+ * 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.solon.define;
+
+import net.bytebuddy.description.method.MethodDescription;
+import net.bytebuddy.matcher.ElementMatcher;
+import 
org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint;
+import 
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.v2.ClassInstanceMethodsEnhancePluginDefineV2;
+import 
org.apache.skywalking.apm.agent.core.plugin.interceptor.v2.InstanceMethodsInterceptV2Point;
+import org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch;
+import org.apache.skywalking.apm.agent.core.plugin.match.NameMatch;
+
+import static net.bytebuddy.matcher.ElementMatchers.named;
+
+public class SolonActionInstrumentation extends 
ClassInstanceMethodsEnhancePluginDefineV2 {
+
+    private static final String INTERCEPT_CLASS = 
"org.apache.skywalking.apm.plugin.solon.SolonActionExecuteInterceptor";
+
+    @Override
+    public ClassMatch enhanceClass() {
+        return NameMatch.byName("org.noear.solon.SolonApp");
+    }
+
+    @Override
+    public ConstructorInterceptPoint[] getConstructorsInterceptPoints() {
+        return new ConstructorInterceptPoint[0];
+    }
+
+    @Override
+    public InstanceMethodsInterceptV2Point[] 
getInstanceMethodsInterceptV2Points() {
+        return new InstanceMethodsInterceptV2Point[] {
+                new InstanceMethodsInterceptV2Point() {
+                    @Override
+                    public ElementMatcher<MethodDescription> 
getMethodsMatcher() {
+                        return named("tryHandle");
+                    }
+
+                    @Override
+                    public String getMethodsInterceptorV2() {
+                        return INTERCEPT_CLASS;
+                    }
+
+                    @Override
+                    public boolean isOverrideArgs() {
+                        return true;
+                    }
+                }
+        };
+    }
+}
diff --git 
a/apm-sniffer/apm-sdk-plugin/solon-2.x-plugin/src/main/resources/skywalking-plugin.def
 
b/apm-sniffer/apm-sdk-plugin/solon-2.x-plugin/src/main/resources/skywalking-plugin.def
new file mode 100644
index 0000000000..01e6af6f77
--- /dev/null
+++ 
b/apm-sniffer/apm-sdk-plugin/solon-2.x-plugin/src/main/resources/skywalking-plugin.def
@@ -0,0 +1,17 @@
+# 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.
+
+solon-2.x=org.apache.skywalking.apm.plugin.solon.define.SolonActionInstrumentation
\ No newline at end of file
diff --git a/apm-sniffer/config/agent.config b/apm-sniffer/config/agent.config
index 65b95a6fbd..06f5717de0 100755
--- a/apm-sniffer/config/agent.config
+++ b/apm-sniffer/config/agent.config
@@ -320,3 +320,9 @@ 
plugin.nettyhttp.supported_content_types_prefix=${SW_PLUGIN_NETTYHTTP_SUPPORTED_
 
plugin.rocketmqclient.collect_message_keys=${SW_PLUGIN_ROCKETMQCLIENT_COLLECT_MESSAGE_KEYS:false}
 # If set to true, the tags of messages would be collected by the plugin for 
RocketMQ Java client.
 
plugin.rocketmqclient.collect_message_tags=${SW_PLUGIN_ROCKETMQCLIENT_COLLECT_MESSAGE_TAGS:false}
+# Define the max length of collected HTTP parameters. The default value(=0) 
means not collecting.
+plugin.solon.http_params_length_threshold=${SW_PLUGIN_SOLON_HTTP_PARAMS_LENGTH_THRESHOLD:0}
+# It controls what header data should be collected, values must be in lower 
case, if empty, no header data will be collected. default is empty.
+plugin.solon.include_http_headers=${SW_PLUGIN_SOLON_INCLUDE_HTTP_HEADERS:}
+# Define the max length of collected HTTP body. The default value(=0) means 
not collecting.
+plugin.solon.http_body_length_threshold=${SW_PLUGIN_SOLON_HTTP_BODY_LENGTH_THRESHOLD:0}
diff --git a/docs/en/setup/service-agent/java-agent/Plugin-list.md 
b/docs/en/setup/service-agent/java-agent/Plugin-list.md
index d8c4d160bb..e15b3b1f00 100644
--- a/docs/en/setup/service-agent/java-agent/Plugin-list.md
+++ b/docs/en/setup/service-agent/java-agent/Plugin-list.md
@@ -177,3 +177,4 @@
 - spring-webflux-6.x-webclient
 - activemq-artemis-jakarta-client-2.x
 - c3p0-0.9.x
+- solon-2.x
\ No newline at end of file
diff --git a/docs/en/setup/service-agent/java-agent/Supported-list.md 
b/docs/en/setup/service-agent/java-agent/Supported-list.md
index 99bd79d37d..c91c25d4a2 100644
--- a/docs/en/setup/service-agent/java-agent/Supported-list.md
+++ b/docs/en/setup/service-agent/java-agent/Supported-list.md
@@ -26,6 +26,7 @@ metrics based on the tracing data.
   * [Grizzly](https://github.com/eclipse-ee4j/grizzly) 2.3.x -> 4.x
   * [WebSphere Liberty](https://github.com/OpenLiberty/open-liberty) 23.x
   * [Netty HTTP](https://github.com/netty/netty) 4.1.x (Optional²)
+  * [Solon](https://github.com/opensolon/solon) 2.7.x -> 2.8.x
 * HTTP Client
   * [Feign](https://github.com/OpenFeign/feign) 9.x
   * [Netflix Spring Cloud 
Feign](https://github.com/spring-cloud/spring-cloud-openfeign) 1.1.x -> 2.x
diff --git a/docs/en/setup/service-agent/java-agent/configurations.md 
b/docs/en/setup/service-agent/java-agent/configurations.md
index 4126407d18..83837d33b7 100644
--- a/docs/en/setup/service-agent/java-agent/configurations.md
+++ b/docs/en/setup/service-agent/java-agent/configurations.md
@@ -133,7 +133,10 @@ This is the properties list supported in 
`agent/config/agent.config`.
 | `plugin.nettyhttp.supported_content_types_prefix`                   | When 
`COLLECT_REQUEST_BODY` is enabled and content-type start with 
`HTTP_SUPPORTED_CONTENT_TYPES_PREFIX`, collect the body of the request , 
multiple paths should be separated by `,`                                       
                                                                                
                                                                                
                                         [...]
 | `plugin.rocketmqclient.collect_message_keys`                    | If set to 
true, the keys of messages would be collected by the plugin for RocketMQ Java 
client.
 | `plugin.rocketmqclient.collect_message_tags`                    | If set to 
true, the tags of messages would be collected by the plugin for RocketMQ Java 
client.
-|
+| `plugin.solon.http_params_length_threshold`                     | Define the 
max length of collected HTTP parameters. The default value(=0) means not 
collecting.                                                                     
                                                                                
                                                                                
                                                                                
                     [...]
+| `plugin.solon.include_http_headers`                             | It 
controls what header data should be collected, values must be in lower case, if 
empty, no header data will be collected. default is empty.                      
                                                                                
                                                                                
                                                                                
                      [...]
+| `plugin.solon.http_body_length_threshold`                       | Define the 
max length of collected HTTP body. The default value(=0) means not collecting.  
                                                                                
                                                                                
                                                                                
                                                                                
              [...]
+
 
 # Reset Collection/Map type configurations as empty collection.
 
diff --git a/test/plugin/scenarios/solon-2.x-scenario/bin/startup.sh 
b/test/plugin/scenarios/solon-2.x-scenario/bin/startup.sh
new file mode 100644
index 0000000000..6cfc6ad702
--- /dev/null
+++ b/test/plugin/scenarios/solon-2.x-scenario/bin/startup.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+#
+# 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.
+
+home="$(cd "$(dirname $0)"; pwd)"
+
+java -jar ${agent_opts} 
"-Dskywalking.plugin.solon.http_params_length_threshold=1024" 
"-Dskywalking.plugin.solon.include_http_headers=content_type,host" 
${home}/../libs/solon-2.x-scenario.jar &
\ No newline at end of file
diff --git a/test/plugin/scenarios/solon-2.x-scenario/config/expectedData.yaml 
b/test/plugin/scenarios/solon-2.x-scenario/config/expectedData.yaml
new file mode 100644
index 0000000000..bca5273af9
--- /dev/null
+++ b/test/plugin/scenarios/solon-2.x-scenario/config/expectedData.yaml
@@ -0,0 +1,99 @@
+# 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.
+
+segmentItems:
+  - serviceName: solon-2.x-scenario
+    segmentSize: ge 2
+    segments:
+      - segmentId: not null
+        spans:
+          - operationName: GET:/testcase/error
+            parentSpanId: -1
+            spanId: 0
+            spanLayer: Http
+            startTime: not null
+            endTime: not null
+            componentId: 158
+            isError: true
+            spanType: Entry
+            peer: ''
+            skipAnalysis: false
+            tags:
+              - {key: url, value: not null}
+              - {key: http.method, value: GET}
+              - {key: http.headers, value: not null}
+              - {key: http.params, value: not null}
+              - {key: http.status_code, value: '500'}
+            logs:
+              - logEvent:
+                  - {key: event, value: error}
+                  - {key: error.kind, value: java.lang.RuntimeException}
+                  - {key: message, value: this is Error}
+                  - {key: stack, value: not null}
+            refs:
+              - {parentEndpoint: 'GET:/testcase/test', networkAddress: 
'localhost:8082',
+                 refType: CrossProcess, parentSpanId: 2, parentTraceSegmentId: 
not null,
+                 parentServiceInstance: not null, parentService: 
solon-2.x-scenario,
+                 traceId: not null}
+      - segmentId: not null
+        spans:
+          - operationName: H2/JDBC/PreparedStatement/executeQuery
+            parentSpanId: 0
+            spanId: 1
+            spanLayer: Database
+            startTime: not null
+            endTime: not null
+            componentId: 32
+            isError: false
+            spanType: Exit
+            peer: localhost:-1
+            skipAnalysis: false
+            tags:
+              - {key: db.type, value: H2}
+              - {key: db.instance, value: test}
+              - {key: db.statement, value: SELECT 1 = 1}
+          - operationName: /testcase/error
+            parentSpanId: 0
+            spanId: 2
+            spanLayer: Http
+            startTime: not null
+            endTime: not null
+            componentId: 128
+            isError: true
+            spanType: Exit
+            peer: localhost:8082
+            skipAnalysis: false
+            tags:
+              - {key: http.method, value: GET}
+              - {key: url, value: 'http://localhost:8082/testcase/error'}
+              - {key: http.status_code, value: '500'}
+          - operationName: GET:/testcase/test
+            parentSpanId: -1
+            spanId: 0
+            spanLayer: Http
+            startTime: not null
+            endTime: not null
+            componentId: 158
+            isError: false
+            spanType: Entry
+            peer: ''
+            skipAnalysis: false
+            tags:
+              - {key: url, value: 'http://localhost:8082/testcase/test'}
+              - {key: http.method, value: GET}
+              - {key: http.headers, value: not null}
+              - {key: http.params, value: '{}'}
+              - {key: http.status_code, value: '200'}
diff --git a/test/plugin/scenarios/solon-2.x-scenario/configuration.yml 
b/test/plugin/scenarios/solon-2.x-scenario/configuration.yml
new file mode 100644
index 0000000000..33cd22a0dc
--- /dev/null
+++ b/test/plugin/scenarios/solon-2.x-scenario/configuration.yml
@@ -0,0 +1,20 @@
+# 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.
+
+type: jvm
+entryService: http://localhost:8082/testcase/test
+healthCheck: http://localhost:8082/testcase/healthCheck
+startScript: ./bin/startup.sh
diff --git a/test/plugin/scenarios/solon-2.x-scenario/pom.xml 
b/test/plugin/scenarios/solon-2.x-scenario/pom.xml
new file mode 100644
index 0000000000..3b850fff6b
--- /dev/null
+++ b/test/plugin/scenarios/solon-2.x-scenario/pom.xml
@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  ~
+  -->
+<project xmlns="http://maven.apache.org/POM/4.0.0";
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>org.apache.skywalking</groupId>
+    <artifactId>solon-2.x-scenario</artifactId>
+    <packaging>jar</packaging>
+    <version>5.0.0</version>
+
+    <name>skywalking-solon-2.x-scenario</name>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <test.solon.version>2.8.3</test.solon.version>
+        <docker.image.version>${test.solon.version}</docker.image.version>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.noear</groupId>
+            <artifactId>solon-api</artifactId>
+            <version>${test.solon.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>cn.hutool</groupId>
+            <artifactId>hutool-http</artifactId>
+            <version>5.8.25</version>
+        </dependency>
+        <dependency>
+            <groupId>com.h2database</groupId>
+            <artifactId>h2</artifactId>
+            <version>1.4.200</version>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <finalName>solon-2.x-scenario</finalName>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>3.6.0</version>
+                <configuration>
+                    <source>1.8</source>
+                    <target>1.8</target>
+                    <encoding>${project.build.sourceEncoding}</encoding>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.noear</groupId>
+                <artifactId>solon-maven-plugin</artifactId>
+                <version>2.8.3</version>
+                <configuration> 
<mainClass>test.apache.skywalking.apm.testcase.sc.solon.App</mainClass>
+                </configuration>
+                <executions>
+                    <execution>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>repackage</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-assembly-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>assemble</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>single</goal>
+                        </goals>
+                        <configuration>
+                            <descriptors>
+                                
<descriptor>src/main/assembly/assembly.xml</descriptor>
+                            </descriptors>
+                            <outputDirectory>./target/</outputDirectory>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>
diff --git 
a/test/plugin/scenarios/solon-2.x-scenario/src/main/assembly/assembly.xml 
b/test/plugin/scenarios/solon-2.x-scenario/src/main/assembly/assembly.xml
new file mode 100644
index 0000000000..c408decc9d
--- /dev/null
+++ b/test/plugin/scenarios/solon-2.x-scenario/src/main/assembly/assembly.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  ~
+  -->
+<assembly
+    
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2";
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+    
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2
 http://maven.apache.org/xsd/assembly-1.1.2.xsd";>
+    <formats>
+        <format>zip</format>
+    </formats>
+
+    <fileSets>
+        <fileSet>
+            <directory>./bin</directory>
+            <fileMode>0775</fileMode>
+        </fileSet>
+        <fileSet>
+            <directory>${project.build.directory}</directory>
+            <outputDirectory>./libs</outputDirectory>
+            <includes>
+                <include>solon-2.x-scenario.jar</include>
+            </includes>
+            <fileMode>0775</fileMode>
+        </fileSet>
+    </fileSets>
+</assembly>
diff --git 
a/test/plugin/scenarios/solon-2.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/sc/solon/App.java
 
b/test/plugin/scenarios/solon-2.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/sc/solon/App.java
new file mode 100644
index 0000000000..dafe2bf504
--- /dev/null
+++ 
b/test/plugin/scenarios/solon-2.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/sc/solon/App.java
@@ -0,0 +1,29 @@
+/*
+ *  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 test.apache.skywalking.apm.testcase.sc.solon;
+
+import org.noear.solon.Solon;
+import org.noear.solon.annotation.SolonMain;
+
+@SolonMain
+public class App {
+
+    public static void main(String[] args) {
+        Solon.start(App.class, args);
+    }
+}
diff --git 
a/test/plugin/scenarios/solon-2.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/sc/solon/controller/Controller.java
 
b/test/plugin/scenarios/solon-2.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/sc/solon/controller/Controller.java
new file mode 100644
index 0000000000..dece4c9615
--- /dev/null
+++ 
b/test/plugin/scenarios/solon-2.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/sc/solon/controller/Controller.java
@@ -0,0 +1,55 @@
+/*
+ *  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 test.apache.skywalking.apm.testcase.sc.solon.controller;
+
+import cn.hutool.http.HttpRequest;
+import org.noear.solon.annotation.Body;
+import org.noear.solon.annotation.Get;
+import org.noear.solon.annotation.Inject;
+import org.noear.solon.annotation.Mapping;
+import org.noear.solon.annotation.Path;
+import test.apache.skywalking.apm.testcase.sc.solon.service.TestService;
+
+import java.sql.SQLException;
+
+@org.noear.solon.annotation.Controller
+public class Controller {
+
+    @Inject
+    private TestService testService;
+
+    @Mapping("/testcase/healthCheck")
+    public String healthCheck() {
+        return "healthCheck";
+    }
+
+    @Get
+    @Mapping("/testcase/{test}")
+    public String hello(@Body String body, @Path("test") String test) throws 
SQLException {
+        testService.executeSQL();
+        String body1 = 
HttpRequest.get("http://localhost:8082/testcase/error";).execute().body();
+        return "Hello World";
+    }
+
+    @Get
+    @Mapping("/testcase/error")
+    public String error() {
+        throw new RuntimeException("this is Error");
+    }
+
+}
diff --git 
a/test/plugin/scenarios/solon-2.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/sc/solon/service/TestService.java
 
b/test/plugin/scenarios/solon-2.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/sc/solon/service/TestService.java
new file mode 100644
index 0000000000..ed05be7667
--- /dev/null
+++ 
b/test/plugin/scenarios/solon-2.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/sc/solon/service/TestService.java
@@ -0,0 +1,43 @@
+/*
+ *  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 test.apache.skywalking.apm.testcase.sc.solon.service;
+
+import org.noear.solon.annotation.Component;
+import org.noear.solon.annotation.Init;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.SQLException;
+
+@Component
+public class TestService {
+
+    private Connection connection;
+
+    @Init
+    private void setUp() throws SQLException {
+        connection = 
DriverManager.getConnection("jdbc:h2:mem:test;DB_CLOSE_DELAY=-1", "sa", "");
+    }
+
+    public void executeSQL() throws SQLException {
+        PreparedStatement preparedStatement = 
connection.prepareStatement("SELECT 1 = 1");
+        preparedStatement.executeQuery();
+    }
+
+}
diff --git 
a/test/plugin/scenarios/solon-2.x-scenario/src/main/resources/app.yml 
b/test/plugin/scenarios/solon-2.x-scenario/src/main/resources/app.yml
new file mode 100644
index 0000000000..86f1a8ddc0
--- /dev/null
+++ b/test/plugin/scenarios/solon-2.x-scenario/src/main/resources/app.yml
@@ -0,0 +1,18 @@
+#
+# 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.
+#
+
+server.port: 8082
\ No newline at end of file
diff --git a/test/plugin/scenarios/solon-2.x-scenario/support-version.list 
b/test/plugin/scenarios/solon-2.x-scenario/support-version.list
new file mode 100644
index 0000000000..7e5c2fd224
--- /dev/null
+++ b/test/plugin/scenarios/solon-2.x-scenario/support-version.list
@@ -0,0 +1,18 @@
+# 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.
+
+2.7.2
+2.8.3
\ No newline at end of file


Reply via email to