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 6eeacf095 Add an agent plugin to support hutool-http (#264)
6eeacf095 is described below
commit 6eeacf0959cf3837a63acb1b674291182d90bbc7
Author: geekymv <[email protected]>
AuthorDate: Thu Jun 30 09:31:59 2022 +0800
Add an agent plugin to support hutool-http (#264)
---
.github/workflows/plugins-test.1.yaml | 1 +
CHANGES.md | 3 +-
.../network/trace/component/ComponentsDefine.java | 2 +
.../hutool-plugins/hutool-http-5.x-plugin/pom.xml | 47 ++++++++
.../http/v5/HutoolHttpExecuteInterceptor.java | 102 +++++++++++++++++
.../http/v5/define/HutoolHttpInstrumentation.java | 69 ++++++++++++
.../src/main/resources/skywalking-plugin.def | 17 +++
apm-sniffer/apm-sdk-plugin/hutool-plugins/pom.xml | 41 +++++++
apm-sniffer/apm-sdk-plugin/pom.xml | 1 +
.../setup/service-agent/java-agent/Plugin-list.md | 1 +
.../service-agent/java-agent/Supported-list.md | 1 +
.../hutool-http-5.x-scenario/bin/startup.sh | 21 ++++
.../config/expectedData.yaml | 70 ++++++++++++
.../hutool-http-5.x-scenario/configuration.yml | 20 ++++
.../scenarios/hutool-http-5.x-scenario/pom.xml | 124 +++++++++++++++++++++
.../src/main/assembly/assembly.xml | 41 +++++++
.../apm/testcase/hutoolhttp5/Application.java | 34 ++++++
.../hutoolhttp5/controller/CaseController.java | 55 +++++++++
.../src/main/resources/application.yaml | 23 ++++
.../src/main/resources/log4j2.xml | 30 +++++
.../hutool-http-5.x-scenario/support-version.list | 26 +++++
21 files changed, 728 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/plugins-test.1.yaml
b/.github/workflows/plugins-test.1.yaml
index ad17e7fef..8d66dc99c 100644
--- a/.github/workflows/plugins-test.1.yaml
+++ b/.github/workflows/plugins-test.1.yaml
@@ -60,6 +60,7 @@ jobs:
- httpclient-3.x-scenario
- httpclient-4.3.x-scenario
- httpclient-5.x-scenario
+ - hutool-http-5.x-scenario
- hystrix-scenario
- sentinel-scenario
- influxdb-scenario
diff --git a/CHANGES.md b/CHANGES.md
index 628c5c7ef..bcd50eeb0 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -7,7 +7,8 @@ Release Notes.
* Fix `Shenyu plugin`'s NPE in reading read trace ID when IgnoredTracerContext
is used in the context.
* Update witness class in elasticsearch-6.x-plugin, avoid throw NPE.
* Fix `onHalfClose` using span operation name `/Request/onComplete` instead of
the worng name `/Request/onHalfClose`.
-* Add plugin to support for RESTeasy 4.x.
+* Add plugin to support RESTeasy 4.x.
+* Add plugin to support hutool-http 5.x.
#### Documentation
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 e9af24846..c3671ff69 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
@@ -222,4 +222,6 @@ public class ComponentsDefine {
public static final OfficialComponent GUAVA_EVENT_BUS = new
OfficialComponent(123, "GuavaEventBus");
public static final OfficialComponent APACHE_SHENYU = new
OfficialComponent(127, "Apache-ShenYu");
+
+ public static final OfficialComponent HUTOOL = new OfficialComponent(128,
"Hutool");
}
diff --git
a/apm-sniffer/apm-sdk-plugin/hutool-plugins/hutool-http-5.x-plugin/pom.xml
b/apm-sniffer/apm-sdk-plugin/hutool-plugins/hutool-http-5.x-plugin/pom.xml
new file mode 100644
index 000000000..65d907dab
--- /dev/null
+++ b/apm-sniffer/apm-sdk-plugin/hutool-plugins/hutool-http-5.x-plugin/pom.xml
@@ -0,0 +1,47 @@
+<?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">
+ <parent>
+ <artifactId>hutool-plugins</artifactId>
+ <groupId>org.apache.skywalking</groupId>
+ <version>8.12.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>apm-hutool-http-5.x-plugin</artifactId>
+ <packaging>jar</packaging>
+
+ <url>http://maven.apache.org</url>
+ <properties>
+ <hutool.http.version>5.8.3</hutool.http.version>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>cn.hutool</groupId>
+ <artifactId>hutool-http</artifactId>
+ <version>${hutool.http.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+
+</project>
diff --git
a/apm-sniffer/apm-sdk-plugin/hutool-plugins/hutool-http-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/hutool/http/v5/HutoolHttpExecuteInterceptor.java
b/apm-sniffer/apm-sdk-plugin/hutool-plugins/hutool-http-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/hutool/http/v5/HutoolHttpExecuteInterceptor.java
new file mode 100644
index 000000000..1d3389f31
--- /dev/null
+++
b/apm-sniffer/apm-sdk-plugin/hutool-plugins/hutool-http-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/hutool/http/v5/HutoolHttpExecuteInterceptor.java
@@ -0,0 +1,102 @@
+/*
+ * 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.hutool.http.v5;
+
+import cn.hutool.core.util.URLUtil;
+import cn.hutool.http.HttpRequest;
+import cn.hutool.http.HttpResponse;
+import java.lang.reflect.Method;
+import java.net.URL;
+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.InstanceMethodsAroundInterceptor;
+import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult;
+import org.apache.skywalking.apm.network.trace.component.ComponentsDefine;
+
+public class HutoolHttpExecuteInterceptor implements
InstanceMethodsAroundInterceptor {
+
+ @Override
+ public void beforeMethod(final EnhancedInstance objInst,
+ final Method method,
+ final Object[] allArguments,
+ final Class<?>[] argumentsTypes,
+ final MethodInterceptResult result) throws
Throwable {
+
+ final HttpRequest request = (HttpRequest) objInst;
+ final ContextCarrier contextCarrier = new ContextCarrier();
+ final URL url = URLUtil.url(request.getUrl());
+
+ String remotePeer = getPeer(url);
+ String formatURIPath = url.getPath();
+ AbstractSpan span = ContextManager.createExitSpan(formatURIPath,
contextCarrier, remotePeer);
+
+ span.setComponent(ComponentsDefine.HUTOOL);
+ Tags.HTTP.METHOD.set(span, request.getMethod().name());
+ Tags.URL.set(span, url.toString());
+ SpanLayer.asHttp(span);
+
+ CarrierItem next = contextCarrier.items();
+ while (next.hasNext()) {
+ next = next.next();
+ request.header(next.getHeadKey(), next.getHeadValue());
+ }
+ }
+
+ @Override
+ public Object afterMethod(final EnhancedInstance objInst,
+ final Method method,
+ final Object[] allArguments,
+ final Class<?>[] argumentsTypes,
+ final Object ret) throws Throwable {
+ if (ret != null) {
+ HttpResponse response = (HttpResponse) ret;
+ int statusCode = response.getStatus();
+
+ AbstractSpan span = ContextManager.activeSpan();
+ Tags.HTTP_RESPONSE_STATUS_CODE.set(span, statusCode);
+ if (statusCode >= 400) {
+ span.errorOccurred();
+ }
+ }
+ ContextManager.stopSpan();
+ return ret;
+ }
+
+ @Override
+ public void handleMethodException(final EnhancedInstance objInst,
+ final Method method,
+ final Object[] allArguments,
+ final Class<?>[] argumentsTypes,
+ final Throwable t) {
+ ContextManager.activeSpan().log(t);
+ }
+
+ private String getPeer(URL url) {
+ String host = url.getHost();
+ if (url.getPort() > 0) {
+ return host + ":" + url.getPort();
+ }
+ return host;
+ }
+}
diff --git
a/apm-sniffer/apm-sdk-plugin/hutool-plugins/hutool-http-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/hutool/http/v5/define/HutoolHttpInstrumentation.java
b/apm-sniffer/apm-sdk-plugin/hutool-plugins/hutool-http-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/hutool/http/v5/define/HutoolHttpInstrumentation.java
new file mode 100644
index 000000000..4cc8a7623
--- /dev/null
+++
b/apm-sniffer/apm-sdk-plugin/hutool-plugins/hutool-http-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/hutool/http/v5/define/HutoolHttpInstrumentation.java
@@ -0,0 +1,69 @@
+/*
+ * 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.hutool.http.v5.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.InstanceMethodsInterceptPoint;
+import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine;
+import org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch;
+
+import static net.bytebuddy.matcher.ElementMatchers.named;
+import static net.bytebuddy.matcher.ElementMatchers.takesArguments;
+import static
org.apache.skywalking.apm.agent.core.plugin.match.NameMatch.byName;
+
+public class HutoolHttpInstrumentation extends
ClassInstanceMethodsEnhancePluginDefine {
+
+ private static final String ENHANCE_CLASS = "cn.hutool.http.HttpRequest";
+
+ private static final String EXECUTE_INTERCEPT_CLASS =
"org.apache.skywalking.apm.plugin.hutool.http.v5.HutoolHttpExecuteInterceptor";
+
+ @Override
+ protected ClassMatch enhanceClass() {
+ return byName(ENHANCE_CLASS);
+ }
+
+ @Override
+ public ConstructorInterceptPoint[] getConstructorsInterceptPoints() {
+ return null;
+ }
+
+ @Override
+ public InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints()
{
+ return new InstanceMethodsInterceptPoint[] {
+ new InstanceMethodsInterceptPoint() {
+ @Override
+ public ElementMatcher<MethodDescription> getMethodsMatcher() {
+ return named("execute").and(takesArguments(1));
+ }
+
+ @Override
+ public String getMethodsInterceptor() {
+ return EXECUTE_INTERCEPT_CLASS;
+ }
+
+ @Override
+ public boolean isOverrideArgs() {
+ return false;
+ }
+ }
+ };
+ }
+}
diff --git
a/apm-sniffer/apm-sdk-plugin/hutool-plugins/hutool-http-5.x-plugin/src/main/resources/skywalking-plugin.def
b/apm-sniffer/apm-sdk-plugin/hutool-plugins/hutool-http-5.x-plugin/src/main/resources/skywalking-plugin.def
new file mode 100644
index 000000000..dbf9f6ef2
--- /dev/null
+++
b/apm-sniffer/apm-sdk-plugin/hutool-plugins/hutool-http-5.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.
+
+hutool-http-5.x=org.apache.skywalking.apm.plugin.hutool.http.v5.define.HutoolHttpInstrumentation
diff --git a/apm-sniffer/apm-sdk-plugin/hutool-plugins/pom.xml
b/apm-sniffer/apm-sdk-plugin/hutool-plugins/pom.xml
new file mode 100644
index 000000000..35d113936
--- /dev/null
+++ b/apm-sniffer/apm-sdk-plugin/hutool-plugins/pom.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.
+ ~
+ -->
+<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">
+ <parent>
+ <artifactId>apm-sdk-plugin</artifactId>
+ <groupId>org.apache.skywalking</groupId>
+ <version>8.12.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>hutool-plugins</artifactId>
+ <packaging>pom</packaging>
+ <modules>
+ <module>hutool-http-5.x-plugin</module>
+ </modules>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <sdk.plugin.related.dir>/..</sdk.plugin.related.dir>
+ </properties>
+
+
+</project>
diff --git a/apm-sniffer/apm-sdk-plugin/pom.xml
b/apm-sniffer/apm-sdk-plugin/pom.xml
index 337eba602..ac5bd9735 100644
--- a/apm-sniffer/apm-sdk-plugin/pom.xml
+++ b/apm-sniffer/apm-sdk-plugin/pom.xml
@@ -120,6 +120,7 @@
<module>undertow-worker-thread-pool-plugin</module>
<module>tomcat-thread-pool-plugin</module>
<module>guava-eventbus-plugin</module>
+ <module>hutool-plugins</module>
</modules>
<packaging>pom</packaging>
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 7647f0a4d..7d7a40014 100644
--- a/docs/en/setup/service-agent/java-agent/Plugin-list.md
+++ b/docs/en/setup/service-agent/java-agent/Plugin-list.md
@@ -139,3 +139,4 @@
- guava-eventbus
- shenyu-2.4.x
- jdk-threadpool-plugin
+- hutool-http-5.x
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 f566b9ad7..c18d22be1 100644
--- a/docs/en/setup/service-agent/java-agent/Supported-list.md
+++ b/docs/en/setup/service-agent/java-agent/Supported-list.md
@@ -29,6 +29,7 @@ metrics based on the tracing data.
* [Apache httpcomponent
AsyncClient](https://hc.apache.org/httpcomponents-asyncclient-4.1.x/) 4.x
* [AsyncHttpClient](https://github.com/AsyncHttpClient/async-http-client)
2.1+
* JRE HttpURLConnection (Optional²)
+ * [Hutool-http](https://www.hutool.cn/) client 5.x
* HTTP Gateway
* [Spring Cloud Gateway](https://spring.io/projects/spring-cloud-gateway)
2.0.2.RELEASE -> 3.x (Optional²)
* [Apache ShenYu](https://shenyu.apache.org) (Rich protocol support:
`HTTP`,`Spring Cloud`,`gRPC`,`Dubbo`,`SOFARPC`,`Motan`,`Tars`) 2.4.x (Optional²)
diff --git a/test/plugin/scenarios/hutool-http-5.x-scenario/bin/startup.sh
b/test/plugin/scenarios/hutool-http-5.x-scenario/bin/startup.sh
new file mode 100644
index 000000000..eb615f20a
--- /dev/null
+++ b/test/plugin/scenarios/hutool-http-5.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} ${home}/../libs/hutool-http-5.x-scenario.jar &
\ No newline at end of file
diff --git
a/test/plugin/scenarios/hutool-http-5.x-scenario/config/expectedData.yaml
b/test/plugin/scenarios/hutool-http-5.x-scenario/config/expectedData.yaml
new file mode 100644
index 000000000..223b0b022
--- /dev/null
+++ b/test/plugin/scenarios/hutool-http-5.x-scenario/config/expectedData.yaml
@@ -0,0 +1,70 @@
+# 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: hutool-http-5.x-scenario
+ segmentSize: ge 2
+ segments:
+ - segmentId: not null
+ spans:
+ - operationName: GET:/hutool-http-5.x-scenario/case/hutool
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 1
+ isError: false
+ spanType: Entry
+ peer: ''
+ tags:
+ - {key: url, value:
'http://localhost:8080/hutool-http-5.x-scenario/case/hutool'}
+ - {key: http.method, value: GET}
+ refs:
+ - {parentEndpoint:
GET:/hutool-http-5.x-scenario/case/hutool-http-5.x-scenario, networkAddress:
'localhost:8080',
+ refType: CrossProcess, parentSpanId: 1, parentTraceSegmentId: not
null, parentServiceInstance: not
+ null, parentService: hutool-http-5.x-scenario, traceId: not null}
+ skipAnalysis: 'false'
+ - segmentId: not null
+ spans:
+ - operationName: /hutool-http-5.x-scenario/case/hutool
+ parentSpanId: 0
+ spanId: 1
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 128
+ isError: false
+ spanType: Exit
+ peer: localhost:8080
+ tags:
+ - {key: http.method, value: GET}
+ - {key: url, value:
'http://localhost:8080/hutool-http-5.x-scenario/case/hutool'}
+ - {key: http.status_code, value: '200'}
+ skipAnalysis: 'false'
+ - operationName:
GET:/hutool-http-5.x-scenario/case/hutool-http-5.x-scenario
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 1
+ isError: false
+ spanType: Entry
+ peer: ''
+ tags:
+ - {key: url, value:
'http://localhost:8080/hutool-http-5.x-scenario/case/hutool-http-5.x-scenario'}
+ - {key: http.method, value: GET}
+ skipAnalysis: 'false'
diff --git a/test/plugin/scenarios/hutool-http-5.x-scenario/configuration.yml
b/test/plugin/scenarios/hutool-http-5.x-scenario/configuration.yml
new file mode 100644
index 000000000..94378c544
--- /dev/null
+++ b/test/plugin/scenarios/hutool-http-5.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:8080/hutool-http-5.x-scenario/case/hutool-http-5.x-scenario
+healthCheck: http://localhost:8080/hutool-http-5.x-scenario/case/healthCheck
+startScript: ./bin/startup.sh
diff --git a/test/plugin/scenarios/hutool-http-5.x-scenario/pom.xml
b/test/plugin/scenarios/hutool-http-5.x-scenario/pom.xml
new file mode 100644
index 000000000..40567b6dd
--- /dev/null
+++ b/test/plugin/scenarios/hutool-http-5.x-scenario/pom.xml
@@ -0,0 +1,124 @@
+<?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">
+
+ <groupId>org.apache.skywalking.apm.testcase</groupId>
+ <artifactId>hutool-http-5.x-scenario</artifactId>
+ <version>1.0.0</version>
+ <packaging>jar</packaging>
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <compiler.version>1.8</compiler.version>
+ <test.framework.version>5.8.3</test.framework.version>
+ <spring.boot.version>2.1.6.RELEASE</spring.boot.version>
+ <lombok.version>1.18.20</lombok.version>
+ </properties>
+
+ <name>skywalking-hutool-http-5.x-scenario</name>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-dependencies</artifactId>
+ <version>${spring.boot.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-web</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-logging</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-log4j2</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.projectlombok</groupId>
+ <artifactId>lombok</artifactId>
+ <version>${lombok.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>cn.hutool</groupId>
+ <artifactId>hutool-http</artifactId>
+ <version>${test.framework.version}</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>hutool-http-5.x-scenario</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-maven-plugin</artifactId>
+ <version>${spring.boot.version}</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>repackage</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>${compiler.version}</source>
+ <target>${compiler.version}</target>
+ <encoding>${project.build.sourceEncoding}</encoding>
+ </configuration>
+ </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/hutool-http-5.x-scenario/src/main/assembly/assembly.xml
b/test/plugin/scenarios/hutool-http-5.x-scenario/src/main/assembly/assembly.xml
new file mode 100644
index 000000000..ff42c5945
--- /dev/null
+++
b/test/plugin/scenarios/hutool-http-5.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>
+ </fileSets>
+
+ <files>
+ <file>
+
<source>${project.build.directory}/hutool-http-5.x-scenario.jar</source>
+ <outputDirectory>./libs</outputDirectory>
+ <fileMode>0775</fileMode>
+ </file>
+ </files>
+</assembly>
diff --git
a/test/plugin/scenarios/hutool-http-5.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/hutoolhttp5/Application.java
b/test/plugin/scenarios/hutool-http-5.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/hutoolhttp5/Application.java
new file mode 100644
index 000000000..6e5bc956a
--- /dev/null
+++
b/test/plugin/scenarios/hutool-http-5.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/hutoolhttp5/Application.java
@@ -0,0 +1,34 @@
+/*
+ * 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.testcase.hutoolhttp5;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+public class Application {
+
+ public static void main(String[] args) {
+ try {
+ SpringApplication.run(Application.class, args);
+ } catch (Exception e) {
+ // Never do this
+ }
+ }
+}
diff --git
a/test/plugin/scenarios/hutool-http-5.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/hutoolhttp5/controller/CaseController.java
b/test/plugin/scenarios/hutool-http-5.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/hutoolhttp5/controller/CaseController.java
new file mode 100644
index 000000000..66d69a698
--- /dev/null
+++
b/test/plugin/scenarios/hutool-http-5.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/hutoolhttp5/controller/CaseController.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 org.apache.skywalking.apm.testcase.hutoolhttp5.controller;
+
+import cn.hutool.http.HttpUtil;
+import lombok.extern.log4j.Log4j2;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/case")
+@Log4j2
+public class CaseController {
+
+ private static final String SUCCESS = "Success";
+
+ @RequestMapping("/hutool-http-5.x-scenario")
+ @ResponseBody
+ public String testcase() {
+ // your codes
+ String result =
HttpUtil.get("http://localhost:8080/hutool-http-5.x-scenario/case/hutool");
+ return SUCCESS + ":" + result;
+ }
+
+ @RequestMapping("/hutool")
+ @ResponseBody
+ public String hutool() {
+ return "hutool";
+ }
+
+ @RequestMapping("/healthCheck")
+ @ResponseBody
+ public String healthCheck() {
+ // your codes
+ return SUCCESS;
+ }
+
+}
diff --git
a/test/plugin/scenarios/hutool-http-5.x-scenario/src/main/resources/application.yaml
b/test/plugin/scenarios/hutool-http-5.x-scenario/src/main/resources/application.yaml
new file mode 100644
index 000000000..bfbdee92c
--- /dev/null
+++
b/test/plugin/scenarios/hutool-http-5.x-scenario/src/main/resources/application.yaml
@@ -0,0 +1,23 @@
+#
+# 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: 8080
+ servlet:
+ context-path: /hutool-http-5.x-scenario
+logging:
+ config: classpath:log4j2.xml
\ No newline at end of file
diff --git
a/test/plugin/scenarios/hutool-http-5.x-scenario/src/main/resources/log4j2.xml
b/test/plugin/scenarios/hutool-http-5.x-scenario/src/main/resources/log4j2.xml
new file mode 100644
index 000000000..9849ed5a8
--- /dev/null
+++
b/test/plugin/scenarios/hutool-http-5.x-scenario/src/main/resources/log4j2.xml
@@ -0,0 +1,30 @@
+<?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.
+ ~
+ -->
+<Configuration status="WARN">
+ <Appenders>
+ <Console name="Console" target="SYSTEM_ERR">
+ <PatternLayout charset="UTF-8" pattern="[%d{yyyy-MM-dd
HH:mm:ss:SSS}] [%p] - %l - %m%n"/>
+ </Console>
+ </Appenders>
+ <Loggers>
+ <Root level="WARN">
+ <AppenderRef ref="Console"/>
+ </Root>
+ </Loggers>
+</Configuration>
\ No newline at end of file
diff --git
a/test/plugin/scenarios/hutool-http-5.x-scenario/support-version.list
b/test/plugin/scenarios/hutool-http-5.x-scenario/support-version.list
new file mode 100644
index 000000000..5e0927832
--- /dev/null
+++ b/test/plugin/scenarios/hutool-http-5.x-scenario/support-version.list
@@ -0,0 +1,26 @@
+# 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.
+
+# lists your version here (Contains only the last version number of each minor
version.)
+5.0.7
+5.1.5
+5.2.5
+5.3.10
+5.4.7
+5.5.9
+5.6.7
+5.7.22
+5.8.3