You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2024/04/26 06:01:18 UTC

(skywalking-java) branch main updated: Add support for C3P0 connection pool tracing (#683)

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 d37ee271c4 Add support for C3P0 connection pool tracing (#683)
d37ee271c4 is described below

commit d37ee271c46221014beb8fcdd04b6aeb3badb5fa
Author: Chen Ziyan <cl...@gmail.com>
AuthorDate: Fri Apr 26 14:01:13 2024 +0800

    Add support for C3P0 connection pool tracing (#683)
---
 .github/workflows/plugins-jdk17-test.1.yaml        |   2 +
 CHANGES.md                                         |   1 +
 .../network/trace/component/ComponentsDefine.java  |   3 +
 .../apm-sdk-plugin/c3p0-0.9.x-plugin/pom.xml       |  49 ++++
 .../skywalking/apm/plugin/c3p0/PoolConstants.java  |  34 +++
 .../c3p0/PoolingConnectionCloseInterceptor.java    |  62 +++++
 .../c3p0/PoolingConnectionGetInterceptor.java      |  61 +++++
 .../plugin/c3p0/PoolingCreationInterceptor.java    | 132 ++++++++++
 .../C3P0NewProxyConnectionInstrumentation.java     |  72 ++++++
 .../define/C3P0PoolManagerInstrumentation.java     |  72 ++++++
 .../C3P0PooledDataSourceInstrumentation.java       |  72 ++++++
 .../src/main/resources/skywalking-plugin.def       |  19 ++
 apm-sniffer/apm-sdk-plugin/pom.xml                 |   1 +
 .../setup/service-agent/java-agent/Plugin-list.md  |   1 +
 .../service-agent/java-agent/Supported-list.md     |   6 +
 .../c3p0-0.9.0.x-0.9.1.x-scenario/bin/startup.sh   |  21 ++
 .../config/expectedData.yaml                       | 288 +++++++++++++++++++++
 .../configuration.yml                              |  32 +++
 .../c3p0-0.9.0.x-0.9.1.x-scenario/pom.xml          | 127 +++++++++
 .../src/main/assembly/assembly.xml                 |  41 +++
 .../apm/testcase/c3p0/c3p0/Application.java        |  34 +++
 .../apm/testcase/c3p0/c3p0/MysqlConfig.java        |  57 ++++
 .../c3p0/c3p0/controller/CaseController.java       |  58 +++++
 .../testcase/c3p0/c3p0/service/CaseService.java    |  72 ++++++
 .../src/main/resources/application.yaml            |  23 ++
 .../src/main/resources/jdbc.properties             |  19 ++
 .../src/main/resources/log4j2.xml                  |  30 +++
 .../support-version.list                           |  18 ++
 .../c3p0-0.9.2.x-0.10.x-scenario/bin/startup.sh    |  21 ++
 .../config/expectedData.yaml                       | 288 +++++++++++++++++++++
 .../c3p0-0.9.2.x-0.10.x-scenario/configuration.yml |  32 +++
 .../scenarios/c3p0-0.9.2.x-0.10.x-scenario/pom.xml | 127 +++++++++
 .../src/main/assembly/assembly.xml                 |  41 +++
 .../apm/testcase/c3p0/mchange/Application.java     |  34 +++
 .../apm/testcase/c3p0/mchange/MysqlConfig.java     |  57 ++++
 .../c3p0/mchange/controller/CaseController.java    |  58 +++++
 .../testcase/c3p0/mchange/service/CaseService.java |  73 ++++++
 .../src/main/resources/application.yaml            |  23 ++
 .../src/main/resources/jdbc.properties             |  19 ++
 .../src/main/resources/log4j2.xml                  |  30 +++
 .../support-version.list                           |  19 ++
 41 files changed, 2229 insertions(+)

diff --git a/.github/workflows/plugins-jdk17-test.1.yaml b/.github/workflows/plugins-jdk17-test.1.yaml
index d469d4c2ef..61bb8fa75a 100644
--- a/.github/workflows/plugins-jdk17-test.1.yaml
+++ b/.github/workflows/plugins-jdk17-test.1.yaml
@@ -60,6 +60,8 @@ jobs:
           - gateway-4.x-scenario
           - httpexchange-scenario
           - activemq-artemis-2.x-scenario
+          - c3p0-0.9.0.x-0.9.1.x-scenario
+          - c3p0-0.9.2.x-0.10.x-scenario
     steps:
       - uses: actions/checkout@v2
         with:
diff --git a/CHANGES.md b/CHANGES.md
index dfe870b619..790ba4c6dc 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -7,6 +7,7 @@ Release Notes.
 
 * Remove `idleCount` tag in Alibaba Druid meter plugin.
 * Fix NPE in handleMethodException method of apm-jdk-threadpool-plugin.
+* Support for C3P0 connection pool tracing.
 
 All issues and pull requests are [here](https://github.com/apache/skywalking/milestone/213?closed=1)
 
diff --git a/apm-protocol/apm-network/src/main/java/org/apache/skywalking/apm/network/trace/component/ComponentsDefine.java b/apm-protocol/apm-network/src/main/java/org/apache/skywalking/apm/network/trace/component/ComponentsDefine.java
index 2334cb58e0..5364ff0eda 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
@@ -244,4 +244,7 @@ public class ComponentsDefine {
     public static final OfficialComponent NACOS = new OfficialComponent(150, "Nacos");
 
     public static final OfficialComponent NETTY_HTTP = new OfficialComponent(151, "Netty-http");
+
+    public static final OfficialComponent C3P0 = new OfficialComponent(152, "c3p0");
+
 }
diff --git a/apm-sniffer/apm-sdk-plugin/c3p0-0.9.x-plugin/pom.xml b/apm-sniffer/apm-sdk-plugin/c3p0-0.9.x-plugin/pom.xml
new file mode 100644
index 0000000000..3d61e4cc0d
--- /dev/null
+++ b/apm-sniffer/apm-sdk-plugin/c3p0-0.9.x-plugin/pom.xml
@@ -0,0 +1,49 @@
+<?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.3.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>apm-c3p0-0.9.x-plugin</artifactId>
+    <packaging>jar</packaging>
+    <name>c3p0-0.9.x-plugin</name>
+
+    <properties>
+        <c3p0.version>0.9.5</c3p0.version>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.mchange</groupId>
+            <artifactId>c3p0</artifactId>
+            <version>${c3p0.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.skywalking</groupId>
+            <artifactId>apm-jdbc-commons</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+    </dependencies>
+</project>
diff --git a/apm-sniffer/apm-sdk-plugin/c3p0-0.9.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/c3p0/PoolConstants.java b/apm-sniffer/apm-sdk-plugin/c3p0-0.9.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/c3p0/PoolConstants.java
new file mode 100644
index 0000000000..4536cd5112
--- /dev/null
+++ b/apm-sniffer/apm-sdk-plugin/c3p0-0.9.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/c3p0/PoolConstants.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.skywalking.apm.plugin.c3p0;
+
+public class PoolConstants {
+    public static final String POOL_CONNECTION = "C3P0/Connection/";
+    public static final String METER_NAME = "datasource";
+    public static final String METER_TAG_NAME = "name";
+    public static final String METER_TAG_STATUS = "status";
+
+    //==================== METRICS ========================//
+    public static final String NUM_TOTAL_CONNECTIONS = "numTotalConnections";
+    public static final String NUM_BUSY_CONNECTIONS = "numBusyConnections";
+    public static final String NUM_IDLE_CONNECTIONS = "numIdleConnections";
+    public static final String MAX_IDLE_TIME = "maxIdleTime";
+    public static final String MIN_POOL_SIZE = "minPoolSize";
+    public static final String MAX_POOL_SIZE = "maxPoolSize";
+    public static final String INITIAL_POOL_SIZE = "initialPoolSize";
+}
diff --git a/apm-sniffer/apm-sdk-plugin/c3p0-0.9.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/c3p0/PoolingConnectionCloseInterceptor.java b/apm-sniffer/apm-sdk-plugin/c3p0-0.9.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/c3p0/PoolingConnectionCloseInterceptor.java
new file mode 100644
index 0000000000..aa3a41fa33
--- /dev/null
+++ b/apm-sniffer/apm-sdk-plugin/c3p0-0.9.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/c3p0/PoolingConnectionCloseInterceptor.java
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.skywalking.apm.plugin.c3p0;
+
+import org.apache.skywalking.apm.agent.core.context.ContextManager;
+import org.apache.skywalking.apm.agent.core.context.trace.AbstractSpan;
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult;
+import org.apache.skywalking.apm.network.trace.component.ComponentsDefine;
+
+import java.lang.reflect.Method;
+
+/**
+ * {@link PoolingConnectionCloseInterceptor} intercepted the method of C3P0 closing connection.
+ */
+public class PoolingConnectionCloseInterceptor implements InstanceMethodsAroundInterceptor {
+
+    @Override
+    public void beforeMethod(EnhancedInstance objInst,
+                             Method method,
+                             Object[] allArguments,
+                             Class<?>[] argumentsTypes,
+                             MethodInterceptResult result) throws Throwable {
+        AbstractSpan span = ContextManager.createLocalSpan(PoolConstants.POOL_CONNECTION + method.getName());
+        span.setComponent(ComponentsDefine.C3P0);
+    }
+
+    @Override
+    public Object afterMethod(EnhancedInstance objInst,
+                              Method method,
+                              Object[] allArguments,
+                              Class<?>[] argumentsTypes,
+                              Object ret) throws Throwable {
+        ContextManager.stopSpan();
+        return ret;
+    }
+
+    @Override
+    public void handleMethodException(EnhancedInstance objInst,
+                                      Method method,
+                                      Object[] allArguments,
+                                      Class<?>[] argumentsTypes,
+                                      Throwable t) {
+        ContextManager.activeSpan().errorOccurred().log(t);
+    }
+}
diff --git a/apm-sniffer/apm-sdk-plugin/c3p0-0.9.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/c3p0/PoolingConnectionGetInterceptor.java b/apm-sniffer/apm-sdk-plugin/c3p0-0.9.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/c3p0/PoolingConnectionGetInterceptor.java
new file mode 100644
index 0000000000..aff1e69e6c
--- /dev/null
+++ b/apm-sniffer/apm-sdk-plugin/c3p0-0.9.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/c3p0/PoolingConnectionGetInterceptor.java
@@ -0,0 +1,61 @@
+/*
+ * 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.c3p0;
+
+import java.lang.reflect.Method;
+import org.apache.skywalking.apm.agent.core.context.ContextManager;
+import org.apache.skywalking.apm.agent.core.context.trace.AbstractSpan;
+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;
+
+/**
+ * {@link PoolingConnectionGetInterceptor} intercepted the method of C3P0 getting connection.
+ */
+public class PoolingConnectionGetInterceptor implements InstanceMethodsAroundInterceptor {
+
+    @Override
+    public void beforeMethod(EnhancedInstance objInst,
+                             Method method,
+                             Object[] allArguments,
+                             Class<?>[] argumentsTypes,
+                             MethodInterceptResult result) throws Throwable {
+        AbstractSpan span = ContextManager.createLocalSpan(PoolConstants.POOL_CONNECTION + method.getName());
+        span.setComponent(ComponentsDefine.C3P0);
+    }
+
+    @Override
+    public Object afterMethod(EnhancedInstance objInst,
+                              Method method,
+                              Object[] allArguments,
+                              Class<?>[] argumentsTypes,
+                              Object ret) throws Throwable {
+        ContextManager.stopSpan();
+        return ret;
+    }
+
+    @Override
+    public void handleMethodException(EnhancedInstance objInst,
+                                      Method method,
+                                      Object[] allArguments,
+                                      Class<?>[] argumentsTypes,
+                                      Throwable t) {
+        ContextManager.activeSpan().errorOccurred().log(t);
+    }
+}
diff --git a/apm-sniffer/apm-sdk-plugin/c3p0-0.9.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/c3p0/PoolingCreationInterceptor.java b/apm-sniffer/apm-sdk-plugin/c3p0-0.9.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/c3p0/PoolingCreationInterceptor.java
new file mode 100644
index 0000000000..6a5514e8c5
--- /dev/null
+++ b/apm-sniffer/apm-sdk-plugin/c3p0-0.9.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/c3p0/PoolingCreationInterceptor.java
@@ -0,0 +1,132 @@
+/*
+ * 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.c3p0;
+
+import com.mchange.v2.c3p0.C3P0Registry;
+import com.mchange.v2.c3p0.ComboPooledDataSource;
+import java.lang.reflect.Method;
+import java.sql.SQLException;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.function.Function;
+import java.util.function.Supplier;
+import org.apache.skywalking.apm.agent.core.context.ContextManager;
+import org.apache.skywalking.apm.agent.core.meter.MeterFactory;
+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.jdbc.connectionurl.parser.URLParser;
+import org.apache.skywalking.apm.plugin.jdbc.trace.ConnectionInfo;
+
+/**
+ * {@link PoolingCreationInterceptor} intercepted the method of pool creation.
+ */
+public class PoolingCreationInterceptor implements InstanceMethodsAroundInterceptor {
+    private static final Set<String> TOKEN_MAP = new HashSet<>(16);
+
+    @Override
+    public void beforeMethod(final EnhancedInstance enhancedInstance,
+                             final Method method,
+                             final Object[] objects,
+                             final Class<?>[] classes,
+                             final MethodInterceptResult methodInterceptResult) throws Throwable {
+
+    }
+
+    @Override
+    public Object afterMethod(final EnhancedInstance enhancedInstance,
+                              final Method method,
+                              final Object[] objects,
+                              final Class<?>[] classes,
+                              final Object ret) throws Throwable {
+        C3P0Registry.getPooledDataSources().forEach(obj -> {
+            ComboPooledDataSource pooledDataSource = (ComboPooledDataSource) obj;
+            if (!TOKEN_MAP.contains(pooledDataSource.getIdentityToken())) {
+                ConnectionInfo connectionInfo = URLParser.parser(pooledDataSource.getJdbcUrl());
+                String tagValue = connectionInfo.getDatabaseName() + "_" + connectionInfo.getDatabasePeer();
+                Map<String, Function<ComboPooledDataSource, Supplier<Double>>> metricMap = getMetrics();
+                metricMap.forEach(
+                    (key, value) -> MeterFactory.gauge(PoolConstants.METER_NAME, value.apply(pooledDataSource))
+                                                .tag(PoolConstants.METER_TAG_NAME, tagValue)
+                                                .tag(PoolConstants.METER_TAG_STATUS, key)
+                                                .build());
+                TOKEN_MAP.add(pooledDataSource.getIdentityToken());
+            }
+        });
+        return ret;
+    }
+
+    @Override
+    public void handleMethodException(final EnhancedInstance enhancedInstance,
+                                      final Method method,
+                                      final Object[] objects,
+                                      final Class<?>[] classes,
+                                      final Throwable t) {
+        ContextManager.activeSpan().errorOccurred().log(t);
+    }
+
+    private Map<String, Function<ComboPooledDataSource, Supplier<Double>>> getMetrics() {
+        Map<String, Function<ComboPooledDataSource, Supplier<Double>>> metricMap = new HashMap<>();
+        metricMap.put(PoolConstants.NUM_TOTAL_CONNECTIONS, (ComboPooledDataSource pooledDataSource) -> () -> {
+            double numConnections = 0;
+            try {
+                numConnections = pooledDataSource.getNumConnections();
+            } catch (SQLException e) {
+                ContextManager.activeSpan().errorOccurred().log(e);
+            }
+            return numConnections;
+        });
+        metricMap.put(PoolConstants.NUM_BUSY_CONNECTIONS, (ComboPooledDataSource pooledDataSource) -> () -> {
+            double numBusyConnections = 0;
+            try {
+                numBusyConnections = pooledDataSource.getNumBusyConnections();
+            } catch (SQLException e) {
+                ContextManager.activeSpan().errorOccurred().log(e);
+            }
+            return numBusyConnections;
+        });
+        metricMap.put(PoolConstants.NUM_IDLE_CONNECTIONS, (ComboPooledDataSource pooledDataSource) -> () -> {
+            double numIdleConnections = 0;
+            try {
+                numIdleConnections = pooledDataSource.getNumIdleConnections();
+            } catch (SQLException e) {
+                ContextManager.activeSpan().errorOccurred().log(e);
+            }
+            return numIdleConnections;
+        });
+        metricMap.put(
+            PoolConstants.MAX_IDLE_TIME,
+            (ComboPooledDataSource pooledDataSource) -> () -> (double) pooledDataSource.getMaxIdleTime()
+        );
+        metricMap.put(
+            PoolConstants.MIN_POOL_SIZE,
+            (ComboPooledDataSource pooledDataSource) -> () -> (double) pooledDataSource.getMinPoolSize()
+        );
+        metricMap.put(
+            PoolConstants.MAX_POOL_SIZE,
+            (ComboPooledDataSource pooledDataSource) -> () -> (double) pooledDataSource.getMaxPoolSize()
+        );
+        metricMap.put(
+            PoolConstants.INITIAL_POOL_SIZE,
+            (ComboPooledDataSource pooledDataSource) -> () -> (double) pooledDataSource.getInitialPoolSize()
+        );
+        return metricMap;
+    }
+}
diff --git a/apm-sniffer/apm-sdk-plugin/c3p0-0.9.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/c3p0/define/C3P0NewProxyConnectionInstrumentation.java b/apm-sniffer/apm-sdk-plugin/c3p0-0.9.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/c3p0/define/C3P0NewProxyConnectionInstrumentation.java
new file mode 100644
index 0000000000..e049023a23
--- /dev/null
+++ b/apm-sniffer/apm-sdk-plugin/c3p0-0.9.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/c3p0/define/C3P0NewProxyConnectionInstrumentation.java
@@ -0,0 +1,72 @@
+/*
+ * 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.c3p0.define;
+
+import net.bytebuddy.description.method.MethodDescription;
+import net.bytebuddy.matcher.ElementMatcher;
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint;
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint;
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine;
+import org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch;
+
+import static net.bytebuddy.matcher.ElementMatchers.named;
+import static org.apache.skywalking.apm.agent.core.plugin.match.NameMatch.byName;
+
+/**
+ * C3p0 is a mature, highly concurrent JDBC Connection pooling library, with support for caching and reuse of
+ * PreparedStatement objects. Defined by the jdbc3 spec and the optional extensions to jdbc2. c3p0 now also fully
+ * supports the jdbc4. {@link C3P0NewProxyConnectionInstrumentation} defines the instance methods enhance plugin for
+ * connection closed
+ */
+public class C3P0NewProxyConnectionInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
+    private static final String ENHANCE_CLASS = "com.mchange.v2.c3p0.impl.NewProxyConnection";
+    private static final String ENHANCE_METHOD = "close";
+    private static final String INTERCEPTOR_CLASS = "org.apache.skywalking.apm.plugin.c3p0.PoolingConnectionCloseInterceptor";
+
+    @Override
+    protected ClassMatch enhanceClass() {
+        return byName(ENHANCE_CLASS);
+    }
+
+    @Override
+    public ConstructorInterceptPoint[] getConstructorsInterceptPoints() {
+        return new ConstructorInterceptPoint[0];
+    }
+
+    @Override
+    public InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints() {
+        return new InstanceMethodsInterceptPoint[] {
+            new InstanceMethodsInterceptPoint() {
+                @Override
+                public ElementMatcher<MethodDescription> getMethodsMatcher() {
+                    return named(ENHANCE_METHOD);
+                }
+
+                @Override
+                public String getMethodsInterceptor() {
+                    return INTERCEPTOR_CLASS;
+                }
+
+                @Override
+                public boolean isOverrideArgs() {
+                    return false;
+                }
+            }
+        };
+    }
+}
\ No newline at end of file
diff --git a/apm-sniffer/apm-sdk-plugin/c3p0-0.9.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/c3p0/define/C3P0PoolManagerInstrumentation.java b/apm-sniffer/apm-sdk-plugin/c3p0-0.9.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/c3p0/define/C3P0PoolManagerInstrumentation.java
new file mode 100644
index 0000000000..57510c2362
--- /dev/null
+++ b/apm-sniffer/apm-sdk-plugin/c3p0-0.9.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/c3p0/define/C3P0PoolManagerInstrumentation.java
@@ -0,0 +1,72 @@
+/*
+ * 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.c3p0.define;
+
+import net.bytebuddy.description.method.MethodDescription;
+import net.bytebuddy.matcher.ElementMatcher;
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint;
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint;
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine;
+import org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch;
+
+import static net.bytebuddy.matcher.ElementMatchers.named;
+import static org.apache.skywalking.apm.agent.core.plugin.match.NameMatch.byName;
+
+/**
+ * C3p0 is a mature, highly concurrent JDBC Connection pooling library, with support for caching and reuse of
+ * PreparedStatement objects. Defined by the jdbc3 spec and the optional extensions to jdbc2. c3p0 now also fully
+ * supports the jdbc4. { @link C3P0PoolManagerInstrumentation} defines the instance methods enhance plugin for pool
+ * creation.
+ */
+public class C3P0PoolManagerInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
+    private static final String ENHANCE_CLASS = "com.mchange.v2.c3p0.impl.C3P0PooledConnectionPoolManager";
+    private static final String ENHANCE_METHOD = "createPooledConnectionPool";
+    private static final String INTERCEPTOR_CLASS = "org.apache.skywalking.apm.plugin.c3p0.PoolingCreationInterceptor";
+
+    @Override
+    protected ClassMatch enhanceClass() {
+        return byName(ENHANCE_CLASS);
+    }
+
+    @Override
+    public ConstructorInterceptPoint[] getConstructorsInterceptPoints() {
+        return new ConstructorInterceptPoint[0];
+    }
+
+    @Override
+    public InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints() {
+        return new InstanceMethodsInterceptPoint[] {
+            new InstanceMethodsInterceptPoint() {
+                @Override
+                public ElementMatcher<MethodDescription> getMethodsMatcher() {
+                    return named(ENHANCE_METHOD);
+                }
+
+                @Override
+                public String getMethodsInterceptor() {
+                    return INTERCEPTOR_CLASS;
+                }
+
+                @Override
+                public boolean isOverrideArgs() {
+                    return false;
+                }
+            }
+        };
+    }
+}
diff --git a/apm-sniffer/apm-sdk-plugin/c3p0-0.9.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/c3p0/define/C3P0PooledDataSourceInstrumentation.java b/apm-sniffer/apm-sdk-plugin/c3p0-0.9.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/c3p0/define/C3P0PooledDataSourceInstrumentation.java
new file mode 100644
index 0000000000..e2ae84731b
--- /dev/null
+++ b/apm-sniffer/apm-sdk-plugin/c3p0-0.9.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/c3p0/define/C3P0PooledDataSourceInstrumentation.java
@@ -0,0 +1,72 @@
+/*
+ * 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.c3p0.define;
+
+import net.bytebuddy.description.method.MethodDescription;
+import net.bytebuddy.matcher.ElementMatcher;
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint;
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint;
+import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine;
+import org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch;
+
+import static net.bytebuddy.matcher.ElementMatchers.named;
+import static org.apache.skywalking.apm.agent.core.plugin.match.NameMatch.byName;
+
+/**
+ * C3p0 is a mature, highly concurrent JDBC Connection pooling library, with support for caching and reuse of
+ * PreparedStatement objects. Defined by the jdbc3 spec and the optional extensions to jdbc2. c3p0 now also fully
+ * supports the jdbc4. { @link C3P0PooledDataSourceInstrumentation} defines the instance methods enhance plugin for
+ * connection init
+ */
+public class C3P0PooledDataSourceInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
+    private static final String ENHANCE_CLASS = "com.mchange.v2.c3p0.ComboPooledDataSource";
+    private static final String ENHANCE_METHOD = "getConnection";
+    private static final String INTERCEPTOR_CLASS = "org.apache.skywalking.apm.plugin.c3p0.PoolingConnectionGetInterceptor";
+
+    @Override
+    protected ClassMatch enhanceClass() {
+        return byName(ENHANCE_CLASS);
+    }
+
+    @Override
+    public ConstructorInterceptPoint[] getConstructorsInterceptPoints() {
+        return new ConstructorInterceptPoint[0];
+    }
+
+    @Override
+    public InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints() {
+        return new InstanceMethodsInterceptPoint[] {
+            new InstanceMethodsInterceptPoint() {
+                @Override
+                public ElementMatcher<MethodDescription> getMethodsMatcher() {
+                    return named(ENHANCE_METHOD);
+                }
+
+                @Override
+                public String getMethodsInterceptor() {
+                    return INTERCEPTOR_CLASS;
+                }
+
+                @Override
+                public boolean isOverrideArgs() {
+                    return false;
+                }
+            }
+        };
+    }
+}
diff --git a/apm-sniffer/apm-sdk-plugin/c3p0-0.9.x-plugin/src/main/resources/skywalking-plugin.def b/apm-sniffer/apm-sdk-plugin/c3p0-0.9.x-plugin/src/main/resources/skywalking-plugin.def
new file mode 100644
index 0000000000..bbb99e5908
--- /dev/null
+++ b/apm-sniffer/apm-sdk-plugin/c3p0-0.9.x-plugin/src/main/resources/skywalking-plugin.def
@@ -0,0 +1,19 @@
+# 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.
+
+c3p0-0.9.x=org.apache.skywalking.apm.plugin.c3p0.define.C3P0NewProxyConnectionInstrumentation
+c3p0-0.9.x=org.apache.skywalking.apm.plugin.c3p0.define.C3P0PoolManagerInstrumentation
+c3p0-0.9.x=org.apache.skywalking.apm.plugin.c3p0.define.C3P0PooledDataSourceInstrumentation
\ No newline at end of file
diff --git a/apm-sniffer/apm-sdk-plugin/pom.xml b/apm-sniffer/apm-sdk-plugin/pom.xml
index bf07afa7a6..bce4312dfc 100644
--- a/apm-sniffer/apm-sdk-plugin/pom.xml
+++ b/apm-sniffer/apm-sdk-plugin/pom.xml
@@ -136,6 +136,7 @@
         <module>aerospike-plugin</module>
         <module>rocketMQ-client-java-5.x-plugin</module>
         <module>activemq-artemis-jakarta-client-2.x-plugin</module>
+        <module>c3p0-0.9.x-plugin</module>
     </modules>
     <packaging>pom</packaging>
 
diff --git a/docs/en/setup/service-agent/java-agent/Plugin-list.md b/docs/en/setup/service-agent/java-agent/Plugin-list.md
index 16136fce70..d8c4d160bb 100644
--- a/docs/en/setup/service-agent/java-agent/Plugin-list.md
+++ b/docs/en/setup/service-agent/java-agent/Plugin-list.md
@@ -176,3 +176,4 @@
 - spring-webflux-6.x
 - spring-webflux-6.x-webclient
 - activemq-artemis-jakarta-client-2.x
+- c3p0-0.9.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 da1aef6411..a51d267460 100644
--- a/docs/en/setup/service-agent/java-agent/Supported-list.md
+++ b/docs/en/setup/service-agent/java-agent/Supported-list.md
@@ -148,6 +148,7 @@ metrics based on the tracing data.
   * [Apache Commons DBCP](https://github.com/apache/commons-dbcp) 2.x
   * [Alibaba Druid](https://github.com/alibaba/druid) 1.x
   * [HikariCP](https://github.com/brettwooldridge/HikariCP) 3.x -> 4.x
+  * [C3P0](https://github.com/swaldman/c3p0) 0.9.0 -> 0.10.0
 * Logging Framework
   * [log4j](https://github.com/apache/log4j) 2.x
   * [log4j2](https://github.com/apache/logging-log4j2) 1.2.x
@@ -166,6 +167,11 @@ The meter plugin provides the advanced metrics collections, which are not a part
   * [Dubbo](https://github.com/apache/dubbo) 2.5.x -> 2.7.x
   * [Jetty](https://github.com/eclipse/jetty.project) 9.1.x -> 11.x
   * [Grizzly](https://github.com/eclipse-ee4j/grizzly) 2.3.x -> 4.x
+* Connection Pool
+  * [Apache Commons DBCP](https://github.com/apache/commons-dbcp) 2.x
+  * [Alibaba Druid](https://github.com/alibaba/druid) 1.x
+  * [HikariCP](https://github.com/brettwooldridge/HikariCP) 3.x -> 4.x
+  * [C3P0](https://github.com/swaldman/c3p0) 0.9.0 -> 0.10.0
 ___
 ¹Due to license incompatibilities/restrictions these plugins are hosted and released in 3rd part repository,
  go to [SkyAPM java plugin extension repository](https://github.com/SkyAPM/java-plugin-extensions) to get these.
diff --git a/test/plugin/scenarios/c3p0-0.9.0.x-0.9.1.x-scenario/bin/startup.sh b/test/plugin/scenarios/c3p0-0.9.0.x-0.9.1.x-scenario/bin/startup.sh
new file mode 100755
index 0000000000..ec6c3c19a5
--- /dev/null
+++ b/test/plugin/scenarios/c3p0-0.9.0.x-0.9.1.x-scenario/bin/startup.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+home="$(cd "$(dirname $0)"; pwd)"
+
+java -jar ${agent_opts} ${home}/../libs/c3p0-0.9.0.x-0.9.1.x-scenario.jar &
\ No newline at end of file
diff --git a/test/plugin/scenarios/c3p0-0.9.0.x-0.9.1.x-scenario/config/expectedData.yaml b/test/plugin/scenarios/c3p0-0.9.0.x-0.9.1.x-scenario/config/expectedData.yaml
new file mode 100755
index 0000000000..545afa54ef
--- /dev/null
+++ b/test/plugin/scenarios/c3p0-0.9.0.x-0.9.1.x-scenario/config/expectedData.yaml
@@ -0,0 +1,288 @@
+# 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: c3p0-0.9.0.x-0.9.1.x-scenario
+  segmentSize: nq 0
+  segments:
+  - segmentId: not null
+    spans:
+    - operationName: C3P0/Connection/getConnection
+      parentSpanId: 0
+      spanId: 1
+      startTime: gt 0
+      endTime: gt 0
+      componentId: 152
+      isError: false
+      spanType: Local
+      peer: ''
+      skipAnalysis: false
+    - operationName: Mysql/JDBC/Statement/execute
+      parentSpanId: 0
+      spanId: 2
+      startTime: gt 0
+      endTime: gt 0
+      componentId: 33
+      isError: false
+      spanType: Exit
+      peer: mysql-server:3306
+      skipAnalysis: false
+      tags:
+        - {key: db.type, value: Mysql}
+        - {key: db.instance, value: test}
+        - key: db.statement
+          value: "CREATE TABLE test_C3P0(\nid VARCHAR(1) PRIMARY KEY, \nvalue VARCHAR(1)\
+          \ NOT NULL)"
+    - operationName: C3P0/Connection/close
+      parentSpanId: 0
+      spanId: 3
+      startTime: gt 0
+      endTime: gt 0
+      componentId: 152
+      isError: false
+      spanType: Local
+      peer: ''
+      skipAnalysis: false
+    - operationName: C3P0/Connection/getConnection
+      parentSpanId: 0
+      spanId: 4
+      startTime: gt 0
+      endTime: gt 0
+      componentId: 152
+      isError: false
+      spanType: Local
+      peer: ''
+      skipAnalysis: false
+    - operationName: Mysql/JDBC/Statement/execute
+      parentSpanId: 0
+      spanId: 5
+      startTime: gt 0
+      endTime: gt 0
+      componentId: 33
+      isError: false
+      spanType: Exit
+      peer: mysql-server:3306
+      skipAnalysis: false
+      tags:
+        - {key: db.type, value: Mysql}
+        - {key: db.instance, value: test}
+        - key: db.statement
+          value: 'INSERT INTO test_C3P0(id, value) VALUES(1,1)'
+    - operationName: C3P0/Connection/close
+      parentSpanId: 0
+      spanId: 6
+      startTime: gt 0
+      endTime: gt 0
+      componentId: 152
+      isError: false
+      spanType: Local
+      peer: ''
+      skipAnalysis: false
+    - operationName: C3P0/Connection/getConnection
+      parentSpanId: 0
+      spanId: 7
+      startTime: gt 0
+      endTime: gt 0
+      componentId: 152
+      isError: false
+      spanType: Local
+      peer: ''
+      skipAnalysis: false
+    - operationName: Mysql/JDBC/Statement/execute
+      parentSpanId: 0
+      spanId: 8
+      startTime: gt 0
+      endTime: gt 0
+      componentId: 33
+      isError: false
+      spanType: Exit
+      peer: mysql-server:3306
+      skipAnalysis: false
+      tags:
+        - {key: db.type, value: Mysql}
+        - {key: db.instance, value: test}
+        - key: db.statement
+          value: 'SELECT id, value FROM test_C3P0 WHERE id=1'
+    - operationName: C3P0/Connection/close
+      parentSpanId: 0
+      spanId: 9
+      startTime: gt 0
+      endTime: gt 0
+      componentId: 152
+      isError: false
+      spanType: Local
+      peer: ''
+      skipAnalysis: false
+    - operationName: C3P0/Connection/getConnection
+      parentSpanId: 0
+      spanId: 10
+      startTime: gt 0
+      endTime: gt 0
+      componentId: 152
+      isError: false
+      spanType: Local
+      peer: ''
+      skipAnalysis: false
+    - operationName: Mysql/JDBC/Statement/execute
+      parentSpanId: 0
+      spanId: 11
+      startTime: gt 0
+      endTime: gt 0
+      componentId: 33
+      isError: false
+      spanType: Exit
+      peer: mysql-server:3306
+      skipAnalysis: false
+      tags:
+        - {key: db.type, value: Mysql}
+        - {key: db.instance, value: test}
+        - key: db.statement
+          value: "DELETE FROM test_C3P0 WHERE id=1"
+    - operationName: C3P0/Connection/close
+      parentSpanId: 0
+      spanId: 12
+      startTime: gt 0
+      endTime: gt 0
+      componentId: 152
+      isError: false
+      spanType: Local
+      peer: ''
+      skipAnalysis: false
+    - operationName: C3P0/Connection/getConnection
+      parentSpanId: 0
+      spanId: 13
+      startTime: gt 0
+      endTime: gt 0
+      componentId: 152
+      isError: false
+      spanType: Local
+      peer: ''
+      skipAnalysis: false
+    - operationName: Mysql/JDBC/Statement/execute
+      parentSpanId: 0
+      spanId: 14
+      startTime: gt 0
+      endTime: gt 0
+      componentId: 33
+      isError: false
+      spanType: Exit
+      peer: mysql-server:3306
+      skipAnalysis: false
+      tags:
+        - {key: db.type, value: Mysql}
+        - {key: db.instance, value: test}
+        - key: db.statement
+          value: "DROP table test_C3P0"
+    - operationName: C3P0/Connection/close
+      parentSpanId: 0
+      spanId: 15
+      startTime: gt 0
+      endTime: gt 0
+      componentId: 152
+      isError: false
+      spanType: Local
+      peer: ''
+      skipAnalysis: false
+    - operationName: GET:/c3p0-0.9.0.x-0.9.1.x-scenario/case/c3p0-0.9.0.x-0.9.1.x-scenario
+      parentSpanId: -1
+      spanId: 0
+      spanLayer: Http
+      startTime: gt 0
+      endTime: gt 0
+      componentId: 1
+      isError: false
+      spanType: Entry
+      peer: ''
+      skipAnalysis: false
+      tags:
+        - {key: url, value: 'http://localhost:8080/c3p0-0.9.0.x-0.9.1.x-scenario/case/c3p0-0.9.0.x-0.9.1.x-scenario'}
+        - {key: http.method, value: GET}
+        - {key: http.status_code, value: '200'}
+meterItems:
+- serviceName: c3p0-0.9.0.x-0.9.1.x-scenario
+  meterSize: 12
+  meters:
+  - meterId:
+      name: datasource
+      tags:
+      - {name: name, value: test_mysql-server:3306}
+      - {name: status, value: initialPoolSize}
+    singleValue: ge 0
+  - meterId:
+      name: datasource
+      tags:
+      - {name: name, value: test_mysql-server:3306}
+      - {name: status, value: maxIdleTime}
+    singleValue: ge 0
+  - meterId:
+      name: datasource
+      tags:
+      - {name: name, value: test_mysql-server:3306}
+      - {name: status, value: maxPoolSize}
+    singleValue: ge 0
+  - meterId:
+      name: datasource
+      tags:
+      - {name: name, value: test_mysql-server:3306}
+      - {name: status, value: minPoolSize}
+    singleValue: ge -1
+  - meterId:
+      name: datasource
+      tags:
+      - {name: name, value: test_mysql-server:3306}
+      - {name: status, value: numBusyConnections}
+    singleValue: ge 0
+  - meterId:
+      name: datasource
+      tags:
+      - {name: name, value: test_mysql-server:3306}
+      - {name: status, value: numIdleConnections}
+    singleValue: ge 0
+  - meterId:
+      name: datasource
+      tags:
+      - {name: name, value: test_mysql-server:3306}
+      - {name: status, value: numTotalConnections}
+    singleValue: ge 0
+  - meterId:
+      name: thread_pool
+      tags:
+        - {name: metric_type, value: core_pool_size}
+        - {name: pool_name, value: tomcat_execute_pool}
+    singleValue: ge 1
+  - meterId:
+      name: thread_pool
+      tags:
+        - {name: metric_type, value: max_pool_size}
+        - {name: pool_name, value: tomcat_execute_pool}
+    singleValue: ge 1
+  - meterId:
+      name: thread_pool
+      tags:
+        - {name: metric_type, value: pool_size}
+        - {name: pool_name, value: tomcat_execute_pool}
+    singleValue: ge 0
+  - meterId:
+      name: thread_pool
+      tags:
+        - {name: metric_type, value: active_size}
+        - {name: pool_name, value: tomcat_execute_pool}
+    singleValue: ge 0
+  - meterId:
+      name: thread_pool
+      tags:
+        - {name: metric_type, value: queue_size}
+        - {name: pool_name, value: tomcat_execute_pool}
+    singleValue: ge 0
diff --git a/test/plugin/scenarios/c3p0-0.9.0.x-0.9.1.x-scenario/configuration.yml b/test/plugin/scenarios/c3p0-0.9.0.x-0.9.1.x-scenario/configuration.yml
new file mode 100755
index 0000000000..d05855afe4
--- /dev/null
+++ b/test/plugin/scenarios/c3p0-0.9.0.x-0.9.1.x-scenario/configuration.yml
@@ -0,0 +1,32 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+type: jvm
+entryService: http://localhost:8080/c3p0-0.9.0.x-0.9.1.x-scenario/case/c3p0-0.9.0.x-0.9.1.x-scenario
+healthCheck: http://localhost:8080/c3p0-0.9.0.x-0.9.1.x-scenario/case/healthCheck
+startScript: ./bin/startup.sh
+environment:
+depends_on:
+  - mysql-server
+dependencies:
+  mysql-server:
+    image: mysql:5.7
+    hostname: mysql-server
+    expose:
+      - "3306"
+    environment:
+      - MYSQL_ROOT_PASSWORD=root
+      - MYSQL_DATABASE=test
diff --git a/test/plugin/scenarios/c3p0-0.9.0.x-0.9.1.x-scenario/pom.xml b/test/plugin/scenarios/c3p0-0.9.0.x-0.9.1.x-scenario/pom.xml
new file mode 100755
index 0000000000..0a3408ade0
--- /dev/null
+++ b/test/plugin/scenarios/c3p0-0.9.0.x-0.9.1.x-scenario/pom.xml
@@ -0,0 +1,127 @@
+<?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>c3p0-0.9.0.x-0.9.1.x-scenario</artifactId>
+    <version>1.0.0</version>
+    <packaging>jar</packaging>
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <compiler.version>1.8</compiler.version>
+        <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
+        <test.framework.version>0.9.1.2</test.framework.version>
+        <docker.image.version>${test.framework.version}</docker.image.version>
+        <spring.boot.version>2.1.6.RELEASE</spring.boot.version>
+    </properties>
+
+    <name>skywalking-c3p0-0.9.0.x-0.9.1.x-scenario</name>
+
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-dependencies</artifactId>
+                <version>${spring.boot.version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.springframework.boot</groupId>
+                    <artifactId>spring-boot-starter-logging</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-log4j2</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+            <version>5.1.25</version>
+        </dependency>
+
+        <dependency>
+            <groupId>c3p0</groupId>
+            <artifactId>c3p0</artifactId>
+            <version>${test.framework.version}</version>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <finalName>c3p0-0.9.0.x-0.9.1.x-scenario</finalName>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <version>${spring.boot.version}</version>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>repackage</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <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-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>
\ No newline at end of file
diff --git a/test/plugin/scenarios/c3p0-0.9.0.x-0.9.1.x-scenario/src/main/assembly/assembly.xml b/test/plugin/scenarios/c3p0-0.9.0.x-0.9.1.x-scenario/src/main/assembly/assembly.xml
new file mode 100755
index 0000000000..6e2d37867c
--- /dev/null
+++ b/test/plugin/scenarios/c3p0-0.9.0.x-0.9.1.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}/c3p0-0.9.0.x-0.9.1.x-scenario.jar</source>
+            <outputDirectory>./libs</outputDirectory>
+            <fileMode>0775</fileMode>
+        </file>
+    </files>
+</assembly>
diff --git a/test/plugin/scenarios/c3p0-0.9.0.x-0.9.1.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/c3p0/c3p0/Application.java b/test/plugin/scenarios/c3p0-0.9.0.x-0.9.1.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/c3p0/c3p0/Application.java
new file mode 100755
index 0000000000..2accc46e0f
--- /dev/null
+++ b/test/plugin/scenarios/c3p0-0.9.0.x-0.9.1.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/c3p0/c3p0/Application.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.testcase.c3p0.c3p0;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+public class Application {
+
+    public static void main(String[] args) {
+        try {
+            SpringApplication.run(Application.class, args);
+        } catch (Exception e) {
+            // Never do this
+        }
+    }
+}
diff --git a/test/plugin/scenarios/c3p0-0.9.0.x-0.9.1.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/c3p0/c3p0/MysqlConfig.java b/test/plugin/scenarios/c3p0-0.9.0.x-0.9.1.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/c3p0/c3p0/MysqlConfig.java
new file mode 100755
index 0000000000..bdc0102b61
--- /dev/null
+++ b/test/plugin/scenarios/c3p0-0.9.0.x-0.9.1.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/c3p0/c3p0/MysqlConfig.java
@@ -0,0 +1,57 @@
+/*
+ * 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.c3p0.c3p0;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
+public class MysqlConfig {
+    private static Logger LOGGER = LogManager.getLogger(MysqlConfig.class);
+    private static String URL;
+    private static String USER_NAME;
+    private static String PASSWORD;
+
+    static {
+        InputStream inputStream = MysqlConfig.class.getClassLoader().getResourceAsStream("jdbc.properties");
+        Properties properties = new Properties();
+        try {
+            properties.load(inputStream);
+        } catch (IOException e) {
+            LOGGER.error("Failed to load config", e);
+        }
+        URL = properties.getProperty("mysql.url");
+        USER_NAME = properties.getProperty("mysql.username");
+        PASSWORD = properties.getProperty("mysql.password");
+    }
+
+    public static String getUrl() {
+        return URL;
+    }
+
+    public static String getUserName() {
+        return USER_NAME;
+    }
+
+    public static String getPassword() {
+        return PASSWORD;
+    }
+}
diff --git a/test/plugin/scenarios/c3p0-0.9.0.x-0.9.1.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/c3p0/c3p0/controller/CaseController.java b/test/plugin/scenarios/c3p0-0.9.0.x-0.9.1.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/c3p0/c3p0/controller/CaseController.java
new file mode 100755
index 0000000000..447f843413
--- /dev/null
+++ b/test/plugin/scenarios/c3p0-0.9.0.x-0.9.1.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/c3p0/c3p0/controller/CaseController.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.testcase.c3p0.c3p0.controller;
+
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.apache.skywalking.apm.testcase.c3p0.c3p0.service.CaseService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/case")
+public class CaseController {
+
+    @Autowired
+    CaseService caseService;
+
+    private static final Logger LOGGER = LogManager.getLogger(CaseController.class);
+
+    private static final String SUCCESS = "Success";
+    
+    @RequestMapping("/c3p0-0.9.0.x-0.9.1.x-scenario")
+    @ResponseBody
+    public String testcase() throws Exception {
+        try {
+            caseService.testCase();
+        } catch (Exception e) {
+            LOGGER.error("Failed to execute sql.", e);
+            throw e;
+        }
+        return SUCCESS;
+    }
+
+    @RequestMapping("/healthCheck")
+    @ResponseBody
+    public String healthCheck() throws Exception {
+        return SUCCESS;
+    }
+
+}
diff --git a/test/plugin/scenarios/c3p0-0.9.0.x-0.9.1.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/c3p0/c3p0/service/CaseService.java b/test/plugin/scenarios/c3p0-0.9.0.x-0.9.1.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/c3p0/c3p0/service/CaseService.java
new file mode 100644
index 0000000000..ee2c38ed21
--- /dev/null
+++ b/test/plugin/scenarios/c3p0-0.9.0.x-0.9.1.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/c3p0/c3p0/service/CaseService.java
@@ -0,0 +1,72 @@
+/*
+ * 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.c3p0.c3p0.service;
+
+import com.mchange.v2.c3p0.ComboPooledDataSource;
+import java.sql.Connection;
+import java.sql.SQLException;
+import java.sql.Statement;
+import org.apache.skywalking.apm.testcase.c3p0.c3p0.MysqlConfig;
+import org.springframework.stereotype.Service;
+
+@Service
+public class CaseService {
+
+    public static ComboPooledDataSource DS;
+    private static final String CREATE_TABLE_SQL = "CREATE TABLE test_C3P0(\n" + "id VARCHAR(1) PRIMARY KEY, \n" + "value VARCHAR(1) NOT NULL)";
+    private static final String INSERT_DATA_SQL = "INSERT INTO test_C3P0(id, value) VALUES(1,1)";
+    private static final String QUERY_DATA_SQL = "SELECT id, value FROM test_C3P0 WHERE id=1";
+    private static final String DELETE_DATA_SQL = "DELETE FROM test_C3P0 WHERE id=1";
+    private static final String DROP_TABLE_SQL = "DROP table test_C3P0";
+
+    static {
+        try {
+            DS = new ComboPooledDataSource();
+            DS.setDriverClass("com.mysql.jdbc.Driver");
+            DS.setJdbcUrl(MysqlConfig.getUrl());
+            DS.setUser(MysqlConfig.getUserName());
+            DS.setPassword(MysqlConfig.getPassword());
+            DS.setAcquireIncrement(1);
+            DS.setInitialPoolSize(5);
+            DS.setMinPoolSize(1);
+            DS.setMaxIdleTime(10);
+            DS.setTestConnectionOnCheckin(false);
+            DS.setTestConnectionOnCheckout(false);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    public void testCase() {
+        sqlExecutor(DS, CREATE_TABLE_SQL);
+        sqlExecutor(DS, INSERT_DATA_SQL);
+        sqlExecutor(DS, QUERY_DATA_SQL);
+        sqlExecutor(DS, DELETE_DATA_SQL);
+        sqlExecutor(DS, DROP_TABLE_SQL);
+    }
+
+    public void sqlExecutor(ComboPooledDataSource dataSource, String sql) {
+        try (Connection conn = dataSource.getConnection();) {
+            Statement statement = conn.createStatement();
+            statement.execute(sql);
+        } catch (SQLException e) {
+            e.printStackTrace();
+        }
+    }
+}
diff --git a/test/plugin/scenarios/c3p0-0.9.0.x-0.9.1.x-scenario/src/main/resources/application.yaml b/test/plugin/scenarios/c3p0-0.9.0.x-0.9.1.x-scenario/src/main/resources/application.yaml
new file mode 100755
index 0000000000..66a7a51fd1
--- /dev/null
+++ b/test/plugin/scenarios/c3p0-0.9.0.x-0.9.1.x-scenario/src/main/resources/application.yaml
@@ -0,0 +1,23 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+#
+server:
+  port: 8080
+  servlet:
+    context-path: /c3p0-0.9.0.x-0.9.1.x-scenario
+logging:
+  config: classpath:log4j2.xml
\ No newline at end of file
diff --git a/test/plugin/scenarios/c3p0-0.9.0.x-0.9.1.x-scenario/src/main/resources/jdbc.properties b/test/plugin/scenarios/c3p0-0.9.0.x-0.9.1.x-scenario/src/main/resources/jdbc.properties
new file mode 100755
index 0000000000..8051777cce
--- /dev/null
+++ b/test/plugin/scenarios/c3p0-0.9.0.x-0.9.1.x-scenario/src/main/resources/jdbc.properties
@@ -0,0 +1,19 @@
+#
+# 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.
+#
+mysql.url=jdbc:mysql://mysql-server:3306/test?serverTimezone=CST&useLocalSessionState=true
+mysql.username=root
+mysql.password=root
\ No newline at end of file
diff --git a/test/plugin/scenarios/c3p0-0.9.0.x-0.9.1.x-scenario/src/main/resources/log4j2.xml b/test/plugin/scenarios/c3p0-0.9.0.x-0.9.1.x-scenario/src/main/resources/log4j2.xml
new file mode 100755
index 0000000000..9849ed5a8a
--- /dev/null
+++ b/test/plugin/scenarios/c3p0-0.9.0.x-0.9.1.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/c3p0-0.9.0.x-0.9.1.x-scenario/support-version.list b/test/plugin/scenarios/c3p0-0.9.0.x-0.9.1.x-scenario/support-version.list
new file mode 100755
index 0000000000..730308cbca
--- /dev/null
+++ b/test/plugin/scenarios/c3p0-0.9.0.x-0.9.1.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.
+
+0.9.0.4
+0.9.1.2
\ No newline at end of file
diff --git a/test/plugin/scenarios/c3p0-0.9.2.x-0.10.x-scenario/bin/startup.sh b/test/plugin/scenarios/c3p0-0.9.2.x-0.10.x-scenario/bin/startup.sh
new file mode 100755
index 0000000000..9ee496ba82
--- /dev/null
+++ b/test/plugin/scenarios/c3p0-0.9.2.x-0.10.x-scenario/bin/startup.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+home="$(cd "$(dirname $0)"; pwd)"
+
+java -jar ${agent_opts} ${home}/../libs/c3p0-0.9.2.x-0.10.x-scenario.jar &
\ No newline at end of file
diff --git a/test/plugin/scenarios/c3p0-0.9.2.x-0.10.x-scenario/config/expectedData.yaml b/test/plugin/scenarios/c3p0-0.9.2.x-0.10.x-scenario/config/expectedData.yaml
new file mode 100755
index 0000000000..68f931fa29
--- /dev/null
+++ b/test/plugin/scenarios/c3p0-0.9.2.x-0.10.x-scenario/config/expectedData.yaml
@@ -0,0 +1,288 @@
+# 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: c3p0-0.9.2.x-0.10.x-scenario
+  segmentSize: nq 0
+  segments:
+  - segmentId: not null
+    spans:
+    - operationName: C3P0/Connection/getConnection
+      parentSpanId: 0
+      spanId: 1
+      startTime: gt 0
+      endTime: gt 0
+      componentId: 152
+      isError: false
+      spanType: Local
+      peer: ''
+      skipAnalysis: false
+    - operationName: Mysql/JDBC/Statement/execute
+      parentSpanId: 0
+      spanId: 2
+      startTime: gt 0
+      endTime: gt 0
+      componentId: 33
+      isError: false
+      spanType: Exit
+      peer: mysql-server:3306
+      skipAnalysis: false
+      tags:
+        - {key: db.type, value: Mysql}
+        - {key: db.instance, value: test}
+        - key: db.statement
+          value: "CREATE TABLE test_C3P0(\nid VARCHAR(1) PRIMARY KEY, \nvalue VARCHAR(1)\
+          \ NOT NULL)"
+    - operationName: C3P0/Connection/close
+      parentSpanId: 0
+      spanId: 3
+      startTime: gt 0
+      endTime: gt 0
+      componentId: 152
+      isError: false
+      spanType: Local
+      peer: ''
+      skipAnalysis: false
+    - operationName: C3P0/Connection/getConnection
+      parentSpanId: 0
+      spanId: 4
+      startTime: gt 0
+      endTime: gt 0
+      componentId: 152
+      isError: false
+      spanType: Local
+      peer: ''
+      skipAnalysis: false
+    - operationName: Mysql/JDBC/Statement/execute
+      parentSpanId: 0
+      spanId: 5
+      startTime: gt 0
+      endTime: gt 0
+      componentId: 33
+      isError: false
+      spanType: Exit
+      peer: mysql-server:3306
+      skipAnalysis: false
+      tags:
+        - {key: db.type, value: Mysql}
+        - {key: db.instance, value: test}
+        - key: db.statement
+          value: 'INSERT INTO test_C3P0(id, value) VALUES(1,1)'
+    - operationName: C3P0/Connection/close
+      parentSpanId: 0
+      spanId: 6
+      startTime: gt 0
+      endTime: gt 0
+      componentId: 152
+      isError: false
+      spanType: Local
+      peer: ''
+      skipAnalysis: false
+    - operationName: C3P0/Connection/getConnection
+      parentSpanId: 0
+      spanId: 7
+      startTime: gt 0
+      endTime: gt 0
+      componentId: 152
+      isError: false
+      spanType: Local
+      peer: ''
+      skipAnalysis: false
+    - operationName: Mysql/JDBC/Statement/execute
+      parentSpanId: 0
+      spanId: 8
+      startTime: gt 0
+      endTime: gt 0
+      componentId: 33
+      isError: false
+      spanType: Exit
+      peer: mysql-server:3306
+      skipAnalysis: false
+      tags:
+        - {key: db.type, value: Mysql}
+        - {key: db.instance, value: test}
+        - key: db.statement
+          value: 'SELECT id, value FROM test_C3P0 WHERE id=1'
+    - operationName: C3P0/Connection/close
+      parentSpanId: 0
+      spanId: 9
+      startTime: gt 0
+      endTime: gt 0
+      componentId: 152
+      isError: false
+      spanType: Local
+      peer: ''
+      skipAnalysis: false
+    - operationName: C3P0/Connection/getConnection
+      parentSpanId: 0
+      spanId: 10
+      startTime: gt 0
+      endTime: gt 0
+      componentId: 152
+      isError: false
+      spanType: Local
+      peer: ''
+      skipAnalysis: false
+    - operationName: Mysql/JDBC/Statement/execute
+      parentSpanId: 0
+      spanId: 11
+      startTime: gt 0
+      endTime: gt 0
+      componentId: 33
+      isError: false
+      spanType: Exit
+      peer: mysql-server:3306
+      skipAnalysis: false
+      tags:
+        - {key: db.type, value: Mysql}
+        - {key: db.instance, value: test}
+        - key: db.statement
+          value: "DELETE FROM test_C3P0 WHERE id=1"
+    - operationName: C3P0/Connection/close
+      parentSpanId: 0
+      spanId: 12
+      startTime: gt 0
+      endTime: gt 0
+      componentId: 152
+      isError: false
+      spanType: Local
+      peer: ''
+      skipAnalysis: false
+    - operationName: C3P0/Connection/getConnection
+      parentSpanId: 0
+      spanId: 13
+      startTime: gt 0
+      endTime: gt 0
+      componentId: 152
+      isError: false
+      spanType: Local
+      peer: ''
+      skipAnalysis: false
+    - operationName: Mysql/JDBC/Statement/execute
+      parentSpanId: 0
+      spanId: 14
+      startTime: gt 0
+      endTime: gt 0
+      componentId: 33
+      isError: false
+      spanType: Exit
+      peer: mysql-server:3306
+      skipAnalysis: false
+      tags:
+        - {key: db.type, value: Mysql}
+        - {key: db.instance, value: test}
+        - key: db.statement
+          value: "DROP table test_C3P0"
+    - operationName: C3P0/Connection/close
+      parentSpanId: 0
+      spanId: 15
+      startTime: gt 0
+      endTime: gt 0
+      componentId: 152
+      isError: false
+      spanType: Local
+      peer: ''
+      skipAnalysis: false
+    - operationName: GET:/c3p0-0.9.2.x-0.10.x-scenario/case/c3p0-0.9.2.x-0.10.x-scenario
+      parentSpanId: -1
+      spanId: 0
+      spanLayer: Http
+      startTime: gt 0
+      endTime: gt 0
+      componentId: 1
+      isError: false
+      spanType: Entry
+      peer: ''
+      skipAnalysis: false
+      tags:
+        - {key: url, value: 'http://localhost:8080/c3p0-0.9.2.x-0.10.x-scenario/case/c3p0-0.9.2.x-0.10.x-scenario'}
+        - {key: http.method, value: GET}
+        - {key: http.status_code, value: '200'}
+meterItems:
+- serviceName: c3p0-0.9.2.x-0.10.x-scenario
+  meterSize: 12
+  meters:
+  - meterId:
+      name: datasource
+      tags:
+      - {name: name, value: test_mysql-server:3306}
+      - {name: status, value: initialPoolSize}
+    singleValue: ge 0
+  - meterId:
+      name: datasource
+      tags:
+      - {name: name, value: test_mysql-server:3306}
+      - {name: status, value: maxIdleTime}
+    singleValue: ge 0
+  - meterId:
+      name: datasource
+      tags:
+      - {name: name, value: test_mysql-server:3306}
+      - {name: status, value: maxPoolSize}
+    singleValue: ge 0
+  - meterId:
+      name: datasource
+      tags:
+      - {name: name, value: test_mysql-server:3306}
+      - {name: status, value: minPoolSize}
+    singleValue: ge -1
+  - meterId:
+      name: datasource
+      tags:
+      - {name: name, value: test_mysql-server:3306}
+      - {name: status, value: numBusyConnections}
+    singleValue: ge 0
+  - meterId:
+      name: datasource
+      tags:
+      - {name: name, value: test_mysql-server:3306}
+      - {name: status, value: numIdleConnections}
+    singleValue: ge 0
+  - meterId:
+      name: datasource
+      tags:
+      - {name: name, value: test_mysql-server:3306}
+      - {name: status, value: numTotalConnections}
+    singleValue: ge 0
+  - meterId:
+      name: thread_pool
+      tags:
+        - {name: metric_type, value: core_pool_size}
+        - {name: pool_name, value: tomcat_execute_pool}
+    singleValue: ge 1
+  - meterId:
+      name: thread_pool
+      tags:
+        - {name: metric_type, value: max_pool_size}
+        - {name: pool_name, value: tomcat_execute_pool}
+    singleValue: ge 1
+  - meterId:
+      name: thread_pool
+      tags:
+        - {name: metric_type, value: pool_size}
+        - {name: pool_name, value: tomcat_execute_pool}
+    singleValue: ge 0
+  - meterId:
+      name: thread_pool
+      tags:
+        - {name: metric_type, value: active_size}
+        - {name: pool_name, value: tomcat_execute_pool}
+    singleValue: ge 0
+  - meterId:
+      name: thread_pool
+      tags:
+        - {name: metric_type, value: queue_size}
+        - {name: pool_name, value: tomcat_execute_pool}
+    singleValue: ge 0
diff --git a/test/plugin/scenarios/c3p0-0.9.2.x-0.10.x-scenario/configuration.yml b/test/plugin/scenarios/c3p0-0.9.2.x-0.10.x-scenario/configuration.yml
new file mode 100755
index 0000000000..1fb61085e6
--- /dev/null
+++ b/test/plugin/scenarios/c3p0-0.9.2.x-0.10.x-scenario/configuration.yml
@@ -0,0 +1,32 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+type: jvm
+entryService: http://localhost:8080/c3p0-0.9.2.x-0.10.x-scenario/case/c3p0-0.9.2.x-0.10.x-scenario
+healthCheck: http://localhost:8080/c3p0-0.9.2.x-0.10.x-scenario/case/healthCheck
+startScript: ./bin/startup.sh
+environment:
+depends_on:
+  - mysql-server
+dependencies:
+  mysql-server:
+    image: mysql:5.7
+    hostname: mysql-server
+    expose:
+      - "3306"
+    environment:
+      - MYSQL_ROOT_PASSWORD=root
+      - MYSQL_DATABASE=test
diff --git a/test/plugin/scenarios/c3p0-0.9.2.x-0.10.x-scenario/pom.xml b/test/plugin/scenarios/c3p0-0.9.2.x-0.10.x-scenario/pom.xml
new file mode 100755
index 0000000000..dc4e7cf830
--- /dev/null
+++ b/test/plugin/scenarios/c3p0-0.9.2.x-0.10.x-scenario/pom.xml
@@ -0,0 +1,127 @@
+<?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>c3p0-0.9.2.x-0.10.x-scenario</artifactId>
+    <version>1.0.0</version>
+    <packaging>jar</packaging>
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <compiler.version>1.8</compiler.version>
+        <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
+        <test.framework.version>0.9.5.5</test.framework.version>
+        <docker.image.version>${test.framework.version}</docker.image.version>
+        <spring.boot.version>2.1.6.RELEASE</spring.boot.version>
+    </properties>
+
+    <name>skywalking-c3p0-0.9.2.x-0.10.x-scenario</name>
+
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-dependencies</artifactId>
+                <version>${spring.boot.version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.springframework.boot</groupId>
+                    <artifactId>spring-boot-starter-logging</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-log4j2</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+            <version>5.1.25</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.mchange</groupId>
+            <artifactId>c3p0</artifactId>
+            <version>${test.framework.version}</version>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <finalName>c3p0-0.9.2.x-0.10.x-scenario</finalName>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <version>${spring.boot.version}</version>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>repackage</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <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-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>
\ No newline at end of file
diff --git a/test/plugin/scenarios/c3p0-0.9.2.x-0.10.x-scenario/src/main/assembly/assembly.xml b/test/plugin/scenarios/c3p0-0.9.2.x-0.10.x-scenario/src/main/assembly/assembly.xml
new file mode 100755
index 0000000000..724b0f4a36
--- /dev/null
+++ b/test/plugin/scenarios/c3p0-0.9.2.x-0.10.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}/c3p0-0.9.2.x-0.10.x-scenario.jar</source>
+            <outputDirectory>./libs</outputDirectory>
+            <fileMode>0775</fileMode>
+        </file>
+    </files>
+</assembly>
diff --git a/test/plugin/scenarios/c3p0-0.9.2.x-0.10.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/c3p0/mchange/Application.java b/test/plugin/scenarios/c3p0-0.9.2.x-0.10.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/c3p0/mchange/Application.java
new file mode 100755
index 0000000000..6f88c48cbc
--- /dev/null
+++ b/test/plugin/scenarios/c3p0-0.9.2.x-0.10.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/c3p0/mchange/Application.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.testcase.c3p0.mchange;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+public class Application {
+
+    public static void main(String[] args) {
+        try {
+            SpringApplication.run(Application.class, args);
+        } catch (Exception e) {
+            // Never do this
+        }
+    }
+}
diff --git a/test/plugin/scenarios/c3p0-0.9.2.x-0.10.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/c3p0/mchange/MysqlConfig.java b/test/plugin/scenarios/c3p0-0.9.2.x-0.10.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/c3p0/mchange/MysqlConfig.java
new file mode 100755
index 0000000000..8762486f35
--- /dev/null
+++ b/test/plugin/scenarios/c3p0-0.9.2.x-0.10.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/c3p0/mchange/MysqlConfig.java
@@ -0,0 +1,57 @@
+/*
+ * 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.c3p0.mchange;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
+public class MysqlConfig {
+    private static Logger LOGGER = LogManager.getLogger(MysqlConfig.class);
+    private static String URL;
+    private static String USER_NAME;
+    private static String PASSWORD;
+
+    static {
+        InputStream inputStream = MysqlConfig.class.getClassLoader().getResourceAsStream("jdbc.properties");
+        Properties properties = new Properties();
+        try {
+            properties.load(inputStream);
+        } catch (IOException e) {
+            LOGGER.error("Failed to load config", e);
+        }
+        URL = properties.getProperty("mysql.url");
+        USER_NAME = properties.getProperty("mysql.username");
+        PASSWORD = properties.getProperty("mysql.password");
+    }
+
+    public static String getUrl() {
+        return URL;
+    }
+
+    public static String getUserName() {
+        return USER_NAME;
+    }
+
+    public static String getPassword() {
+        return PASSWORD;
+    }
+}
diff --git a/test/plugin/scenarios/c3p0-0.9.2.x-0.10.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/c3p0/mchange/controller/CaseController.java b/test/plugin/scenarios/c3p0-0.9.2.x-0.10.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/c3p0/mchange/controller/CaseController.java
new file mode 100755
index 0000000000..c9d8432531
--- /dev/null
+++ b/test/plugin/scenarios/c3p0-0.9.2.x-0.10.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/c3p0/mchange/controller/CaseController.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.testcase.c3p0.mchange.controller;
+
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.apache.skywalking.apm.testcase.c3p0.mchange.service.CaseService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/case")
+public class CaseController {
+
+    @Autowired
+    CaseService caseService;
+
+    private static final Logger LOGGER = LogManager.getLogger(CaseController.class);
+
+    private static final String SUCCESS = "Success";
+    
+    @RequestMapping("/c3p0-0.9.2.x-0.10.x-scenario")
+    @ResponseBody
+    public String testcase() throws Exception {
+        try {
+            caseService.testCase();
+        } catch (Exception e) {
+            LOGGER.error("Failed to execute sql.", e);
+            throw e;
+        }
+        return SUCCESS;
+    }
+
+    @RequestMapping("/healthCheck")
+    @ResponseBody
+    public String healthCheck() throws Exception {
+        return SUCCESS;
+    }
+
+}
diff --git a/test/plugin/scenarios/c3p0-0.9.2.x-0.10.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/c3p0/mchange/service/CaseService.java b/test/plugin/scenarios/c3p0-0.9.2.x-0.10.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/c3p0/mchange/service/CaseService.java
new file mode 100644
index 0000000000..3d493b2a27
--- /dev/null
+++ b/test/plugin/scenarios/c3p0-0.9.2.x-0.10.x-scenario/src/main/java/org/apache/skywalking/apm/testcase/c3p0/mchange/service/CaseService.java
@@ -0,0 +1,73 @@
+/*
+ * 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.c3p0.mchange.service;
+
+import com.mchange.v2.c3p0.ComboPooledDataSource;
+import java.sql.Connection;
+import java.sql.SQLException;
+import java.sql.Statement;
+import org.apache.skywalking.apm.testcase.c3p0.mchange.MysqlConfig;
+import org.springframework.stereotype.Service;
+
+@Service
+public class CaseService {
+
+    public static ComboPooledDataSource DS;
+    private static final String CREATE_TABLE_SQL = "CREATE TABLE test_C3P0(\n" + "id VARCHAR(1) PRIMARY KEY, \n" + "value VARCHAR(1) NOT NULL)";
+    private static final String INSERT_DATA_SQL = "INSERT INTO test_C3P0(id, value) VALUES(1,1)";
+    private static final String QUERY_DATA_SQL = "SELECT id, value FROM test_C3P0 WHERE id=1";
+    private static final String DELETE_DATA_SQL = "DELETE FROM test_C3P0 WHERE id=1";
+    private static final String DROP_TABLE_SQL = "DROP table test_C3P0";
+
+    static {
+        try {
+            DS = new ComboPooledDataSource();
+            DS.setDriverClass("com.mysql.jdbc.Driver");
+            DS.setJdbcUrl(MysqlConfig.getUrl());
+            DS.setUser(MysqlConfig.getUserName());
+            DS.setPassword(MysqlConfig.getPassword());
+            DS.setAcquireIncrement(1);
+            DS.setInitialPoolSize(5);
+            DS.setMinPoolSize(1);
+            DS.setMaxIdleTime(10);
+            DS.setTestConnectionOnCheckin(false);
+            DS.setTestConnectionOnCheckout(false);
+
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    public void testCase() {
+        sqlExecutor(DS, CREATE_TABLE_SQL);
+        sqlExecutor(DS, INSERT_DATA_SQL);
+        sqlExecutor(DS, QUERY_DATA_SQL);
+        sqlExecutor(DS, DELETE_DATA_SQL);
+        sqlExecutor(DS, DROP_TABLE_SQL);
+    }
+
+    public void sqlExecutor(ComboPooledDataSource dataSource, String sql) {
+        try (Connection conn = dataSource.getConnection();) {
+            Statement statement = conn.createStatement();
+            statement.execute(sql);
+        } catch (SQLException e) {
+            e.printStackTrace();
+        }
+    }
+}
diff --git a/test/plugin/scenarios/c3p0-0.9.2.x-0.10.x-scenario/src/main/resources/application.yaml b/test/plugin/scenarios/c3p0-0.9.2.x-0.10.x-scenario/src/main/resources/application.yaml
new file mode 100755
index 0000000000..88dfae1b32
--- /dev/null
+++ b/test/plugin/scenarios/c3p0-0.9.2.x-0.10.x-scenario/src/main/resources/application.yaml
@@ -0,0 +1,23 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+#
+server:
+  port: 8080
+  servlet:
+    context-path: /c3p0-0.9.2.x-0.10.x-scenario
+logging:
+  config: classpath:log4j2.xml
\ No newline at end of file
diff --git a/test/plugin/scenarios/c3p0-0.9.2.x-0.10.x-scenario/src/main/resources/jdbc.properties b/test/plugin/scenarios/c3p0-0.9.2.x-0.10.x-scenario/src/main/resources/jdbc.properties
new file mode 100755
index 0000000000..8051777cce
--- /dev/null
+++ b/test/plugin/scenarios/c3p0-0.9.2.x-0.10.x-scenario/src/main/resources/jdbc.properties
@@ -0,0 +1,19 @@
+#
+# 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.
+#
+mysql.url=jdbc:mysql://mysql-server:3306/test?serverTimezone=CST&useLocalSessionState=true
+mysql.username=root
+mysql.password=root
\ No newline at end of file
diff --git a/test/plugin/scenarios/c3p0-0.9.2.x-0.10.x-scenario/src/main/resources/log4j2.xml b/test/plugin/scenarios/c3p0-0.9.2.x-0.10.x-scenario/src/main/resources/log4j2.xml
new file mode 100755
index 0000000000..9849ed5a8a
--- /dev/null
+++ b/test/plugin/scenarios/c3p0-0.9.2.x-0.10.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/c3p0-0.9.2.x-0.10.x-scenario/support-version.list b/test/plugin/scenarios/c3p0-0.9.2.x-0.10.x-scenario/support-version.list
new file mode 100755
index 0000000000..9405ba41cc
--- /dev/null
+++ b/test/plugin/scenarios/c3p0-0.9.2.x-0.10.x-scenario/support-version.list
@@ -0,0 +1,19 @@
+# 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.
+
+0.10.0
+0.9.5.5
+0.9.2.1
\ No newline at end of file