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 e464f18ad9 Add WebSphere Liberty 23.x plugin.(#10887) (#560)
e464f18ad9 is described below
commit e464f18ad91f77dcf6cc942ddc734f2169c052a2
Author: weixiang1862 <[email protected]>
AuthorDate: Sun Jun 25 16:50:18 2023 +0800
Add WebSphere Liberty 23.x plugin.(#10887) (#560)
---
.github/workflows/plugins-test.2.yaml | 1 +
CHANGES.md | 1 +
.../network/trace/component/ComponentsDefine.java | 1 +
apm-sniffer/apm-sdk-plugin/pom.xml | 1 +
.../websphere-liberty-23.x-plugin/pom.xml | 59 ++++++++
.../ibm/websphere/servlet/request/IRequest.java | 37 +++++
.../ws/webcontainer/async/CompleteRunnable.java | 28 ++++
.../ws/webcontainer/async/DispatchRunnable.java | 28 ++++
.../v23/AsyncContextInterceptor.java | 48 +++++++
.../v23/DynamicVirtualHostInterceptor.java | 79 ++++++++++
.../websphereliberty/v23/IResponseInterceptor.java | 45 ++++++
.../v23/WebContainerInterceptor.java | 83 +++++++++++
.../websphereliberty/v23/async/AsyncType.java | 60 ++++++++
.../v23/async/RunnableWrapper.java | 58 ++++++++
.../v23/define/AbstractWitnessInstrumentation.java | 31 ++++
.../v23/define/AsyncContextInstrumentation.java | 69 +++++++++
.../define/DynamicVirtualHostInstrumentation.java | 69 +++++++++
.../v23/define/IResponseInstrumentation.java | 67 +++++++++
.../v23/define/WebContainerInstrumentation.java | 67 +++++++++
.../src/main/resources/skywalking-plugin.def | 20 +++
.../v23/AsyncContextInterceptorTest.java | 156 ++++++++++++++++++++
.../v23/DynamicVirtualHostInterceptorTest.java | 125 ++++++++++++++++
.../v23/IResponseInterceptorTest.java | 83 +++++++++++
.../v23/WebContainerInterceptorTest.java | 159 +++++++++++++++++++++
.../setup/service-agent/java-agent/Plugin-list.md | 1 +
.../service-agent/java-agent/Supported-list.md | 1 +
pom.xml | 6 +-
.../websphere-liberty-23.x-scenario/bin/startup.sh | 21 +++
.../config/expectedData.yaml | 95 ++++++++++++
.../configuration.yml | 20 +++
.../websphere-liberty-23.x-scenario/pom.xml | 136 ++++++++++++++++++
.../src/main/assembly/assembly.xml | 41 ++++++
.../apm/testcase/websphereliberty/CaseServlet.java | 66 +++++++++
.../websphereliberty/HealthCheckServlet.java | 39 +++++
.../src/main/liberty/config/server.xml | 30 ++++
.../src/main/resources/log4j2.xml | 30 ++++
.../src/main/webapp/WEB-INF/web.xml | 44 ++++++
.../support-version.list | 18 +++
38 files changed, 1922 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/plugins-test.2.yaml
b/.github/workflows/plugins-test.2.yaml
index 08f37fb321..d1f0a9b569 100644
--- a/.github/workflows/plugins-test.2.yaml
+++ b/.github/workflows/plugins-test.2.yaml
@@ -79,6 +79,7 @@ jobs:
- rocketmq-scenario
- jersey-2.0.x-2.25.x-scenario
- jersey-2.26.x-2.39.x-scenario
+ - websphere-liberty-23.x-scenario
steps:
- uses: actions/checkout@v2
with:
diff --git a/CHANGES.md b/CHANGES.md
index d5a0c99dc0..10c97b8807 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -137,6 +137,7 @@ Callable {
* Fix the conflict between the logging kernel and the JDK threadpool plugin.
* Fix the thread safety bug of finishing operation for the span named
"SpringCloudGateway/sendRequest"
* Fix NPE in guava-eventbus-plugin.
+* Add WebSphere Liberty 23.x plugin
#### 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 2a51285bbc..bfe00cc5a3 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
@@ -237,4 +237,5 @@ public class ComponentsDefine {
public static final OfficialComponent GRIZZLY = new OfficialComponent(147,
"Grizzly");
+ public static final OfficialComponent WEBSPHERE = new
OfficialComponent(148, "WebSphere");
}
diff --git a/apm-sniffer/apm-sdk-plugin/pom.xml
b/apm-sniffer/apm-sdk-plugin/pom.xml
index ab130e2e10..dbb5721365 100644
--- a/apm-sniffer/apm-sdk-plugin/pom.xml
+++ b/apm-sniffer/apm-sdk-plugin/pom.xml
@@ -132,6 +132,7 @@
<module>grizzly-2.3.x-4.x-plugin</module>
<module>grizzly-2.3.x-4.x-work-threadpool-plugin</module>
<module>rocketMQ-5.x-plugin</module>
+ <module>websphere-liberty-23.x-plugin</module>
</modules>
<packaging>pom</packaging>
diff --git a/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/pom.xml
b/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/pom.xml
new file mode 100644
index 0000000000..05f72cac6d
--- /dev/null
+++ b/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/pom.xml
@@ -0,0 +1,59 @@
+<?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>9.0.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>websphere-liberty-23.x-plugin</artifactId>
+
+ <properties>
+ <junit.version>4.12</junit.version>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>${junit.version}</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <exclude>com/ibm/websphere/servlet/request/**</exclude>
+ <exclude>com/ibm/ws/webcontainer/async/**</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
\ No newline at end of file
diff --git
a/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/src/main/java/com/ibm/websphere/servlet/request/IRequest.java
b/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/src/main/java/com/ibm/websphere/servlet/request/IRequest.java
new file mode 100644
index 0000000000..ec95b40cd4
--- /dev/null
+++
b/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/src/main/java/com/ibm/websphere/servlet/request/IRequest.java
@@ -0,0 +1,37 @@
+/*
+ * 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 com.ibm.websphere.servlet.request;
+
+/**
+ * mock class for compile, will be removed from final package jar
+ */
+public interface IRequest {
+
+ String getMethod();
+
+ String getScheme();
+
+ String getHeader(String name);
+
+ String getRequestURI();
+
+ int getServerPort();
+
+ String getServerName();
+}
\ No newline at end of file
diff --git
a/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/src/main/java/com/ibm/ws/webcontainer/async/CompleteRunnable.java
b/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/src/main/java/com/ibm/ws/webcontainer/async/CompleteRunnable.java
new file mode 100644
index 0000000000..8a60b5837d
--- /dev/null
+++
b/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/src/main/java/com/ibm/ws/webcontainer/async/CompleteRunnable.java
@@ -0,0 +1,28 @@
+/*
+ * 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 com.ibm.ws.webcontainer.async;
+
+/**
+ * mock class for compile, will be removed from final package jar
+ */
+public class CompleteRunnable implements Runnable {
+ @Override
+ public void run() {
+ }
+}
diff --git
a/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/src/main/java/com/ibm/ws/webcontainer/async/DispatchRunnable.java
b/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/src/main/java/com/ibm/ws/webcontainer/async/DispatchRunnable.java
new file mode 100644
index 0000000000..2b03b4003c
--- /dev/null
+++
b/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/src/main/java/com/ibm/ws/webcontainer/async/DispatchRunnable.java
@@ -0,0 +1,28 @@
+/*
+ * 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 com.ibm.ws.webcontainer.async;
+
+/**
+ * mock class for compile, will be removed from final package jar
+ */
+public class DispatchRunnable implements Runnable {
+ @Override
+ public void run() {
+ }
+}
diff --git
a/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/websphereliberty/v23/AsyncContextInterceptor.java
b/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/websphereliberty/v23/AsyncContextInterceptor.java
new file mode 100644
index 0000000000..6815d59a96
--- /dev/null
+++
b/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/websphereliberty/v23/AsyncContextInterceptor.java
@@ -0,0 +1,48 @@
+/*
+ * 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.websphereliberty.v23;
+
+import java.lang.reflect.Method;
+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 org.apache.skywalking.apm.plugin.websphereliberty.v23.async.AsyncType;
+
+public class AsyncContextInterceptor implements
InstanceMethodsAroundInterceptor {
+
+ @Override
+ public void beforeMethod(EnhancedInstance objInst, Method method, Object[]
allArguments, Class<?>[] argumentsTypes,
+ MethodInterceptResult result) throws Throwable {
+ Runnable runnable = (Runnable) allArguments[0];
+ allArguments[0] = AsyncType.doWrap(runnable);
+ }
+
+ @Override
+ public Object afterMethod(EnhancedInstance objInst, Method method,
Object[] allArguments, Class<?>[] argumentsTypes,
+ Object ret) throws Throwable {
+ return ret;
+ }
+
+ @Override
+ public void handleMethodException(EnhancedInstance objInst, Method method,
Object[] allArguments,
+ Class<?>[] argumentsTypes, Throwable t) {
+ ContextManager.activeSpan().log(t);
+ }
+}
diff --git
a/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/websphereliberty/v23/DynamicVirtualHostInterceptor.java
b/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/websphereliberty/v23/DynamicVirtualHostInterceptor.java
new file mode 100644
index 0000000000..933c3bc406
--- /dev/null
+++
b/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/websphereliberty/v23/DynamicVirtualHostInterceptor.java
@@ -0,0 +1,79 @@
+/*
+ * 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.websphereliberty.v23;
+
+import com.ibm.websphere.servlet.request.IRequest;
+import java.lang.reflect.Method;
+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 DynamicVirtualHostInterceptor 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 {
+ if (ret == null) {
+ IRequest request = (IRequest) allArguments[0];
+ ContextCarrier contextCarrier = new ContextCarrier();
+
+ CarrierItem next = contextCarrier.items();
+ while (next.hasNext()) {
+ next = next.next();
+ next.setHeadValue(request.getHeader(next.getHeadKey()));
+ }
+
+ String operationName = String.join(":", request.getMethod(),
request.getRequestURI());
+ AbstractSpan span = ContextManager.createEntrySpan(operationName,
contextCarrier);
+
+ String url = request.getScheme() + "://" +
+ request.getServerName() + ":" + request.getServerPort() +
request.getRequestURI();
+ Tags.URL.set(span, url);
+ Tags.HTTP.METHOD.set(span, request.getMethod());
+
+ span.setComponent(ComponentsDefine.WEBSPHERE);
+ SpanLayer.asHttp(span);
+
+ Tags.HTTP_RESPONSE_STATUS_CODE.set(span, 404);
+
+ span.errorOccurred();
+
+ ContextManager.stopSpan();
+ }
+ return ret;
+ }
+
+ @Override
+ public void handleMethodException(EnhancedInstance objInst, Method method,
Object[] allArguments,
+ Class<?>[] argumentsTypes, Throwable t) {
+ }
+}
diff --git
a/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/websphereliberty/v23/IResponseInterceptor.java
b/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/websphereliberty/v23/IResponseInterceptor.java
new file mode 100644
index 0000000000..4d49dfea06
--- /dev/null
+++
b/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/websphereliberty/v23/IResponseInterceptor.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 org.apache.skywalking.apm.plugin.websphereliberty.v23;
+
+import java.lang.reflect.Method;
+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;
+
+public class IResponseInterceptor implements InstanceMethodsAroundInterceptor {
+
+ @Override
+ public void beforeMethod(EnhancedInstance objInst, Method method, Object[]
allArguments, Class<?>[] argumentsTypes,
+ MethodInterceptResult result) throws Throwable {
+ // save http status code
+ objInst.setSkyWalkingDynamicField(allArguments[0]);
+ }
+
+ @Override
+ public Object afterMethod(EnhancedInstance objInst, Method method,
Object[] allArguments, Class<?>[] argumentsTypes,
+ Object ret) throws Throwable {
+ return ret;
+ }
+
+ @Override
+ public void handleMethodException(EnhancedInstance objInst, Method method,
Object[] allArguments,
+ Class<?>[] argumentsTypes, Throwable t) {
+ }
+}
diff --git
a/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/websphereliberty/v23/WebContainerInterceptor.java
b/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/websphereliberty/v23/WebContainerInterceptor.java
new file mode 100644
index 0000000000..902aedc3ce
--- /dev/null
+++
b/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/websphereliberty/v23/WebContainerInterceptor.java
@@ -0,0 +1,83 @@
+/*
+ * 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.websphereliberty.v23;
+
+import com.ibm.websphere.servlet.request.IRequest;
+import java.lang.reflect.Method;
+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 WebContainerInterceptor implements
InstanceMethodsAroundInterceptor {
+
+ @Override
+ public void beforeMethod(EnhancedInstance objInst, Method method, Object[]
allArguments, Class<?>[] argumentsTypes,
+ MethodInterceptResult result) throws Throwable {
+ IRequest request = (IRequest) allArguments[0];
+ ContextCarrier contextCarrier = new ContextCarrier();
+
+ CarrierItem next = contextCarrier.items();
+ while (next.hasNext()) {
+ next = next.next();
+ next.setHeadValue(request.getHeader(next.getHeadKey()));
+ }
+
+ String operationName = String.join(":", request.getMethod(),
request.getRequestURI());
+ AbstractSpan span = ContextManager.createEntrySpan(operationName,
contextCarrier);
+
+ String url = request.getScheme() + "://" +
+ request.getServerName() + ":" + request.getServerPort() +
request.getRequestURI();
+ Tags.URL.set(span, url);
+ Tags.HTTP.METHOD.set(span, request.getMethod());
+
+ span.setComponent(ComponentsDefine.WEBSPHERE);
+
+ SpanLayer.asHttp(span);
+ }
+
+ @Override
+ public Object afterMethod(EnhancedInstance objInst, Method method,
Object[] allArguments, Class<?>[] argumentsTypes,
+ Object ret) throws Throwable {
+ AbstractSpan span = ContextManager.activeSpan();
+
+ EnhancedInstance response = (EnhancedInstance) allArguments[1];
+ int statusCode = (int) response.getSkyWalkingDynamicField();
+ Tags.HTTP_RESPONSE_STATUS_CODE.set(span, statusCode);
+
+ if (statusCode >= 400) {
+ span.errorOccurred();
+ }
+
+ ContextManager.stopSpan();
+ return ret;
+ }
+
+ @Override
+ public void handleMethodException(EnhancedInstance objInst, Method method,
Object[] allArguments,
+ Class<?>[] argumentsTypes, Throwable t) {
+ ContextManager.activeSpan().log(t);
+ }
+}
diff --git
a/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/websphereliberty/v23/async/AsyncType.java
b/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/websphereliberty/v23/async/AsyncType.java
new file mode 100644
index 0000000000..b8ce2b75f6
--- /dev/null
+++
b/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/websphereliberty/v23/async/AsyncType.java
@@ -0,0 +1,60 @@
+/*
+ * 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.websphereliberty.v23.async;
+
+import com.ibm.ws.webcontainer.async.CompleteRunnable;
+import com.ibm.ws.webcontainer.async.DispatchRunnable;
+import org.apache.skywalking.apm.agent.core.context.ContextManager;
+
+public enum AsyncType {
+ START {
+ @Override
+ public Runnable wrapper(final Runnable runnable) {
+ ContextManager.activeSpan().prepareForAsync();
+ return new RunnableWrapper(
+ runnable, ContextManager.capture(),
ContextManager.activeSpan(), "WebSphereAsync/start");
+ }
+ },
+ DISPATCH {
+ @Override
+ public Runnable wrapper(final Runnable runnable) {
+ ContextManager.activeSpan().prepareForAsync();
+ return new RunnableWrapper(
+ runnable, ContextManager.capture(),
ContextManager.activeSpan(), "WebSphereAsync/dispatch");
+ }
+ },
+ COMPLETE {
+ @Override
+ public Runnable wrapper(final Runnable runnable) {
+ return runnable;
+ }
+ };
+
+ protected abstract Runnable wrapper(Runnable runnable);
+
+ public static Runnable doWrap(Runnable runnable) {
+ if (runnable instanceof CompleteRunnable) {
+ return COMPLETE.wrapper(runnable);
+ } else if (runnable instanceof DispatchRunnable) {
+ return DISPATCH.wrapper(runnable);
+ } else {
+ return START.wrapper(runnable);
+ }
+ }
+}
diff --git
a/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/websphereliberty/v23/async/RunnableWrapper.java
b/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/websphereliberty/v23/async/RunnableWrapper.java
new file mode 100644
index 0000000000..9a6e7da035
--- /dev/null
+++
b/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/websphereliberty/v23/async/RunnableWrapper.java
@@ -0,0 +1,58 @@
+/*
+ * 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.websphereliberty.v23.async;
+
+import org.apache.skywalking.apm.agent.core.context.ContextManager;
+import org.apache.skywalking.apm.agent.core.context.ContextSnapshot;
+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.network.trace.component.ComponentsDefine;
+
+public class RunnableWrapper implements Runnable {
+
+ private final Runnable runnable;
+
+ private final ContextSnapshot snapshot;
+
+ private final AbstractSpan asyncSpan;
+
+ private final String operationName;
+
+ public RunnableWrapper(Runnable runnable, ContextSnapshot snapshot,
AbstractSpan asyncSpan, String operationName) {
+ this.runnable = runnable;
+ this.snapshot = snapshot;
+ this.asyncSpan = asyncSpan;
+ this.operationName = operationName;
+ }
+
+ @Override
+ public void run() {
+ AbstractSpan span = ContextManager.createLocalSpan(operationName);
+ span.setComponent(ComponentsDefine.JDK_THREADING);
+ SpanLayer.asHttp(span);
+
+ try {
+ ContextManager.continued(snapshot);
+ runnable.run();
+ } finally {
+ ContextManager.stopSpan();
+ asyncSpan.asyncFinish();
+ }
+ }
+}
diff --git
a/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/websphereliberty/v23/define/AbstractWitnessInstrumentation.java
b/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/websphereliberty/v23/define/AbstractWitnessInstrumentation.java
new file mode 100644
index 0000000000..2e54c5a34c
--- /dev/null
+++
b/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/websphereliberty/v23/define/AbstractWitnessInstrumentation.java
@@ -0,0 +1,31 @@
+/*
+ * 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.websphereliberty.v23.define;
+
+import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine;
+
+public abstract class AbstractWitnessInstrumentation extends
ClassInstanceMethodsEnhancePluginDefine {
+
+ @Override
+ protected String[] witnessClasses() {
+ return new String[] {
+ "com.ibm.ws.webcontainer.osgi.DynamicVirtualHost"
+ };
+ }
+}
\ No newline at end of file
diff --git
a/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/websphereliberty/v23/define/AsyncContextInstrumentation.java
b/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/websphereliberty/v23/define/AsyncContextInstrumentation.java
new file mode 100644
index 0000000000..7b1a35ffaa
--- /dev/null
+++
b/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/websphereliberty/v23/define/AsyncContextInstrumentation.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.websphereliberty.v23.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.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 AsyncContextInstrumentation extends
AbstractWitnessInstrumentation {
+
+ private static final String ENHANCE_CLASS =
"com.ibm.ws.webcontainer.async.AsyncContextImpl";
+
+ private static final String INTERCEPT_CLASS =
"org.apache.skywalking.apm.plugin.websphereliberty.v23.AsyncContextInterceptor";
+
+ @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("startWithExecutorThread")
+ .and(takesArguments(2));
+ }
+
+ @Override
+ public String getMethodsInterceptor() {
+ return INTERCEPT_CLASS;
+ }
+
+ @Override
+ public boolean isOverrideArgs() {
+ return true;
+ }
+ }
+ };
+ }
+}
diff --git
a/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/websphereliberty/v23/define/DynamicVirtualHostInstrumentation.java
b/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/websphereliberty/v23/define/DynamicVirtualHostInstrumentation.java
new file mode 100644
index 0000000000..505c4a3339
--- /dev/null
+++
b/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/websphereliberty/v23/define/DynamicVirtualHostInstrumentation.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.websphereliberty.v23.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.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 DynamicVirtualHostInstrumentation extends
AbstractWitnessInstrumentation {
+
+ private static final String ENHANCE_CLASS =
"com.ibm.ws.webcontainer.osgi.DynamicVirtualHost";
+
+ private static final String INTERCEPT_CLASS =
"org.apache.skywalking.apm.plugin.websphereliberty.v23.DynamicVirtualHostInterceptor";
+
+ @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("createRunnableHandler")
+ .and(takesArguments(3));
+ }
+
+ @Override
+ public String getMethodsInterceptor() {
+ return INTERCEPT_CLASS;
+ }
+
+ @Override
+ public boolean isOverrideArgs() {
+ return false;
+ }
+ }
+ };
+ }
+}
diff --git
a/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/websphereliberty/v23/define/IResponseInstrumentation.java
b/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/websphereliberty/v23/define/IResponseInstrumentation.java
new file mode 100644
index 0000000000..cc8be48132
--- /dev/null
+++
b/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/websphereliberty/v23/define/IResponseInstrumentation.java
@@ -0,0 +1,67 @@
+/*
+ * 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.websphereliberty.v23.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.match.ClassMatch;
+
+import static net.bytebuddy.matcher.ElementMatchers.named;
+import static
org.apache.skywalking.apm.agent.core.plugin.match.HierarchyMatch.byHierarchyMatch;
+
+public class IResponseInstrumentation extends AbstractWitnessInstrumentation {
+
+ private static final String ENHANCE_CLASS =
"com.ibm.websphere.servlet.response.IResponse";
+
+ private static final String INTERCEPT_CLASS =
"org.apache.skywalking.apm.plugin.websphereliberty.v23.IResponseInterceptor";
+
+ @Override
+ protected ClassMatch enhanceClass() {
+ return byHierarchyMatch(ENHANCE_CLASS);
+ }
+
+ @Override
+ public ConstructorInterceptPoint[] getConstructorsInterceptPoints() {
+ return null;
+ }
+
+ @Override
+ public InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints()
{
+ return new InstanceMethodsInterceptPoint[] {
+ new InstanceMethodsInterceptPoint() {
+ @Override
+ public ElementMatcher<MethodDescription> getMethodsMatcher() {
+ return named("setStatusCode");
+ }
+
+ @Override
+ public String getMethodsInterceptor() {
+ return INTERCEPT_CLASS;
+ }
+
+ @Override
+ public boolean isOverrideArgs() {
+ return false;
+ }
+ }
+ };
+ }
+}
diff --git
a/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/websphereliberty/v23/define/WebContainerInstrumentation.java
b/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/websphereliberty/v23/define/WebContainerInstrumentation.java
new file mode 100644
index 0000000000..68ca0096c4
--- /dev/null
+++
b/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/websphereliberty/v23/define/WebContainerInstrumentation.java
@@ -0,0 +1,67 @@
+/*
+ * 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.websphereliberty.v23.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.match.ClassMatch;
+
+import static net.bytebuddy.matcher.ElementMatchers.named;
+import static
org.apache.skywalking.apm.agent.core.plugin.match.NameMatch.byName;
+
+public class WebContainerInstrumentation extends
AbstractWitnessInstrumentation {
+
+ private static final String ENHANCE_CLASS =
"com.ibm.ws.webcontainer.WebContainer";
+
+ private static final String INTERCEPT_CLASS =
"org.apache.skywalking.apm.plugin.websphereliberty.v23.WebContainerInterceptor";
+
+ @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("handleRequest");
+ }
+
+ @Override
+ public String getMethodsInterceptor() {
+ return INTERCEPT_CLASS;
+ }
+
+ @Override
+ public boolean isOverrideArgs() {
+ return false;
+ }
+ }
+ };
+ }
+}
diff --git
a/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/src/main/resources/skywalking-plugin.def
b/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/src/main/resources/skywalking-plugin.def
new file mode 100644
index 0000000000..4427d7bb35
--- /dev/null
+++
b/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/src/main/resources/skywalking-plugin.def
@@ -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.
+
+websphere-liberty-23.x=org.apache.skywalking.apm.plugin.websphereliberty.v23.define.AsyncContextInstrumentation
+websphere-liberty-23.x=org.apache.skywalking.apm.plugin.websphereliberty.v23.define.DynamicVirtualHostInstrumentation
+websphere-liberty-23.x=org.apache.skywalking.apm.plugin.websphereliberty.v23.define.IResponseInstrumentation
+websphere-liberty-23.x=org.apache.skywalking.apm.plugin.websphereliberty.v23.define.WebContainerInstrumentation
diff --git
a/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/websphereliberty/v23/AsyncContextInterceptorTest.java
b/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/websphereliberty/v23/AsyncContextInterceptorTest.java
new file mode 100644
index 0000000000..f10d502710
--- /dev/null
+++
b/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/websphereliberty/v23/AsyncContextInterceptorTest.java
@@ -0,0 +1,156 @@
+/*
+ * 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.websphereliberty.v23;
+
+import com.ibm.websphere.servlet.request.IRequest;
+import java.util.List;
+import org.apache.skywalking.apm.agent.core.context.trace.AbstractTracingSpan;
+import org.apache.skywalking.apm.agent.core.context.trace.SpanLayer;
+import org.apache.skywalking.apm.agent.core.context.trace.TraceSegment;
+import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
+import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult;
+import org.apache.skywalking.apm.agent.test.helper.SegmentHelper;
+import org.apache.skywalking.apm.agent.test.tools.AgentServiceRule;
+import org.apache.skywalking.apm.agent.test.tools.SegmentStorage;
+import org.apache.skywalking.apm.agent.test.tools.SegmentStoragePoint;
+import org.apache.skywalking.apm.agent.test.tools.SpanAssert;
+import org.apache.skywalking.apm.agent.test.tools.TracingSegmentRunner;
+import org.apache.skywalking.apm.network.trace.component.ComponentsDefine;
+import
org.apache.skywalking.apm.plugin.websphereliberty.v23.async.RunnableWrapper;
+import org.hamcrest.CoreMatchers;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.junit.MockitoJUnit;
+import org.mockito.junit.MockitoRule;
+
+import static
org.apache.skywalking.apm.agent.test.tools.SpanAssert.assertComponent;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.mockito.Mockito.when;
+
+@RunWith(TracingSegmentRunner.class)
+public class AsyncContextInterceptorTest {
+
+ private AsyncContextInterceptor asyncContextInterceptor;
+ private WebContainerInterceptor handleRequestInterceptor;
+
+ @SegmentStoragePoint
+ private SegmentStorage segmentStorage;
+
+ @Rule
+ public AgentServiceRule serviceRule = new AgentServiceRule();
+ @Rule
+ public MockitoRule rule = MockitoJUnit.rule();
+
+ @Mock
+ private IRequest request;
+ @Mock
+ private EnhancedInstance response;
+
+ @Mock
+ private Runnable runnable;
+
+ @Mock
+ private MethodInterceptResult containerInterceptResult;
+ @Mock
+ private MethodInterceptResult asyncInterceptResult;
+
+ @Mock
+ private EnhancedInstance mockWebContainer;
+ @Mock
+ private EnhancedInstance mockAsyncContext;
+
+ private Object[] containerArguments;
+ private Class[] containerArgumentType;
+
+ private Object[] asyncArguments;
+ private Class[] asyncArgumentType;
+
+ @Before
+ public void setUp() throws Exception {
+ asyncContextInterceptor = new AsyncContextInterceptor();
+ handleRequestInterceptor = new WebContainerInterceptor();
+
+ when(request.getMethod()).thenReturn("GET");
+ when(request.getScheme()).thenReturn("http");
+ when(request.getServerName()).thenReturn("localhost");
+ when(request.getServerPort()).thenReturn(8080);
+ when(request.getRequestURI()).thenReturn("/test/testRequestURL");
+
+ when(response.getSkyWalkingDynamicField()).thenReturn(200);
+
+ containerArguments = new Object[] {
+ request,
+ response
+ };
+ containerArgumentType = new Class[] {
+ request.getClass(),
+ response.getClass()
+ };
+
+ asyncArguments = new Object[] {
+ runnable
+ };
+ asyncArgumentType = new Class[] {
+ runnable.getClass()
+ };
+ }
+
+ @Test
+ public void testAsyncContext() throws Throwable {
+ handleRequestInterceptor.beforeMethod(mockWebContainer, null,
containerArguments, containerArgumentType,
+ containerInterceptResult
+ );
+
+ asyncContextInterceptor.beforeMethod(
+ mockAsyncContext, null, asyncArguments, asyncArgumentType,
asyncInterceptResult);
+
+ Thread thread = new Thread(() -> {
+ RunnableWrapper runnableWrappers = (RunnableWrapper)
asyncArguments[0];
+ runnableWrappers.run();
+ });
+
+ asyncContextInterceptor.afterMethod(mockAsyncContext, null,
asyncArguments, asyncArgumentType, null);
+ handleRequestInterceptor.afterMethod(mockWebContainer, null,
containerArguments, containerArgumentType, null);
+
+ thread.start();
+ thread.join();
+
+ assertThat(segmentStorage.getTraceSegments().size(), is(2));
+
+ Assert.assertEquals(
+ segmentStorage.getTraceSegments().get(0).getRelatedGlobalTrace(),
+ segmentStorage.getTraceSegments().get(1).getRelatedGlobalTrace()
+ );
+
+ TraceSegment traceSegment = segmentStorage.getTraceSegments().get(0);
+ List<AbstractTracingSpan> spans = SegmentHelper.getSpans(traceSegment);
+ assertAsyncSpan(spans.get(0));
+ }
+
+ private void assertAsyncSpan(AbstractTracingSpan span) {
+ assertThat(span.getOperationName(),
CoreMatchers.startsWith("WebSphereAsync"));
+ assertComponent(span, ComponentsDefine.JDK_THREADING);
+ SpanAssert.assertLayer(span, SpanLayer.HTTP);
+ }
+}
diff --git
a/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/websphereliberty/v23/DynamicVirtualHostInterceptorTest.java
b/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/websphereliberty/v23/DynamicVirtualHostInterceptorTest.java
new file mode 100644
index 0000000000..00c0b8c98a
--- /dev/null
+++
b/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/websphereliberty/v23/DynamicVirtualHostInterceptorTest.java
@@ -0,0 +1,125 @@
+/*
+ * 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.websphereliberty.v23;
+
+import com.ibm.websphere.servlet.request.IRequest;
+import java.util.List;
+import org.apache.skywalking.apm.agent.core.context.SW8CarrierItem;
+import org.apache.skywalking.apm.agent.core.context.trace.AbstractTracingSpan;
+import org.apache.skywalking.apm.agent.core.context.trace.SpanLayer;
+import org.apache.skywalking.apm.agent.core.context.trace.TraceSegment;
+import org.apache.skywalking.apm.agent.core.context.trace.TraceSegmentRef;
+import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
+import org.apache.skywalking.apm.agent.test.helper.SegmentHelper;
+import org.apache.skywalking.apm.agent.test.helper.SegmentRefHelper;
+import org.apache.skywalking.apm.agent.test.tools.AgentServiceRule;
+import org.apache.skywalking.apm.agent.test.tools.SegmentStorage;
+import org.apache.skywalking.apm.agent.test.tools.SegmentStoragePoint;
+import org.apache.skywalking.apm.agent.test.tools.SpanAssert;
+import org.apache.skywalking.apm.agent.test.tools.TracingSegmentRunner;
+import org.apache.skywalking.apm.network.trace.component.ComponentsDefine;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.junit.MockitoJUnit;
+import org.mockito.junit.MockitoRule;
+
+import static
org.apache.skywalking.apm.agent.test.tools.SpanAssert.assertComponent;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.mockito.Mockito.when;
+
+@RunWith(TracingSegmentRunner.class)
+public class DynamicVirtualHostInterceptorTest {
+
+ private DynamicVirtualHostInterceptor virtualHostInterceptor;
+
+ @SegmentStoragePoint
+ private SegmentStorage segmentStorage;
+
+ @Rule
+ public AgentServiceRule serviceRule = new AgentServiceRule();
+ @Rule
+ public MockitoRule rule = MockitoJUnit.rule();
+
+ @Mock
+ private IRequest request;
+ @Mock
+ private EnhancedInstance response;
+
+ @Mock
+ private EnhancedInstance enhancedInstance;
+
+ private Object[] arguments;
+ private Class[] argumentType;
+
+ @Before
+ public void setUp() throws Exception {
+ virtualHostInterceptor = new DynamicVirtualHostInterceptor();
+
+ when(request.getMethod()).thenReturn("GET");
+ when(request.getScheme()).thenReturn("http");
+ when(request.getServerName()).thenReturn("localhost");
+ when(request.getServerPort()).thenReturn(8080);
+ when(request.getRequestURI()).thenReturn("/test/testRequestURL");
+
+ arguments = new Object[] {
+ request,
+ response
+ };
+ argumentType = new Class[] {
+ request.getClass(),
+ response.getClass()
+ };
+ }
+
+ @Test
+ public void testContextRootNotFound() throws Throwable {
+ when(request.getHeader(
+ SW8CarrierItem.HEADER_NAME)).thenReturn(
+
"1-My40LjU=-MS4yLjM=-3-c2VydmljZQ==-aW5zdGFuY2U=-L2FwcA==-MTI3LjAuMC4xOjgwODA=");
+
+ virtualHostInterceptor.afterMethod(enhancedInstance, null, arguments,
argumentType, null);
+
+ assertThat(segmentStorage.getTraceSegments().size(), is(1));
+ TraceSegment traceSegment = segmentStorage.getTraceSegments().get(0);
+ List<AbstractTracingSpan> spans = SegmentHelper.getSpans(traceSegment);
+
+ assertHttpSpan(spans.get(0));
+ assertTraceSegmentRef(traceSegment.getRef());
+ }
+
+ private void assertTraceSegmentRef(TraceSegmentRef ref) {
+ assertThat(SegmentRefHelper.getParentServiceInstance(ref),
is("instance"));
+ assertThat(SegmentRefHelper.getSpanId(ref), is(3));
+ assertThat(SegmentRefHelper.getTraceSegmentId(ref), is("3.4.5"));
+ }
+
+ private void assertHttpSpan(AbstractTracingSpan span) {
+ assertThat(span.getOperationName(), is("GET:/test/testRequestURL"));
+ assertComponent(span, ComponentsDefine.WEBSPHERE);
+ SpanAssert.assertTag(span, 0,
"http://localhost:8080/test/testRequestURL");
+ SpanAssert.assertTag(span, 1, "GET");
+ SpanAssert.assertTag(span, 2, "404");
+ assertThat(span.isEntry(), is(true));
+ SpanAssert.assertLayer(span, SpanLayer.HTTP);
+ }
+}
diff --git
a/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/websphereliberty/v23/IResponseInterceptorTest.java
b/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/websphereliberty/v23/IResponseInterceptorTest.java
new file mode 100644
index 0000000000..c220abef24
--- /dev/null
+++
b/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/websphereliberty/v23/IResponseInterceptorTest.java
@@ -0,0 +1,83 @@
+/*
+ * 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.websphereliberty.v23;
+
+import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
+import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult;
+import org.apache.skywalking.apm.agent.test.tools.AgentServiceRule;
+import org.apache.skywalking.apm.agent.test.tools.SegmentStorage;
+import org.apache.skywalking.apm.agent.test.tools.SegmentStoragePoint;
+import org.apache.skywalking.apm.agent.test.tools.TracingSegmentRunner;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.junit.MockitoJUnit;
+import org.mockito.junit.MockitoRule;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.mockito.Mockito.when;
+
+@RunWith(TracingSegmentRunner.class)
+public class IResponseInterceptorTest {
+ private IResponseInterceptor setStatusCodeInterceptor;
+
+ @SegmentStoragePoint
+ private SegmentStorage segmentStorage;
+
+ @Rule
+ public AgentServiceRule serviceRule = new AgentServiceRule();
+ @Rule
+ public MockitoRule rule = MockitoJUnit.rule();
+
+ @Mock
+ private MethodInterceptResult methodInterceptResult;
+
+ @Mock
+ private EnhancedInstance enhancedInstance;
+
+ private Object[] arguments;
+ private Class[] argumentType;
+
+ @Before
+ public void setUp() throws Exception {
+ setStatusCodeInterceptor = new IResponseInterceptor();
+
+ int httpCode = 200;
+ arguments = new Object[] {
+ httpCode
+ };
+ argumentType = new Class[] {
+ Integer.class
+ };
+
+
when(enhancedInstance.getSkyWalkingDynamicField()).thenReturn(httpCode);
+
+ }
+
+ @Test
+ public void testSetStatusCode() throws Throwable {
+ setStatusCodeInterceptor.beforeMethod(enhancedInstance, null,
arguments, argumentType, methodInterceptResult);
+ setStatusCodeInterceptor.afterMethod(enhancedInstance, null,
arguments, argumentType, null);
+
+ assertThat(enhancedInstance.getSkyWalkingDynamicField(), is(200));
+ }
+}
diff --git
a/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/websphereliberty/v23/WebContainerInterceptorTest.java
b/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/websphereliberty/v23/WebContainerInterceptorTest.java
new file mode 100644
index 0000000000..29bdf5d95f
--- /dev/null
+++
b/apm-sniffer/apm-sdk-plugin/websphere-liberty-23.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/websphereliberty/v23/WebContainerInterceptorTest.java
@@ -0,0 +1,159 @@
+/*
+ * 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.websphereliberty.v23;
+
+import com.ibm.websphere.servlet.request.IRequest;
+import java.util.List;
+import org.apache.skywalking.apm.agent.core.context.SW8CarrierItem;
+import org.apache.skywalking.apm.agent.core.context.trace.AbstractTracingSpan;
+import org.apache.skywalking.apm.agent.core.context.trace.LogDataEntity;
+import org.apache.skywalking.apm.agent.core.context.trace.SpanLayer;
+import org.apache.skywalking.apm.agent.core.context.trace.TraceSegment;
+import org.apache.skywalking.apm.agent.core.context.trace.TraceSegmentRef;
+import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
+import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult;
+import org.apache.skywalking.apm.agent.test.helper.SegmentHelper;
+import org.apache.skywalking.apm.agent.test.helper.SegmentRefHelper;
+import org.apache.skywalking.apm.agent.test.helper.SpanHelper;
+import org.apache.skywalking.apm.agent.test.tools.AgentServiceRule;
+import org.apache.skywalking.apm.agent.test.tools.SegmentStorage;
+import org.apache.skywalking.apm.agent.test.tools.SegmentStoragePoint;
+import org.apache.skywalking.apm.agent.test.tools.SpanAssert;
+import org.apache.skywalking.apm.agent.test.tools.TracingSegmentRunner;
+import org.apache.skywalking.apm.network.trace.component.ComponentsDefine;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.junit.MockitoJUnit;
+import org.mockito.junit.MockitoRule;
+
+import static
org.apache.skywalking.apm.agent.test.tools.SpanAssert.assertComponent;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.mockito.Mockito.when;
+
+@RunWith(TracingSegmentRunner.class)
+public class WebContainerInterceptorTest {
+
+ private WebContainerInterceptor handleRequestInterceptor;
+
+ @SegmentStoragePoint
+ private SegmentStorage segmentStorage;
+
+ @Rule
+ public AgentServiceRule serviceRule = new AgentServiceRule();
+ @Rule
+ public MockitoRule rule = MockitoJUnit.rule();
+
+ @Mock
+ private IRequest request;
+ @Mock
+ private EnhancedInstance response;
+ @Mock
+ private MethodInterceptResult methodInterceptResult;
+
+ @Mock
+ private EnhancedInstance enhancedInstance;
+
+ private Object[] arguments;
+ private Class[] argumentType;
+
+ @Before
+ public void setUp() throws Exception {
+ handleRequestInterceptor = new WebContainerInterceptor();
+
+ when(request.getMethod()).thenReturn("GET");
+ when(request.getScheme()).thenReturn("http");
+ when(request.getServerName()).thenReturn("localhost");
+ when(request.getServerPort()).thenReturn(8080);
+ when(request.getRequestURI()).thenReturn("/test/testRequestURL");
+
+ when(response.getSkyWalkingDynamicField()).thenReturn(200);
+
+ arguments = new Object[] {
+ request,
+ response
+ };
+ argumentType = new Class[] {
+ request.getClass(),
+ response.getClass()
+ };
+ }
+
+ @Test
+ public void testWithoutSerializedContextData() throws Throwable {
+ handleRequestInterceptor.beforeMethod(enhancedInstance, null,
arguments, argumentType, methodInterceptResult);
+ handleRequestInterceptor.afterMethod(enhancedInstance, null,
arguments, argumentType, null);
+
+ assertThat(segmentStorage.getTraceSegments().size(), is(1));
+ TraceSegment traceSegment = segmentStorage.getTraceSegments().get(0);
+ List<AbstractTracingSpan> spans = SegmentHelper.getSpans(traceSegment);
+ assertHttpSpan(spans.get(0));
+ }
+
+ @Test
+ public void testWithSerializedContextData() throws Throwable {
+ when(request.getHeader(
+ SW8CarrierItem.HEADER_NAME)).thenReturn(
+
"1-My40LjU=-MS4yLjM=-3-c2VydmljZQ==-aW5zdGFuY2U=-L2FwcA==-MTI3LjAuMC4xOjgwODA=");
+
+ handleRequestInterceptor.beforeMethod(enhancedInstance, null,
arguments, argumentType, methodInterceptResult);
+ handleRequestInterceptor.afterMethod(enhancedInstance, null,
arguments, argumentType, null);
+
+ assertThat(segmentStorage.getTraceSegments().size(), is(1));
+ TraceSegment traceSegment = segmentStorage.getTraceSegments().get(0);
+ List<AbstractTracingSpan> spans = SegmentHelper.getSpans(traceSegment);
+
+ assertHttpSpan(spans.get(0));
+ assertTraceSegmentRef(traceSegment.getRef());
+ }
+
+ @Test
+ public void testWithOccurException() throws Throwable {
+ handleRequestInterceptor.beforeMethod(enhancedInstance, null,
arguments, argumentType, methodInterceptResult);
+ handleRequestInterceptor.handleMethodException(
+ enhancedInstance, null, arguments, argumentType, new
RuntimeException());
+ handleRequestInterceptor.afterMethod(enhancedInstance, null,
arguments, argumentType, null);
+
+ assertThat(segmentStorage.getTraceSegments().size(), is(1));
+ TraceSegment traceSegment = segmentStorage.getTraceSegments().get(0);
+ List<AbstractTracingSpan> spans = SegmentHelper.getSpans(traceSegment);
+
+ assertHttpSpan(spans.get(0));
+ List<LogDataEntity> logDataEntities = SpanHelper.getLogs(spans.get(0));
+ assertThat(logDataEntities.size(), is(1));
+ SpanAssert.assertException(logDataEntities.get(0),
RuntimeException.class);
+ }
+
+ private void assertTraceSegmentRef(TraceSegmentRef ref) {
+ assertThat(SegmentRefHelper.getParentServiceInstance(ref),
is("instance"));
+ assertThat(SegmentRefHelper.getSpanId(ref), is(3));
+ assertThat(SegmentRefHelper.getTraceSegmentId(ref), is("3.4.5"));
+ }
+
+ private void assertHttpSpan(AbstractTracingSpan span) {
+ assertThat(span.getOperationName(), is("GET:/test/testRequestURL"));
+ assertComponent(span, ComponentsDefine.WEBSPHERE);
+ SpanAssert.assertTag(span, 0,
"http://localhost:8080/test/testRequestURL");
+ assertThat(span.isEntry(), is(true));
+ SpanAssert.assertLayer(span, SpanLayer.HTTP);
+ }
+}
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 3aed87c67e..80d613f6d1 100644
--- a/docs/en/setup/service-agent/java-agent/Plugin-list.md
+++ b/docs/en/setup/service-agent/java-agent/Plugin-list.md
@@ -166,3 +166,4 @@
- grizzly-2.3.x-4.x-threadpool
- jetty-server-11.x
- jetty-client-11.x
+- websphere-liberty-23.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 e9f7b36dbc..43832d4d47 100644
--- a/docs/en/setup/service-agent/java-agent/Supported-list.md
+++ b/docs/en/setup/service-agent/java-agent/Supported-list.md
@@ -24,6 +24,7 @@ metrics based on the tracing data.
* [Micronaut HTTP
Server](https://github.com/micronaut-projects/micronaut-core) 3.2.x -> 3.6.x
* [Jersey REST framework](https://github.com/eclipse-ee4j/jersey) 2.x -> 3.x
* [Grizzly](https://github.com/eclipse-ee4j/grizzly) 2.3.x -> 4.x
+ * [WebSphere Liberty](https://github.com/OpenLiberty/open-liberty) 23.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/pom.xml b/pom.xml
index 4214f83f9c..137046b820 100755
--- a/pom.xml
+++ b/pom.xml
@@ -424,7 +424,11 @@
org/apache/skywalking/oap/server/configuration/service/*.java,
**/jmh_generated/*_jmhType*.java,
**/jmh_generated/*_jmhTest.java,
- net/bytebuddy/**
+ net/bytebuddy/**,
+ <!-- Exclude compiling auxiliary classes in WebSphere
Liberty plugin-->
+ com/ibm/websphere/servlet/request/IRequest.java,
+ com/ibm/ws/webcontainer/async/CompleteRunnable.java,
+ com/ibm/ws/webcontainer/async/DispatchRunnable.java
</excludes>
<propertyExpansion>
import.control=${maven.multiModuleProjectDirectory}/apm-checkstyle/importControl.xml
diff --git
a/test/plugin/scenarios/websphere-liberty-23.x-scenario/bin/startup.sh
b/test/plugin/scenarios/websphere-liberty-23.x-scenario/bin/startup.sh
new file mode 100644
index 0000000000..38a7067830
--- /dev/null
+++ b/test/plugin/scenarios/websphere-liberty-23.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}
"-Dorg.osgi.framework.bootdelegation=org.apache.skywalking.apm.*"
${home}/../libs/websphere-liberty-23.x-scenario.jar &
\ No newline at end of file
diff --git
a/test/plugin/scenarios/websphere-liberty-23.x-scenario/config/expectedData.yaml
b/test/plugin/scenarios/websphere-liberty-23.x-scenario/config/expectedData.yaml
new file mode 100644
index 0000000000..bff127eb26
--- /dev/null
+++
b/test/plugin/scenarios/websphere-liberty-23.x-scenario/config/expectedData.yaml
@@ -0,0 +1,95 @@
+# 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: websphere-liberty-23.x-scenario
+ segmentSize: ge 3
+ segments:
+ - segmentId: not null
+ spans:
+ - operationName:
POST:/websphere-liberty-23.x-scenario/case/websphere-liberty-23.x-scenario
+ operationId: 0
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 148
+ isError: false
+ spanType: Entry
+ peer: ''
+ skipAnalysis: false
+ tags:
+ - {key: url, value:
'http://localhost:9080/websphere-liberty-23.x-scenario/case/websphere-liberty-23.x-scenario'}
+ - {key: http.method, value: POST}
+ - {key: http.status_code, value: "200"}
+ refs:
+ - {parentEndpoint: 'WebSphereAsync/start', networkAddress:
'localhost:9080',
+ refType: CrossProcess, parentSpanId: 1, parentTraceSegmentId:
not null,
+ parentServiceInstance: not null, parentService:
websphere-liberty-23.x-scenario,
+ traceId: not null}
+ - segmentId: not null
+ spans:
+ - operationName:
/websphere-liberty-23.x-scenario/case/websphere-liberty-23.x-scenario
+ operationId: 0
+ parentSpanId: 0
+ spanId: 1
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 2
+ isError: false
+ spanType: Exit
+ peer: localhost:9080
+ skipAnalysis: false
+ tags:
+ - {key: url, value:
'http://localhost:9080/websphere-liberty-23.x-scenario/case/websphere-liberty-23.x-scenario'}
+ - {key: http.method, value: POST}
+ - {key: http.status_code, value: "200"}
+ - operationName: WebSphereAsync/start
+ operationId: 0
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 80
+ isError: false
+ spanType: Local
+ peer: ''
+ skipAnalysis: false
+ refs:
+ - { parentEndpoint:
'GET:/websphere-liberty-23.x-scenario/case/websphere-liberty-23.x-scenario',
networkAddress: '',
+ refType: CrossThread, parentSpanId: 0, parentTraceSegmentId:
not null,
+ parentServiceInstance: not null, parentService:
websphere-liberty-23.x-scenario,
+ traceId: not null }
+ - segmentId: not null
+ spans:
+ - operationName:
GET:/websphere-liberty-23.x-scenario/case/websphere-liberty-23.x-scenario
+ operationId: 0
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 148
+ isError: false
+ spanType: Entry
+ peer: ''
+ skipAnalysis: false
+ tags:
+ - {key: url, value:
'http://localhost:9080/websphere-liberty-23.x-scenario/case/websphere-liberty-23.x-scenario'}
+ - {key: http.method, value: GET}
+ - {key: http.status_code, value: "200"}
\ No newline at end of file
diff --git
a/test/plugin/scenarios/websphere-liberty-23.x-scenario/configuration.yml
b/test/plugin/scenarios/websphere-liberty-23.x-scenario/configuration.yml
new file mode 100644
index 0000000000..b9a8bfb6bf
--- /dev/null
+++ b/test/plugin/scenarios/websphere-liberty-23.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:9080/websphere-liberty-23.x-scenario/case/websphere-liberty-23.x-scenario
+healthCheck:
http://localhost:9080/websphere-liberty-23.x-scenario/case/healthCheck
+startScript: ./bin/startup.sh
diff --git a/test/plugin/scenarios/websphere-liberty-23.x-scenario/pom.xml
b/test/plugin/scenarios/websphere-liberty-23.x-scenario/pom.xml
new file mode 100644
index 0000000000..a5f3db22fe
--- /dev/null
+++ b/test/plugin/scenarios/websphere-liberty-23.x-scenario/pom.xml
@@ -0,0 +1,136 @@
+<?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>websphere-liberty-23.x-scenario</artifactId>
+ <version>1.0.0</version>
+ <packaging>war</packaging>
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <compiler.version>1.8</compiler.version>
+ <maven-war-plugin.version>3.3.2</maven-war-plugin.version>
+ <maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
+ <liberty-maven-plugin.version>3.7.1</liberty-maven-plugin.version>
+ <jakarta.servlet-api.version>5.0.0</jakarta.servlet-api.version>
+ <http-client.version>4.3</http-client.version>
+ <test.framework.version>23.0.0.5</test.framework.version>
+ </properties>
+
+ <name>skywalking-websphere-liberty-23.x-scenario</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>jakarta.servlet</groupId>
+ <artifactId>jakarta.servlet-api</artifactId>
+ <version>${jakarta.servlet-api.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpclient</artifactId>
+ <version>${http-client.version}</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>websphere-liberty-23.x-scenario</finalName>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>${maven-compiler-plugin.version}</version>
+ <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-war-plugin</artifactId>
+ <version>${maven-war-plugin.version}</version>
+ </plugin>
+ <plugin>
+ <groupId>io.openliberty.tools</groupId>
+ <artifactId>liberty-maven-plugin</artifactId>
+ <version>${liberty-maven-plugin.version}</version>
+ <executions>
+ <execution>
+ <id>install-feature</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>create</goal>
+ <goal>install-feature</goal>
+ <goal>deploy</goal>
+ </goals>
+ <configuration>
+ <features>
+ <acceptLicense>true</acceptLicense>
+ </features>
+ </configuration>
+ </execution>
+ <execution>
+ <id>package-server</id>
+ <phase>package</phase>
+ <goals>
+ <goal>package</goal>
+ </goals>
+ <configuration>
+
<packageName>${project.build.finalName}</packageName>
+ <packageType>jar</packageType>
+ <include>runnable</include>
+ </configuration>
+ </execution>
+ </executions>
+ <configuration>
+ <runtimeArtifact>
+ <groupId>com.ibm.websphere.appserver.runtime</groupId>
+ <artifactId>wlp-kernel</artifactId>
+ <version>${test.framework.version}</version>
+ <type>zip</type>
+ </runtimeArtifact>
+ </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/websphere-liberty-23.x-scenario/src/main/assembly/assembly.xml
b/test/plugin/scenarios/websphere-liberty-23.x-scenario/src/main/assembly/assembly.xml
new file mode 100644
index 0000000000..65a5414818
--- /dev/null
+++
b/test/plugin/scenarios/websphere-liberty-23.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}/websphere-liberty-23.x-scenario.jar</source>
+ <outputDirectory>./libs</outputDirectory>
+ <fileMode>0775</fileMode>
+ </file>
+ </files>
+</assembly>
diff --git
a/test/plugin/scenarios/websphere-liberty-23.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/websphereliberty/CaseServlet.java
b/test/plugin/scenarios/websphere-liberty-23.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/websphereliberty/CaseServlet.java
new file mode 100644
index 0000000000..5b7bc8b3e6
--- /dev/null
+++
b/test/plugin/scenarios/websphere-liberty-23.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/websphereliberty/CaseServlet.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.testcase.websphereliberty;
+
+import jakarta.servlet.AsyncContext;
+import jakarta.servlet.http.HttpServlet;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.PrintWriter;
+import org.apache.http.HttpEntity;
+import org.apache.http.client.ResponseHandler;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.util.EntityUtils;
+
+public class CaseServlet extends HttpServlet {
+
+ @Override
+ protected void doGet(HttpServletRequest req, HttpServletResponse resp) {
+ AsyncContext asyncContext = req.startAsync();
+ asyncContext.start(() -> {
+ try (CloseableHttpClient httpClient = HttpClients.createDefault();
PrintWriter writer = resp.getWriter()) {
+ HttpPost httpPost = new HttpPost(
+
"http://localhost:9080/websphere-liberty-23.x-scenario/case/websphere-liberty-23.x-scenario");
+ ResponseHandler<String> responseHandler = response -> {
+ HttpEntity entity = response.getEntity();
+ return entity != null ? EntityUtils.toString(entity) :
null;
+ };
+ httpClient.execute(httpPost, responseHandler);
+
+ writer.write("Success");
+ writer.flush();
+ } catch (IOException e) {
+ // ignore
+ } finally {
+ asyncContext.complete();
+ }
+ });
+ }
+
+ @Override
+ protected void doPost(HttpServletRequest req, HttpServletResponse resp)
throws IOException {
+ PrintWriter writer = resp.getWriter();
+ writer.write("Success");
+ writer.flush();
+ writer.close();
+ }
+}
diff --git
a/test/plugin/scenarios/websphere-liberty-23.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/websphereliberty/HealthCheckServlet.java
b/test/plugin/scenarios/websphere-liberty-23.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/websphereliberty/HealthCheckServlet.java
new file mode 100644
index 0000000000..4e8637eefa
--- /dev/null
+++
b/test/plugin/scenarios/websphere-liberty-23.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/websphereliberty/HealthCheckServlet.java
@@ -0,0 +1,39 @@
+/*
+ * 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.websphereliberty;
+
+import jakarta.servlet.http.HttpServlet;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.PrintWriter;
+
+public class HealthCheckServlet extends HttpServlet {
+
+ @Override
+ protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws IOException {
+ PrintWriter writer = resp.getWriter();
+ writer.write("Success");
+ writer.flush();
+ }
+
+ @Override
+ protected void doPost(HttpServletRequest req, HttpServletResponse resp)
throws IOException {
+ doGet(req, resp);
+ }
+}
diff --git
a/test/plugin/scenarios/websphere-liberty-23.x-scenario/src/main/liberty/config/server.xml
b/test/plugin/scenarios/websphere-liberty-23.x-scenario/src/main/liberty/config/server.xml
new file mode 100755
index 0000000000..b0235f6516
--- /dev/null
+++
b/test/plugin/scenarios/websphere-liberty-23.x-scenario/src/main/liberty/config/server.xml
@@ -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.
+ ~
+ -->
+<server description="Sample Liberty server">
+ <featureManager>
+ <feature>servlet-5.0</feature>
+ </featureManager>
+
+ <variable name="default.http.port" defaultValue="9080"/>
+ <variable name="default.https.port" defaultValue="9443"/>
+
+ <webApplication location="websphere-liberty-23.x-scenario.war"
contextRoot="/websphere-liberty-23.x-scenario" />
+
+ <httpEndpoint host="*" httpPort="${default.http.port}"
+ httpsPort="${default.https.port}" id="defaultHttpEndpoint"/>
+</server>
diff --git
a/test/plugin/scenarios/websphere-liberty-23.x-scenario/src/main/resources/log4j2.xml
b/test/plugin/scenarios/websphere-liberty-23.x-scenario/src/main/resources/log4j2.xml
new file mode 100644
index 0000000000..9849ed5a8a
--- /dev/null
+++
b/test/plugin/scenarios/websphere-liberty-23.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/websphere-liberty-23.x-scenario/src/main/webapp/WEB-INF/web.xml
b/test/plugin/scenarios/websphere-liberty-23.x-scenario/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000000..ca2d8b6e04
--- /dev/null
+++
b/test/plugin/scenarios/websphere-liberty-23.x-scenario/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,44 @@
+<!--
+ ~ 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.
+ ~
+ -->
+<web-app xmlns="https://jakarta.ee/xml/ns/jakartaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee
+ https://jakarta.ee/xml/ns/jakartaee/web-app_5_0.xsd"
+ version="5.0">
+ <display-name>skywalking-websphere-liberty-23.x-scenario</display-name>
+
+ <servlet>
+ <servlet-name>caseServlet</servlet-name>
+
<servlet-class>org.apache.skywalking.apm.testcase.websphereliberty.CaseServlet</servlet-class>
+ <async-supported>true</async-supported>
+ </servlet>
+
+ <servlet>
+ <servlet-name>healthCheckServlet</servlet-name>
+
<servlet-class>org.apache.skywalking.apm.testcase.websphereliberty.HealthCheckServlet</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>caseServlet</servlet-name>
+ <url-pattern>/case/websphere-liberty-23.x-scenario</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>healthCheckServlet</servlet-name>
+ <url-pattern>/case/healthCheck</url-pattern>
+ </servlet-mapping>
+</web-app>
diff --git
a/test/plugin/scenarios/websphere-liberty-23.x-scenario/support-version.list
b/test/plugin/scenarios/websphere-liberty-23.x-scenario/support-version.list
new file mode 100644
index 0000000000..cb54ff0ad9
--- /dev/null
+++ b/test/plugin/scenarios/websphere-liberty-23.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.
+
+# lists your version here (Contains only the last version number of each minor
version.)
+23.0.0.5