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 @@
rocketMQ-client-java-5.x-pluginactivemq-artemis-jakarta-client-2.x-pluginc3p0-0.9.x-plugin
+ solon-2.x-pluginpom
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 @@
+
+
+
+
+ 4.0.0
+
+ apm-sdk-plugin
+ org.apache.skywalking
+ 9.3.0-SNAPSHOT
+
+
+ solon-2.x-plugin
+ jar
+
+ solon-2.x-plugin
+ http://maven.apache.org
+
+
+ UTF-8
+ 4.3
+ 4.12
+
+
+
+
+ org.noear
+ solon-lib
+ 2.8.3
+ provided
+
+
+
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 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 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 `,` | SW_PLUGIN_NETTY_HTTP_SUPPORTED_CONTENT_TYPES_PREFIX | `application/json,text/` |
| `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. | SW_PLUGIN_SOLON_HTTP_PARAMS_LENGTH_THRESHOLD | `0` |
+| `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. | SW_PLUGIN_SOLON_INCLUDE_HTTP_HEADERS | ``(No header would be collected) |
+| `plugin.solon.http_body_length_threshold` | Define the max length of collected HTTP body. The default value(=0) means not collecting. | SW_PLUGIN_SOLON_HTTP_BODY_LENGTH_THRESHOLD | `0` |
+
# 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 @@
+
+
+
+ 4.0.0
+
+ org.apache.skywalking
+ solon-2.x-scenario
+ jar
+ 5.0.0
+
+ skywalking-solon-2.x-scenario
+
+
+ UTF-8
+ 2.8.3
+ ${test.solon.version}
+
+
+
+
+ org.noear
+ solon-api
+ ${test.solon.version}
+
+
+ cn.hutool
+ hutool-http
+ 5.8.25
+
+
+ com.h2database
+ h2
+ 1.4.200
+
+
+
+
+ solon-2.x-scenario
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.6.0
+
+ 1.8
+ 1.8
+ ${project.build.sourceEncoding}
+
+
+
+ org.noear
+ solon-maven-plugin
+ 2.8.3
+ test.apache.skywalking.apm.testcase.sc.solon.App
+
+
+
+ package
+
+ repackage
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-assembly-plugin
+
+
+ assemble
+ package
+
+ single
+
+
+
+ src/main/assembly/assembly.xml
+
+ ./target/
+
+
+
+
+
+
+
+
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 @@
+
+
+
+
+ zip
+
+
+
+
+ ./bin
+ 0775
+
+
+ ${project.build.directory}
+ ./libs
+
+ solon-2.x-scenario.jar
+
+ 0775
+
+
+
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