diff --git a/.github/workflows/plugins-jdk11-test.3.yaml b/.github/workflows/plugins-jdk11-test.3.yaml
index a1f90fff14..0e1fe2f74b 100644
--- a/.github/workflows/plugins-jdk11-test.3.yaml
+++ b/.github/workflows/plugins-jdk11-test.3.yaml
@@ -55,6 +55,7 @@ jobs:
matrix:
case:
- jdk11-forkjoinpool-scenario
+ - jdk-httpclient-scenario
steps:
- uses: actions/checkout@v2
with:
diff --git a/CHANGES.md b/CHANGES.md
index bd24e54cd1..76d64c9840 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -18,6 +18,7 @@ Release Notes.
* Fix ClassLoader cache OOM issue with WeakHashMap.
* Fix Jetty client cannot receive the HTTP response body.
* Eliminate repeated code with HttpServletRequestWrapper in mvc-annotation-commons.
+* Add the jdk httpclient plugin.
All issues and pull requests are [here](https://github.com/apache/skywalking/milestone/242?closed=1)
diff --git a/apm-sniffer/bootstrap-plugins/jdk-httpclient-plugin/pom.xml b/apm-sniffer/bootstrap-plugins/jdk-httpclient-plugin/pom.xml
new file mode 100644
index 0000000000..88a0f72a99
--- /dev/null
+++ b/apm-sniffer/bootstrap-plugins/jdk-httpclient-plugin/pom.xml
@@ -0,0 +1,46 @@
+
+
+
+
+ bootstrap-plugins
+ org.apache.skywalking
+ 9.6.0-SNAPSHOT
+
+ 4.0.0
+
+ apm-jdk-httpclient-plugin
+ jar
+
+ apm-jdk-httpclient-plugin
+ http://maven.apache.org
+
+
+ UTF-8
+ 11
+
+
+
+
+
+ maven-deploy-plugin
+
+
+
+
+
\ No newline at end of file
diff --git a/apm-sniffer/bootstrap-plugins/jdk-httpclient-plugin/src/main/java/org/apache/skywalking/apm/plugin/HttpClientSendAsyncInterceptor.java b/apm-sniffer/bootstrap-plugins/jdk-httpclient-plugin/src/main/java/org/apache/skywalking/apm/plugin/HttpClientSendAsyncInterceptor.java
new file mode 100644
index 0000000000..0661c4705f
--- /dev/null
+++ b/apm-sniffer/bootstrap-plugins/jdk-httpclient-plugin/src/main/java/org/apache/skywalking/apm/plugin/HttpClientSendAsyncInterceptor.java
@@ -0,0 +1,123 @@
+/*
+ * 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;
+
+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;
+
+import java.lang.reflect.Method;
+import java.net.URI;
+import java.net.http.HttpRequest;
+import java.net.http.HttpResponse;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.CompletableFuture;
+
+public class HttpClientSendAsyncInterceptor implements InstanceMethodsAroundInterceptor {
+
+ @Override
+ public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class>[] argumentsTypes, MethodInterceptResult result) throws Throwable {
+ HttpRequest request = (HttpRequest) allArguments[0];
+ URI uri = request.uri();
+
+ ContextCarrier contextCarrier = new ContextCarrier();
+ AbstractSpan span = ContextManager.createExitSpan(buildOperationName(request.method(), uri), contextCarrier, getPeer(uri));
+
+ if (request instanceof EnhancedInstance) {
+ ((EnhancedInstance) request).setSkyWalkingDynamicField(contextCarrier);
+ }
+
+ span.setComponent(ComponentsDefine.JDK_HTTP);
+ Tags.HTTP.METHOD.set(span, request.method());
+ Tags.URL.set(span, String.valueOf(uri));
+ SpanLayer.asHttp(span);
+ }
+
+ @Override
+ public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class>[] argumentsTypes, Object ret) throws Throwable {
+
+ if (ContextManager.isActive()) {
+ AbstractSpan span = ContextManager.activeSpan();
+ span.prepareForAsync();
+
+ if (ret != null) {
+ CompletableFuture> future = (CompletableFuture>) ret;
+ ret = future.whenComplete((response, throwable) -> {
+ try {
+ if (throwable != null) {
+ span.errorOccurred();
+ span.log(throwable);
+ return;
+ }
+ if (response instanceof HttpResponse) {
+ HttpResponse> httpResponse = (HttpResponse>) response;
+ int statusCode = httpResponse.statusCode();
+ Tags.HTTP_RESPONSE_STATUS_CODE.set(span, statusCode);
+ if (statusCode >= 400) {
+ span.errorOccurred();
+ }
+ }
+ } finally {
+ span.asyncFinish();
+ }
+ });
+ } else {
+ Map eventMap = new HashMap();
+ eventMap.put("error", "No response");
+ span.log(System.currentTimeMillis(), eventMap);
+ span.errorOccurred();
+ }
+ ContextManager.stopSpan();
+ }
+ return ret;
+ }
+
+ @Override
+ public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class>[] argumentsTypes, Throwable t) {
+ if (ContextManager.isActive()) {
+ ContextManager.activeSpan().log(t);
+ }
+ }
+
+ private String buildOperationName(String method, URI uri) {
+ String path = uri.getPath();
+ if (path == null || path.isEmpty()) {
+ path = "/";
+ }
+ return method + ":" + path;
+ }
+
+ private String getPeer(URI uri) {
+ String host = uri.getHost();
+ int port = uri.getPort();
+
+ if (port == -1) {
+ port = "https".equalsIgnoreCase(uri.getScheme()) ? 443 : 80;
+ }
+
+ return host + ":" + port;
+ }
+}
diff --git a/apm-sniffer/bootstrap-plugins/jdk-httpclient-plugin/src/main/java/org/apache/skywalking/apm/plugin/HttpClientSendInterceptor.java b/apm-sniffer/bootstrap-plugins/jdk-httpclient-plugin/src/main/java/org/apache/skywalking/apm/plugin/HttpClientSendInterceptor.java
new file mode 100644
index 0000000000..3a06f59ad9
--- /dev/null
+++ b/apm-sniffer/bootstrap-plugins/jdk-httpclient-plugin/src/main/java/org/apache/skywalking/apm/plugin/HttpClientSendInterceptor.java
@@ -0,0 +1,108 @@
+/*
+ * 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;
+
+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;
+
+import java.lang.reflect.Method;
+import java.net.URI;
+import java.net.http.HttpRequest;
+import java.net.http.HttpResponse;
+import java.util.HashMap;
+import java.util.Map;
+
+public class HttpClientSendInterceptor implements InstanceMethodsAroundInterceptor {
+
+ @Override
+ public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class>[] argumentsTypes, MethodInterceptResult result) throws Throwable {
+ HttpRequest request = (HttpRequest) allArguments[0];
+ URI uri = request.uri();
+
+ ContextCarrier contextCarrier = new ContextCarrier();
+ AbstractSpan span = ContextManager.createExitSpan(buildOperationName(request.method(), uri), contextCarrier, getPeer(uri));
+
+ if (request instanceof EnhancedInstance) {
+ ((EnhancedInstance) request).setSkyWalkingDynamicField(contextCarrier);
+ }
+
+ span.setComponent(ComponentsDefine.JDK_HTTP);
+ Tags.HTTP.METHOD.set(span, request.method());
+ Tags.URL.set(span, String.valueOf(uri));
+ SpanLayer.asHttp(span);
+ }
+
+ @Override
+ public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class>[] argumentsTypes, Object ret) throws Throwable {
+
+ if (ContextManager.isActive()) {
+ AbstractSpan span = ContextManager.activeSpan();
+ if (ret != null) {
+ HttpResponse> response = (HttpResponse>) ret;
+ int statusCode = response.statusCode();
+
+ Tags.HTTP_RESPONSE_STATUS_CODE.set(span, response.statusCode());
+ if (statusCode >= 400) {
+ span.errorOccurred();
+ }
+ } else {
+ Map eventMap = new HashMap();
+ eventMap.put("error", "No response");
+ span.log(System.currentTimeMillis(), eventMap);
+ span.errorOccurred();
+ }
+
+ ContextManager.stopSpan();
+ }
+ return ret;
+ }
+
+ @Override
+ public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class>[] argumentsTypes, Throwable t) {
+ if (ContextManager.isActive()) {
+ ContextManager.activeSpan().log(t);
+ }
+ }
+
+ private String buildOperationName(String method, URI uri) {
+ String path = uri.getPath();
+ if (path == null || path.isEmpty()) {
+ path = "/";
+ }
+ return method + ":" + path;
+ }
+
+ private String getPeer(URI uri) {
+ String host = uri.getHost();
+ int port = uri.getPort();
+
+ if (port == -1) {
+ port = "https".equalsIgnoreCase(uri.getScheme()) ? 443 : 80;
+ }
+
+ return host + ":" + port;
+ }
+}
diff --git a/apm-sniffer/bootstrap-plugins/jdk-httpclient-plugin/src/main/java/org/apache/skywalking/apm/plugin/HttpRequestHeadersInterceptor.java b/apm-sniffer/bootstrap-plugins/jdk-httpclient-plugin/src/main/java/org/apache/skywalking/apm/plugin/HttpRequestHeadersInterceptor.java
new file mode 100644
index 0000000000..a6dc76650f
--- /dev/null
+++ b/apm-sniffer/bootstrap-plugins/jdk-httpclient-plugin/src/main/java/org/apache/skywalking/apm/plugin/HttpRequestHeadersInterceptor.java
@@ -0,0 +1,62 @@
+/*
+ * 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;
+
+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.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 java.lang.reflect.Method;
+import java.net.http.HttpHeaders;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class HttpRequestHeadersInterceptor implements InstanceMethodsAroundInterceptor {
+
+ @Override
+ public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class>[] argumentsTypes, MethodInterceptResult result) throws Throwable {
+
+ }
+
+ @Override
+ public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class>[] argumentsTypes, Object ret) throws Throwable {
+
+ ContextCarrier contextCarrier = (ContextCarrier) objInst.getSkyWalkingDynamicField();
+ HttpHeaders originalHeaders = (HttpHeaders) ret;
+ final Map> headerMap = new HashMap<>(originalHeaders.map());
+ CarrierItem next = contextCarrier.items();
+ while (next.hasNext()) {
+ next = next.next();
+ headerMap.put(next.getHeadKey(), List.of(next.getHeadValue()));
+ }
+
+ return HttpHeaders.of(headerMap, (k, v) -> true);
+ }
+
+ @Override
+ public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class>[] argumentsTypes, Throwable t) {
+ if (ContextManager.isActive()) {
+ ContextManager.activeSpan().log(t);
+ }
+ }
+}
diff --git a/apm-sniffer/bootstrap-plugins/jdk-httpclient-plugin/src/main/java/org/apache/skywalking/apm/plugin/define/HttpClientInstrumentation.java b/apm-sniffer/bootstrap-plugins/jdk-httpclient-plugin/src/main/java/org/apache/skywalking/apm/plugin/define/HttpClientInstrumentation.java
new file mode 100644
index 0000000000..18f7cf298b
--- /dev/null
+++ b/apm-sniffer/bootstrap-plugins/jdk-httpclient-plugin/src/main/java/org/apache/skywalking/apm/plugin/define/HttpClientInstrumentation.java
@@ -0,0 +1,109 @@
+/*
+ * 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.define;
+
+import net.bytebuddy.description.method.MethodDescription;
+import net.bytebuddy.matcher.ElementMatcher;
+import net.bytebuddy.matcher.ElementMatchers;
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint;
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint;
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine;
+import org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch;
+import org.apache.skywalking.apm.agent.core.plugin.match.HierarchyMatch;
+import org.apache.skywalking.apm.agent.core.plugin.match.IndirectMatch;
+import org.apache.skywalking.apm.agent.core.plugin.match.MultiClassNameMatch;
+import org.apache.skywalking.apm.agent.core.plugin.match.logical.LogicalMatchOperation;
+
+import static net.bytebuddy.matcher.ElementMatchers.named;
+
+public class HttpClientInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
+
+ private static final String ENHANCE_PARENT_CLASS = "java.net.http.HttpClient";
+
+ private static final String EXCLUDE_CLASS = "jdk.internal.net.http.HttpClientFacade";
+
+ private static final String INTERCEPT_SEND_METHOD = "send";
+
+ private static final String INTERCEPT_SEND_ASYNC_METHOD = "sendAsync";
+
+ private static final String INTERCEPT_SEND_HANDLE = "org.apache.skywalking.apm.plugin.HttpClientSendInterceptor";
+
+ private static final String INTERCEPT_SEND_ASYNC_HANDLE = "org.apache.skywalking.apm.plugin.HttpClientSendAsyncInterceptor";
+
+ @Override
+ public boolean isBootstrapInstrumentation() {
+ return true;
+ }
+
+ @Override
+ public ConstructorInterceptPoint[] getConstructorsInterceptPoints() {
+ return new ConstructorInterceptPoint[0];
+ }
+
+ @Override
+ protected ClassMatch enhanceClass() {
+ IndirectMatch parentType = HierarchyMatch.byHierarchyMatch(ENHANCE_PARENT_CLASS);
+ IndirectMatch excludeClass = LogicalMatchOperation.not(MultiClassNameMatch.byMultiClassMatch(EXCLUDE_CLASS));
+ return LogicalMatchOperation.and(parentType, excludeClass);
+ }
+
+ @Override
+ public InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints() {
+ return new InstanceMethodsInterceptPoint[]{
+ new InstanceMethodsInterceptPoint() {
+ @Override
+ public ElementMatcher getMethodsMatcher() {
+ return ElementMatchers.named(INTERCEPT_SEND_METHOD)
+ .and(ElementMatchers.takesArgument(0, named("java.net.http.HttpRequest")))
+ .and(ElementMatchers.takesArguments(2));
+ }
+
+ @Override
+ public String getMethodsInterceptor() {
+ return INTERCEPT_SEND_HANDLE;
+ }
+
+ @Override
+ public boolean isOverrideArgs() {
+ return false;
+ }
+ },
+ new InstanceMethodsInterceptPoint() {
+ @Override
+ public ElementMatcher getMethodsMatcher() {
+ return ElementMatchers.named(INTERCEPT_SEND_ASYNC_METHOD)
+ .and(ElementMatchers.takesArgument(0, named("java.net.http.HttpRequest")))
+ .and(ElementMatchers.takesArgument(1, named("java.net.http.HttpResponse$BodyHandler")))
+ .and(ElementMatchers.takesArgument(2, named("java.net.http.HttpResponse$PushPromiseHandler")))
+ .and(ElementMatchers.takesArguments(3));
+ }
+
+ @Override
+ public String getMethodsInterceptor() {
+ return INTERCEPT_SEND_ASYNC_HANDLE;
+ }
+
+ @Override
+ public boolean isOverrideArgs() {
+ return false;
+ }
+ },
+ };
+ }
+}
diff --git a/apm-sniffer/bootstrap-plugins/jdk-httpclient-plugin/src/main/java/org/apache/skywalking/apm/plugin/define/HttpRequestInstrumentation.java b/apm-sniffer/bootstrap-plugins/jdk-httpclient-plugin/src/main/java/org/apache/skywalking/apm/plugin/define/HttpRequestInstrumentation.java
new file mode 100644
index 0000000000..18d47b6923
--- /dev/null
+++ b/apm-sniffer/bootstrap-plugins/jdk-httpclient-plugin/src/main/java/org/apache/skywalking/apm/plugin/define/HttpRequestInstrumentation.java
@@ -0,0 +1,75 @@
+/*
+ * 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.define;
+
+import net.bytebuddy.description.method.MethodDescription;
+import net.bytebuddy.matcher.ElementMatcher;
+import net.bytebuddy.matcher.ElementMatchers;
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint;
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint;
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine;
+import org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch;
+
+import static org.apache.skywalking.apm.agent.core.plugin.match.NameMatch.byName;
+
+public class HttpRequestInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
+
+ private static final String ENHANCE_CLASS = "jdk.internal.net.http.ImmutableHttpRequest";
+
+ private static final String INTERCEPT_HEADERS_METHOD = "headers";
+
+ private static final String INTERCEPT_HEADERS_HANDLE = "org.apache.skywalking.apm.plugin.HttpRequestHeadersInterceptor";
+
+ @Override
+ public boolean isBootstrapInstrumentation() {
+ return true;
+ }
+
+ @Override
+ public ConstructorInterceptPoint[] getConstructorsInterceptPoints() {
+ return new ConstructorInterceptPoint[0];
+ }
+
+ @Override
+ protected ClassMatch enhanceClass() {
+ return byName(ENHANCE_CLASS);
+ }
+
+ @Override
+ public InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints() {
+ return new InstanceMethodsInterceptPoint[]{
+ new InstanceMethodsInterceptPoint() {
+ @Override
+ public ElementMatcher getMethodsMatcher() {
+ return ElementMatchers.named(INTERCEPT_HEADERS_METHOD);
+ }
+
+ @Override
+ public String getMethodsInterceptor() {
+ return INTERCEPT_HEADERS_HANDLE;
+ }
+
+ @Override
+ public boolean isOverrideArgs() {
+ return true;
+ }
+ }
+ };
+ }
+}
diff --git a/apm-sniffer/bootstrap-plugins/jdk-httpclient-plugin/src/main/resources/skywalking-plugin.def b/apm-sniffer/bootstrap-plugins/jdk-httpclient-plugin/src/main/resources/skywalking-plugin.def
new file mode 100644
index 0000000000..e4d1ef2562
--- /dev/null
+++ b/apm-sniffer/bootstrap-plugins/jdk-httpclient-plugin/src/main/resources/skywalking-plugin.def
@@ -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.
+
+jdk-httpclient-plugin=org.apache.skywalking.apm.plugin.define.HttpClientInstrumentation
+jdk-httpclient-plugin=org.apache.skywalking.apm.plugin.define.HttpRequestInstrumentation
\ No newline at end of file
diff --git a/apm-sniffer/bootstrap-plugins/pom.xml b/apm-sniffer/bootstrap-plugins/pom.xml
index 8d1424343c..cf1285cc07 100644
--- a/apm-sniffer/bootstrap-plugins/pom.xml
+++ b/apm-sniffer/bootstrap-plugins/pom.xml
@@ -44,6 +44,7 @@
jdk-threadpool-pluginjdk-forkjoinpool-pluginjdk-virtual-thread-executor-plugin
+ jdk-httpclient-plugin
diff --git a/apm-sniffer/optional-plugins/netty-http-4.1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/netty/http/handler/NettyHttpRequestEncoderTracingHandler.java b/apm-sniffer/optional-plugins/netty-http-4.1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/netty/http/handler/NettyHttpRequestEncoderTracingHandler.java
index bb34adbaac..38c8518fb3 100644
--- a/apm-sniffer/optional-plugins/netty-http-4.1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/netty/http/handler/NettyHttpRequestEncoderTracingHandler.java
+++ b/apm-sniffer/optional-plugins/netty-http-4.1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/netty/http/handler/NettyHttpRequestEncoderTracingHandler.java
@@ -80,7 +80,6 @@ public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise)
InetSocketAddress address = (InetSocketAddress) ctx.channel().remoteAddress();
String peer = address.getHostString() + ":" + address.getPort();
String url = peer + uri;
- String method = request.method().toString();
ContextCarrier contextCarrier = new ContextCarrier();
AbstractSpan span = ContextManager.createExitSpan(NettyConstants.NETTY_HTTP_OPERATION_PREFIX + uri, contextCarrier, peer);
diff --git a/docs/en/setup/service-agent/java-agent/Bootstrap-plugins.md b/docs/en/setup/service-agent/java-agent/Bootstrap-plugins.md
index 7eec71899a..f03a4e21a7 100644
--- a/docs/en/setup/service-agent/java-agent/Bootstrap-plugins.md
+++ b/docs/en/setup/service-agent/java-agent/Bootstrap-plugins.md
@@ -8,6 +8,7 @@ Now, we have the following known bootstrap plugins.
* Plugin of JDK ThreadPoolExecutor. Agent is compatible with JDK 1.8+
* Plugin of JDK ForkJoinPool. Agent is compatible with JDK 1.8+
* Plugin of JDK VirtualThreadExecutor. Agent is compatible with JDK 21+
+* Plugin of JDK HttpClient. Agent is compatible with JDK 11+
### HttpURLConnection Plugin Notice
The plugin of JDK HttpURLConnection depended on `sun.net.*`. When using Java 9+, You should add some JVM options as follows:
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 58a3a50ffc..7d8933e5d3 100644
--- a/docs/en/setup/service-agent/java-agent/Plugin-list.md
+++ b/docs/en/setup/service-agent/java-agent/Plugin-list.md
@@ -47,6 +47,7 @@
- influxdb-2.x
- jackson-2.x
- jdk-http-plugin
+- jdk-httpclient-plugin
- jdk-threading-plugin
- jdk-virtual-thread-executor-plugin
- jedis-2.x-3.x
diff --git a/test/e2e/case/kafka/docker-compose.yml b/test/e2e/case/kafka/docker-compose.yml
index 40bb4ba346..4f25a14cd6 100644
--- a/test/e2e/case/kafka/docker-compose.yml
+++ b/test/e2e/case/kafka/docker-compose.yml
@@ -32,7 +32,7 @@ services:
retries: 120
broker-a:
- image: bitnami/kafka:2.4.1
+ image: bitnamilegacy/kafka:2.4.1
hostname: broker-a
expose:
- 9092
@@ -52,7 +52,7 @@ services:
retries: 120
broker-b:
- image: bitnami/kafka:2.4.1
+ image: bitnamilegacy/kafka:2.4.1
hostname: broker-b
expose:
- 9092
diff --git a/test/plugin/scenarios/elasticsearch-transport-6.x-scenario/configuration.yml b/test/plugin/scenarios/elasticsearch-transport-6.x-scenario/configuration.yml
index cafc4a0571..a268b52e4c 100644
--- a/test/plugin/scenarios/elasticsearch-transport-6.x-scenario/configuration.yml
+++ b/test/plugin/scenarios/elasticsearch-transport-6.x-scenario/configuration.yml
@@ -20,7 +20,7 @@ environment:
- elasticsearch.server=elasticsearch-server-6.x:9200
dependencies:
elasticsearch-server-6.x:
- image: bitnami/elasticsearch:${CASE_SERVER_IMAGE_VERSION}
+ image: bitnamilegacy/elasticsearch:${CASE_SERVER_IMAGE_VERSION}
hostname: elasticsearch-server-6.x
removeOnExit: true
expose:
diff --git a/test/plugin/scenarios/jdk-httpclient-scenario/bin/startup.sh b/test/plugin/scenarios/jdk-httpclient-scenario/bin/startup.sh
new file mode 100644
index 0000000000..6c3e9e8b21
--- /dev/null
+++ b/test/plugin/scenarios/jdk-httpclient-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/jdk-httpclient-scenario.jar &
\ No newline at end of file
diff --git a/test/plugin/scenarios/jdk-httpclient-scenario/config/expectedData.yaml b/test/plugin/scenarios/jdk-httpclient-scenario/config/expectedData.yaml
new file mode 100644
index 0000000000..f009e03a46
--- /dev/null
+++ b/test/plugin/scenarios/jdk-httpclient-scenario/config/expectedData.yaml
@@ -0,0 +1,111 @@
+# 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: jdk-httpclient-scenario
+ segmentSize: gt 0
+ segments:
+ - segmentId: not null
+ spans:
+ - operationName: POST:/user/login
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: Http
+ startTime: not null
+ endTime: not null
+ componentId: 14
+ isError: false
+ spanType: Entry
+ peer: ''
+ skipAnalysis: 'false'
+ tags:
+ - { key: url, value: not null }
+ - { key: http.method, value: POST }
+ - { key: http.status_code, value: '200' }
+ refs:
+ - { parentEndpoint: GET:/case/jdk-httpclient-scenario-case, networkAddress: 'localhost:8080',
+ refType: CrossProcess, parentSpanId: 1, parentTraceSegmentId: not null, parentServiceInstance: not
+ null, parentService: jdk-httpclient-scenario, traceId: not null }
+ - segmentId: not null
+ spans:
+ - operationName: POST:/user/asyncLogin
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: Http
+ startTime: not null
+ endTime: not null
+ componentId: 14
+ isError: false
+ spanType: Entry
+ peer: ''
+ skipAnalysis: 'false'
+ tags:
+ - { key: url, value: not null }
+ - { key: http.method, value: POST }
+ - { key: http.status_code, value: '200' }
+ refs:
+ - { parentEndpoint: GET:/case/jdk-httpclient-scenario-case, networkAddress: 'localhost:8080',
+ refType: CrossProcess, parentSpanId: 2, parentTraceSegmentId: not null, parentServiceInstance: not
+ null, parentService: jdk-httpclient-scenario, traceId: not null }
+
+ - segmentId: not null
+ spans:
+ - operationName: POST:/jdk-httpclient-scenario/user/login
+ parentSpanId: 0
+ spanId: 1
+ spanLayer: Http
+ startTime: not null
+ endTime: not null
+ componentId: 66
+ isError: false
+ spanType: Exit
+ peer: not null
+ skipAnalysis: 'false'
+ tags:
+ - { key: http.method, value: POST }
+ - { key: url, value: http://localhost:8080/jdk-httpclient-scenario/user/login }
+ - { key: http.status_code, value: '200' }
+
+ - operationName: POST:/jdk-httpclient-scenario/user/asyncLogin
+ parentSpanId: 0
+ spanId: 2
+ spanLayer: Http
+ startTime: not null
+ endTime: not null
+ componentId: 66
+ isError: false
+ spanType: Exit
+ peer: not null
+ skipAnalysis: 'false'
+ tags:
+ - { key: http.method, value: POST }
+ - { key: url, value: http://localhost:8080/jdk-httpclient-scenario/user/asyncLogin }
+ - { key: http.status_code, value: '200' }
+
+ - operationName: GET:/case/jdk-httpclient-scenario-case
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: Http
+ startTime: not null
+ endTime: not null
+ componentId: 14
+ isError: false
+ spanType: Entry
+ peer: ''
+ tags:
+ - { key: url, value: http://localhost:8080/jdk-httpclient-scenario/case/jdk-httpclient-scenario-case }
+ - { key: http.method, value: GET }
+ - { key: http.status_code, value: '200' }
+ skipAnalysis: 'false'
diff --git a/test/plugin/scenarios/jdk-httpclient-scenario/configuration.yml b/test/plugin/scenarios/jdk-httpclient-scenario/configuration.yml
new file mode 100644
index 0000000000..a5fe9c2cb1
--- /dev/null
+++ b/test/plugin/scenarios/jdk-httpclient-scenario/configuration.yml
@@ -0,0 +1,22 @@
+# 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/jdk-httpclient-scenario/case/jdk-httpclient-scenario-case
+healthCheck: http://localhost:8080/jdk-httpclient-scenario/case/healthCheck
+runningMode: with_bootstrap
+withPlugins: apm-jdk-httpclient-plugin-*.jar
+startScript: ./bin/startup.sh
diff --git a/test/plugin/scenarios/jdk-httpclient-scenario/pom.xml b/test/plugin/scenarios/jdk-httpclient-scenario/pom.xml
new file mode 100644
index 0000000000..406bb8f57d
--- /dev/null
+++ b/test/plugin/scenarios/jdk-httpclient-scenario/pom.xml
@@ -0,0 +1,128 @@
+
+
+
+ 4.0.0
+
+ org.apache.skywalking
+ jdk-httpclient-scenario
+ 5.0.0
+
+
+ UTF-8
+ 11
+ 3.8.1
+ 2.7.15
+
+
+ skywalking-jdk-httpclient-scenario
+
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+ 2.7.15
+
+
+
+ com.alibaba
+ fastjson
+ 1.2.83
+
+
+
+
+ jdk-httpclient-scenario
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+ ${spring.boot.version}
+
+
+
+ repackage
+
+
+
+
+
+ maven-compiler-plugin
+ ${maven-compiler-plugin.version}
+
+ ${compiler.version}
+ ${compiler.version}
+ ${project.build.sourceEncoding}
+
+
+
+ org.apache.maven.plugins
+ maven-assembly-plugin
+
+
+ assemble
+ package
+
+ single
+
+
+
+ src/main/assembly/assembly.xml
+
+ ./target/
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+
+
+ attach-javadocs
+
+ jar
+
+
+
+
+ false
+
+
+
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+
+
+ empty-javadoc-jar
+ package
+
+ jar
+
+
+ javadoc
+ ${basedir}/javadoc
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/plugin/scenarios/jdk-httpclient-scenario/src/main/assembly/assembly.xml b/test/plugin/scenarios/jdk-httpclient-scenario/src/main/assembly/assembly.xml
new file mode 100644
index 0000000000..3ab23573ab
--- /dev/null
+++ b/test/plugin/scenarios/jdk-httpclient-scenario/src/main/assembly/assembly.xml
@@ -0,0 +1,41 @@
+
+
+
+
+ zip
+
+
+
+
+ ./bin
+ 0775
+
+
+
+
+
+ ./target/jdk-httpclient-scenario.jar
+ ./libs
+ 0775
+
+
+
\ No newline at end of file
diff --git a/test/plugin/scenarios/jdk-httpclient-scenario/src/main/java/test/apache/skywalking/apm/testcase/jdk/httpclient/Application.java b/test/plugin/scenarios/jdk-httpclient-scenario/src/main/java/test/apache/skywalking/apm/testcase/jdk/httpclient/Application.java
new file mode 100644
index 0000000000..5147a224ee
--- /dev/null
+++ b/test/plugin/scenarios/jdk-httpclient-scenario/src/main/java/test/apache/skywalking/apm/testcase/jdk/httpclient/Application.java
@@ -0,0 +1,30 @@
+/*
+ * 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.jdk.httpclient;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+public class Application {
+
+ public static void main(String[] args) {
+ SpringApplication.run(Application.class, args);
+ }
+
+}
diff --git a/test/plugin/scenarios/jdk-httpclient-scenario/src/main/java/test/apache/skywalking/apm/testcase/jdk/httpclient/controller/CaseController.java b/test/plugin/scenarios/jdk-httpclient-scenario/src/main/java/test/apache/skywalking/apm/testcase/jdk/httpclient/controller/CaseController.java
new file mode 100644
index 0000000000..25d4f4e6b9
--- /dev/null
+++ b/test/plugin/scenarios/jdk-httpclient-scenario/src/main/java/test/apache/skywalking/apm/testcase/jdk/httpclient/controller/CaseController.java
@@ -0,0 +1,71 @@
+/*
+ * 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.jdk.httpclient.controller;
+
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.io.IOException;
+import java.net.URI;
+import java.net.http.HttpClient;
+import java.net.http.HttpRequest;
+import java.net.http.HttpResponse;
+import java.time.Duration;
+import java.util.concurrent.CompletableFuture;
+
+@RestController
+@RequestMapping("/case")
+public class CaseController {
+
+ @GetMapping("/healthCheck")
+ public String healthCheck() {
+ return "Success";
+ }
+
+ @GetMapping("/jdk-httpclient-scenario-case")
+ public String testCase() throws InterruptedException, IOException {
+ HttpClient client = HttpClient.newBuilder()
+ .connectTimeout(Duration.ofSeconds(10))
+ .build();
+
+ String json = "{\n" +
+ " \"username\": \"Alice\",\n" +
+ " \"password\": 21231231231\n" +
+ "}";
+
+ HttpRequest request = HttpRequest.newBuilder()
+ .uri(URI.create("http://localhost:8080/jdk-httpclient-scenario/user/login"))
+ .timeout(Duration.ofSeconds(10))
+ .header("Content-Type", "application/json")
+ .POST(HttpRequest.BodyPublishers.ofString(json))
+ .build();
+
+ client.send(request, HttpResponse.BodyHandlers.ofString());
+
+ HttpRequest asyncRequest = HttpRequest.newBuilder()
+ .uri(URI.create("http://localhost:8080/jdk-httpclient-scenario/user/asyncLogin"))
+ .timeout(Duration.ofSeconds(10))
+ .header("Content-Type", "application/json")
+ .POST(HttpRequest.BodyPublishers.ofString(json))
+ .build();
+ CompletableFuture> future = client.sendAsync(asyncRequest, HttpResponse.BodyHandlers.ofString());
+ future.join();
+ return "success";
+ }
+}
diff --git a/test/plugin/scenarios/jdk-httpclient-scenario/src/main/java/test/apache/skywalking/apm/testcase/jdk/httpclient/controller/UserController.java b/test/plugin/scenarios/jdk-httpclient-scenario/src/main/java/test/apache/skywalking/apm/testcase/jdk/httpclient/controller/UserController.java
new file mode 100644
index 0000000000..a9665ffcb6
--- /dev/null
+++ b/test/plugin/scenarios/jdk-httpclient-scenario/src/main/java/test/apache/skywalking/apm/testcase/jdk/httpclient/controller/UserController.java
@@ -0,0 +1,45 @@
+/*
+ * 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.jdk.httpclient.controller;
+
+import com.alibaba.fastjson.JSONObject;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import test.apache.skywalking.apm.testcase.jdk.httpclient.dto.UserLoginDTO;
+
+@RestController
+@RequestMapping("/user")
+public class UserController {
+ @PostMapping("/login")
+ public JSONObject login(@RequestBody UserLoginDTO userLoginDTO) {
+ JSONObject resultJson = new JSONObject();
+ resultJson.put("code", 200);
+ resultJson.put("message", "success");
+ return resultJson;
+ }
+
+ @PostMapping("/asyncLogin")
+ public JSONObject asyncLogin(@RequestBody UserLoginDTO userLoginDTO) {
+ JSONObject resultJson = new JSONObject();
+ resultJson.put("code", 200);
+ resultJson.put("message", "success");
+ return resultJson;
+ }
+}
diff --git a/test/plugin/scenarios/jdk-httpclient-scenario/src/main/java/test/apache/skywalking/apm/testcase/jdk/httpclient/dto/UserLoginDTO.java b/test/plugin/scenarios/jdk-httpclient-scenario/src/main/java/test/apache/skywalking/apm/testcase/jdk/httpclient/dto/UserLoginDTO.java
new file mode 100644
index 0000000000..1226f82d2d
--- /dev/null
+++ b/test/plugin/scenarios/jdk-httpclient-scenario/src/main/java/test/apache/skywalking/apm/testcase/jdk/httpclient/dto/UserLoginDTO.java
@@ -0,0 +1,40 @@
+/*
+ * 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.jdk.httpclient.dto;
+
+public class UserLoginDTO {
+ private String username;
+
+ private String password;
+
+ public String getUsername() {
+ return username;
+ }
+
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ public String getPassword() {
+ return password;
+ }
+
+ public void setPassword(String password) {
+ this.password = password;
+ }
+}
diff --git a/test/plugin/scenarios/jdk-httpclient-scenario/src/main/resources/application.yaml b/test/plugin/scenarios/jdk-httpclient-scenario/src/main/resources/application.yaml
new file mode 100644
index 0000000000..2bed23f8ca
--- /dev/null
+++ b/test/plugin/scenarios/jdk-httpclient-scenario/src/main/resources/application.yaml
@@ -0,0 +1,21 @@
+# 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: /jdk-httpclient-scenario
+
diff --git a/test/plugin/scenarios/jdk-httpclient-scenario/support-version.list b/test/plugin/scenarios/jdk-httpclient-scenario/support-version.list
new file mode 100644
index 0000000000..feef03cdea
--- /dev/null
+++ b/test/plugin/scenarios/jdk-httpclient-scenario/support-version.list
@@ -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.
+
+all
\ No newline at end of file
diff --git a/test/plugin/scenarios/jdk-virtual-thread-executor-scenario/pom.xml b/test/plugin/scenarios/jdk-virtual-thread-executor-scenario/pom.xml
index a9b9bb25f6..cc26ef8c91 100644
--- a/test/plugin/scenarios/jdk-virtual-thread-executor-scenario/pom.xml
+++ b/test/plugin/scenarios/jdk-virtual-thread-executor-scenario/pom.xml
@@ -90,14 +90,6 @@
-
- org.apache.maven.plugins
- maven-compiler-plugin
-
- 21
- 21
-
- org.apache.maven.pluginsmaven-javadoc-plugin
diff --git a/test/plugin/scenarios/jedis-2.x-3.x-cluster-scenario/configuration.yml b/test/plugin/scenarios/jedis-2.x-3.x-cluster-scenario/configuration.yml
index e37ee9af2f..79a60472da 100644
--- a/test/plugin/scenarios/jedis-2.x-3.x-cluster-scenario/configuration.yml
+++ b/test/plugin/scenarios/jedis-2.x-3.x-cluster-scenario/configuration.yml
@@ -23,19 +23,19 @@ environment:
- SW_PLUGIN_JEDIS_TRACE_REDIS_PARAMETERS=true
dependencies:
redis-server1:
- image: bitnami/redis-cluster:7.0
+ image: bitnamilegacy/redis-cluster:7.0
hostname: redis-server1
environment:
- ALLOW_EMPTY_PASSWORD=true
- REDIS_NODES=redis-server1 redis-server2 redis-server3
redis-server2:
- image: bitnami/redis-cluster:7.0
+ image: bitnamilegacy/redis-cluster:7.0
hostname: redis-server2
environment:
- ALLOW_EMPTY_PASSWORD=true
- REDIS_NODES=redis-server1 redis-server2 redis-server3
redis-server3:
- image: bitnami/redis-cluster:7.0
+ image: bitnamilegacy/redis-cluster:7.0
hostname: redis-server3
depends_on:
- redis-server1
diff --git a/test/plugin/scenarios/kafka-scenario/configuration.yml b/test/plugin/scenarios/kafka-scenario/configuration.yml
index 5a74c2ba42..7db52f161f 100644
--- a/test/plugin/scenarios/kafka-scenario/configuration.yml
+++ b/test/plugin/scenarios/kafka-scenario/configuration.yml
@@ -28,7 +28,7 @@ dependencies:
image: zookeeper:3.4
hostname: zookeeper-server
kafka-server:
- image: bitnami/kafka:2.1.1
+ image: bitnamilegacy/kafka:2.4.1
hostname: kafka-server
environment:
- KAFKA_ZOOKEEPER_CONNECT=zookeeper-server:2181
diff --git a/test/plugin/scenarios/spring-kafka-1.3.x-scenario/configuration.yml b/test/plugin/scenarios/spring-kafka-1.3.x-scenario/configuration.yml
index f608847078..8d387e2d45 100644
--- a/test/plugin/scenarios/spring-kafka-1.3.x-scenario/configuration.yml
+++ b/test/plugin/scenarios/spring-kafka-1.3.x-scenario/configuration.yml
@@ -28,7 +28,7 @@ dependencies:
image: zookeeper:3.4
hostname: zookeeper-server
kafka-server:
- image: bitnami/kafka:2.1.1
+ image: bitnamilegacy/kafka:2.4.1
hostname: kafka-server
environment:
- KAFKA_ZOOKEEPER_CONNECT=zookeeper-server:2181
diff --git a/test/plugin/scenarios/spring-kafka-2.2.x-scenario/configuration.yml b/test/plugin/scenarios/spring-kafka-2.2.x-scenario/configuration.yml
index c8b94d2bee..164b29135a 100644
--- a/test/plugin/scenarios/spring-kafka-2.2.x-scenario/configuration.yml
+++ b/test/plugin/scenarios/spring-kafka-2.2.x-scenario/configuration.yml
@@ -28,7 +28,7 @@ dependencies:
image: zookeeper:3.4
hostname: zookeeper-server
kafka-server:
- image: bitnami/kafka:2.1.1
+ image: bitnamilegacy/kafka:2.4.1
hostname: kafka-server
environment:
- KAFKA_ZOOKEEPER_CONNECT=zookeeper-server:2181
diff --git a/test/plugin/scenarios/spring-kafka-2.3.x-scenario/configuration.yml b/test/plugin/scenarios/spring-kafka-2.3.x-scenario/configuration.yml
index 3d40a52355..295f967541 100644
--- a/test/plugin/scenarios/spring-kafka-2.3.x-scenario/configuration.yml
+++ b/test/plugin/scenarios/spring-kafka-2.3.x-scenario/configuration.yml
@@ -28,7 +28,7 @@ dependencies:
image: zookeeper:3.4
hostname: zookeeper-server
kafka-server:
- image: bitnami/kafka:2.1.1
+ image: bitnamilegacy/kafka:2.4.1
hostname: kafka-server
environment:
- KAFKA_ZOOKEEPER_CONNECT=zookeeper-server:2181