ShardingSphere plugins conflict among themselves. (#4921)
* Fix shardingSphere plugin test fail if have some same ENHANCE_CLASS define. * support 4.1.0 and 4.1.1 * support 4.1.0 and 4.1.1
This commit is contained in:
parent
5de0d2c6f6
commit
a24efcf5e9
|
|
@ -42,6 +42,10 @@ jobs:
|
|||
- { name: 'resttemplate-4.x-scenario', title: 'RestTemplate 4.0.0.RELEASE-4.3.26.RELEASE (57)' }
|
||||
- { name: 'servicecomb-0.x-scenario', title: 'ServiceComb 0.x (5)' }
|
||||
- { name: 'servicecomb-1.x-scenario', title: 'ServiceComb 1.x (5)' }
|
||||
- { name: 'shardingsphere-3.x-scenario', title: 'ShardingSphere 3.0.0 (1)' }
|
||||
- { name: 'shardingsphere-4.x-RC1-RC2-scenario', title: 'ShardingSphere 4.0.0-RC1-4.0.0-RC2 (2)' }
|
||||
- { name: 'shardingsphere-4.x-RC3-scenario', title: 'ShardingSphere 4.0.0-RC3 (1)' }
|
||||
- { name: 'shardingsphere-4.x-scenario', title: 'ShardingSphere 4.1.0-4.1.1 (2)' }
|
||||
- { name: 'sofarpc-scenario', title: 'SofaRPC 5.4.0-5.6.2 (23)' }
|
||||
- { name: 'solrj-7.x-scenario', title: 'SolrJ 7.x (12)' }
|
||||
- { name: 'spring-3.0.x-scenario', title: 'Spring 3.0.x (8)' }
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ Release Notes.
|
|||
* Support Prometheus network protocol. Metrics in Prometheus format could be transferred into SkyWalking.
|
||||
* Python agent provided.
|
||||
* All inventory caches have been removed.
|
||||
* Apache ShardingSphere(4.0.0, 4.1.1) agent plugin provided.
|
||||
* Apache ShardingSphere(4.1.0, 4.1.1) agent plugin provided.
|
||||
|
||||
#### Java Agent
|
||||
* Add MariaDB plugin.
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<shardingsphere.version>[4.0.0,4.1.1]</shardingsphere.version>
|
||||
<shardingsphere.version>4.1.0</shardingsphere.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
|
|
|||
|
|
@ -20,13 +20,14 @@ package org.apache.skywalking.apm.plugin.shardingsphere.v41;
|
|||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.shardingsphere.underlying.executor.engine.ExecutorDataMap;
|
||||
import org.apache.skywalking.apm.agent.core.context.ContextManager;
|
||||
import org.apache.skywalking.apm.agent.core.context.ContextSnapshot;
|
||||
import org.apache.skywalking.apm.agent.core.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 org.apache.skywalking.apm.plugin.shardingsphere.v41.threadlocal.ContextThreadLocal;
|
||||
|
||||
/**
|
||||
* {@link ExecuteInterceptor} enhances. {@link org.apache.shardingsphere.sharding.execute.sql.execute.SQLExecuteCallback}
|
||||
|
|
@ -38,7 +39,7 @@ public class ExecuteInterceptor implements InstanceMethodsAroundInterceptor {
|
|||
public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
|
||||
MethodInterceptResult result) {
|
||||
ContextManager.createLocalSpan("/ShardingSphere/executeSQL/").setComponent(ComponentsDefine.SHARDING_SPHERE);
|
||||
ContextSnapshot contextSnapshot = (ContextSnapshot) ContextThreadLocal.getValue()
|
||||
ContextSnapshot contextSnapshot = (ContextSnapshot) ExecutorDataMap.getValue()
|
||||
.get(Constant.CONTEXT_SNAPSHOT);
|
||||
if (null == contextSnapshot) {
|
||||
contextSnapshot = (ContextSnapshot) ((Map) allArguments[2]).get(Constant.CONTEXT_SNAPSHOT);
|
||||
|
|
@ -52,7 +53,6 @@ public class ExecuteInterceptor implements InstanceMethodsAroundInterceptor {
|
|||
public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
|
||||
Object ret) {
|
||||
ContextManager.stopSpan();
|
||||
ContextThreadLocal.remove();
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -60,6 +60,5 @@ public class ExecuteInterceptor implements InstanceMethodsAroundInterceptor {
|
|||
public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments,
|
||||
Class<?>[] argumentsTypes, Throwable t) {
|
||||
ContextManager.activeSpan().errorOccurred().log(t);
|
||||
ContextThreadLocal.remove();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,12 +19,13 @@
|
|||
package org.apache.skywalking.apm.plugin.shardingsphere.v41;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import org.apache.shardingsphere.underlying.executor.engine.ExecutorDataMap;
|
||||
import org.apache.skywalking.apm.agent.core.context.ContextManager;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult;
|
||||
import org.apache.skywalking.apm.network.trace.component.ComponentsDefine;
|
||||
import org.apache.skywalking.apm.plugin.shardingsphere.v41.threadlocal.ContextThreadLocal;
|
||||
|
||||
/**
|
||||
* {@link JDBCRootInvokeInterceptor} enhances {@link org.apache.shardingsphere.shardingjdbc.executor.AbstractStatementExecutor},
|
||||
|
|
@ -37,7 +38,7 @@ public class JDBCRootInvokeInterceptor implements InstanceMethodsAroundIntercept
|
|||
MethodInterceptResult result) {
|
||||
ContextManager.createLocalSpan("/ShardingSphere/JDBCRootInvoke/")
|
||||
.setComponent(ComponentsDefine.SHARDING_SPHERE);
|
||||
ContextThreadLocal.getValue().put(Constant.CONTEXT_SNAPSHOT, ContextManager.capture());
|
||||
ExecutorDataMap.getValue().put(Constant.CONTEXT_SNAPSHOT, ContextManager.capture());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -19,12 +19,13 @@
|
|||
package org.apache.skywalking.apm.plugin.shardingsphere.v41;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import org.apache.shardingsphere.underlying.executor.engine.ExecutorDataMap;
|
||||
import org.apache.skywalking.apm.agent.core.context.ContextManager;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
|
||||
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult;
|
||||
import org.apache.skywalking.apm.network.trace.component.ComponentsDefine;
|
||||
import org.apache.skywalking.apm.plugin.shardingsphere.v41.threadlocal.ContextThreadLocal;
|
||||
|
||||
/**
|
||||
* ProxyRootInvokeInterceptor enhances. skywalking intercepts org.apache.shardingsphere.shardingproxy.frontend.command.CommandExecutorTask
|
||||
|
|
@ -37,7 +38,7 @@ public class ProxyRootInvokeInterceptor implements InstanceMethodsAroundIntercep
|
|||
MethodInterceptResult result) {
|
||||
ContextManager.createLocalSpan("/ShardingSphere/ProxyRootInvoke/")
|
||||
.setComponent(ComponentsDefine.SHARDING_SPHERE);
|
||||
ContextThreadLocal.getValue().put(Constant.CONTEXT_SNAPSHOT, ContextManager.capture());
|
||||
ExecutorDataMap.getValue().put(Constant.CONTEXT_SNAPSHOT, ContextManager.capture());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.apache.skywalking.apm.plugin.shardingsphere.v41.define;
|
||||
|
||||
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine;
|
||||
|
||||
public abstract class AbstractShardingSphere41Instrumentation extends ClassInstanceMethodsEnhancePluginDefine {
|
||||
public static final String WITHNESS_CLASSES = "org.apache.shardingsphere.sql.parser.SQLParserEngine";
|
||||
|
||||
@Override
|
||||
protected final String[] witnessClasses() {
|
||||
return new String[] {WITHNESS_CLASSES};
|
||||
}
|
||||
}
|
||||
|
|
@ -22,7 +22,6 @@ 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 org.apache.skywalking.apm.agent.core.plugin.match.NameMatch;
|
||||
|
||||
|
|
@ -31,7 +30,7 @@ import static net.bytebuddy.matcher.ElementMatchers.named;
|
|||
/**
|
||||
* {@link ExecuteInstrumentation} presents that skywalking intercepts. {@link org.apache.shardingsphere.sharding.execute.sql.execute.SQLExecuteCallback}.
|
||||
*/
|
||||
public class ExecuteInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
|
||||
public class ExecuteInstrumentation extends AbstractShardingSphere41Instrumentation {
|
||||
|
||||
private static final String ENHANCE_CLASS = "org.apache.shardingsphere.sharding.execute.sql.execute.SQLExecuteCallback";
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ 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 org.apache.skywalking.apm.agent.core.plugin.match.NameMatch;
|
||||
|
||||
|
|
@ -31,7 +30,7 @@ import static net.bytebuddy.matcher.ElementMatchers.named;
|
|||
/**
|
||||
* {@link JDBCRootInvokeInstrumentation} presents that skywalking intercepts. {@link org.apache.shardingsphere.shardingjdbc.executor.AbstractStatementExecutor}.
|
||||
*/
|
||||
public class JDBCRootInvokeInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
|
||||
public class JDBCRootInvokeInstrumentation extends AbstractShardingSphere41Instrumentation {
|
||||
|
||||
private static final String ENHANCE_CLASS = "org.apache.shardingsphere.shardingjdbc.executor.AbstractStatementExecutor";
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ 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 org.apache.skywalking.apm.agent.core.plugin.match.NameMatch;
|
||||
|
||||
|
|
@ -31,7 +30,7 @@ import static net.bytebuddy.matcher.ElementMatchers.named;
|
|||
/**
|
||||
* ProxyRootInvokeInstrumentation presents that skywalking intercepts. skywalking intercepts org.apache.shardingsphere.shardingproxy.frontend.command.CommandExecutorTask.
|
||||
*/
|
||||
public class ProxyRootInvokeInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
|
||||
public class ProxyRootInvokeInstrumentation extends AbstractShardingSphere41Instrumentation {
|
||||
|
||||
private static final String ENHANCE_CLASS = "org.apache.shardingsphere.shardingproxy.frontend.command.CommandExecutorTask";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,48 +0,0 @@
|
|||
/*
|
||||
* 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.shardingsphere.v41.threadlocal;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* Context thread local for skywalking.
|
||||
*/
|
||||
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
||||
public final class ContextThreadLocal {
|
||||
|
||||
private static ThreadLocal<Map<String, Object>> CONTEXT_DATA_MAP = ThreadLocal.withInitial(LinkedHashMap::new);
|
||||
|
||||
/**
|
||||
* Get value.
|
||||
*
|
||||
* @return data map
|
||||
*/
|
||||
public static Map<String, Object> getValue() {
|
||||
return CONTEXT_DATA_MAP.get();
|
||||
}
|
||||
|
||||
/**
|
||||
* remove for thread local for gc.
|
||||
*/
|
||||
public static void remove() {
|
||||
CONTEXT_DATA_MAP.remove();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.apache.skywalking.apm.plugin.shardingsphere.v4rc3.define;
|
||||
|
||||
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine;
|
||||
|
||||
public abstract class AbstractShardingSphereV4R3Instrumentation extends ClassInstanceMethodsEnhancePluginDefine {
|
||||
public static final String WITHNESS_CLASSES = "org.apache.shardingsphere.core.route.router.sharding.ShardingRouter";
|
||||
|
||||
@Override
|
||||
protected final String[] witnessClasses() {
|
||||
return new String[] {WITHNESS_CLASSES};
|
||||
}
|
||||
}
|
||||
|
|
@ -22,7 +22,6 @@ 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 org.apache.skywalking.apm.agent.core.plugin.match.NameMatch;
|
||||
|
||||
|
|
@ -31,7 +30,7 @@ import static net.bytebuddy.matcher.ElementMatchers.named;
|
|||
/**
|
||||
* {@link ExecuteInstrumentation} presents that skywalking intercepts {@link org.apache.shardingsphere.core.execute.sql.execute.SQLExecuteCallback}.
|
||||
*/
|
||||
public class ExecuteInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
|
||||
public class ExecuteInstrumentation extends AbstractShardingSphereV4R3Instrumentation {
|
||||
|
||||
private static final String ENHANCE_CLASS = "org.apache.shardingsphere.core.execute.sql.execute.SQLExecuteCallback";
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ 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 org.apache.skywalking.apm.agent.core.plugin.match.NameMatch;
|
||||
|
||||
|
|
@ -32,7 +31,7 @@ import static net.bytebuddy.matcher.ElementMatchers.named;
|
|||
* {@link JDBCRootInvokeInstrumentation} presents that skywalking intercepts {@link
|
||||
* org.apache.shardingsphere.shardingjdbc.executor.AbstractStatementExecutor}.
|
||||
*/
|
||||
public class JDBCRootInvokeInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
|
||||
public class JDBCRootInvokeInstrumentation extends AbstractShardingSphereV4R3Instrumentation {
|
||||
|
||||
private static final String ENHANCE_CLASS = "org.apache.shardingsphere.shardingjdbc.executor.AbstractStatementExecutor";
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ 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 org.apache.skywalking.apm.agent.core.plugin.match.NameMatch;
|
||||
|
||||
|
|
@ -31,7 +30,7 @@ import static net.bytebuddy.matcher.ElementMatchers.named;
|
|||
/**
|
||||
* ProxyRootInvokeInstrumentation presents that skywalking intercepts org.apache.shardingsphere.shardingproxy.frontend.command.CommandExecutorTask.
|
||||
*/
|
||||
public class ProxyRootInvokeInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
|
||||
public class ProxyRootInvokeInstrumentation extends AbstractShardingSphereV4R3Instrumentation {
|
||||
|
||||
private static final String ENHANCE_CLASS = "org.apache.shardingsphere.shardingproxy.frontend.command.CommandExecutorTask";
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.apache.skywalking.apm.plugin.shardingsphere.v4.define;
|
||||
|
||||
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine;
|
||||
|
||||
public abstract class AbstractShardingSphereV4Instrumentation extends ClassInstanceMethodsEnhancePluginDefine {
|
||||
public static final String WITHNESS_CLASSES = "org.apache.shardingsphere.core.route.router.sharding.ParsingSQLRouter";
|
||||
|
||||
@Override
|
||||
protected final String[] witnessClasses() {
|
||||
return new String[] {WITHNESS_CLASSES};
|
||||
}
|
||||
}
|
||||
|
|
@ -22,7 +22,6 @@ 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 org.apache.skywalking.apm.agent.core.plugin.match.NameMatch;
|
||||
|
||||
|
|
@ -31,7 +30,7 @@ import static net.bytebuddy.matcher.ElementMatchers.named;
|
|||
/**
|
||||
* {@link ExecuteInstrumentation} presents that skywalking intercepts {@link org.apache.shardingsphere.core.execute.sql.execute.SQLExecuteCallback}.
|
||||
*/
|
||||
public class ExecuteInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
|
||||
public class ExecuteInstrumentation extends AbstractShardingSphereV4Instrumentation {
|
||||
|
||||
private static final String ENHANCE_CLASS = "org.apache.shardingsphere.core.execute.sql.execute.SQLExecuteCallback";
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ 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 org.apache.skywalking.apm.agent.core.plugin.match.NameMatch;
|
||||
|
||||
|
|
@ -32,7 +31,7 @@ import static net.bytebuddy.matcher.ElementMatchers.named;
|
|||
* {@link JDBCRootInvokeInstrumentation} presents that skywalking intercepts {@link
|
||||
* org.apache.shardingsphere.shardingjdbc.executor.AbstractStatementExecutor}.
|
||||
*/
|
||||
public class JDBCRootInvokeInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
|
||||
public class JDBCRootInvokeInstrumentation extends AbstractShardingSphereV4Instrumentation {
|
||||
|
||||
private static final String ENHANCE_CLASS = "org.apache.shardingsphere.shardingjdbc.executor.AbstractStatementExecutor";
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ 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 org.apache.skywalking.apm.agent.core.plugin.match.NameMatch;
|
||||
|
||||
|
|
@ -31,7 +30,7 @@ import static net.bytebuddy.matcher.ElementMatchers.named;
|
|||
/**
|
||||
* ProxyRootInvokeInstrumentation presents that skywalking intercepts org.apache.shardingsphere.shardingproxy.frontend.command.CommandExecutorTask.
|
||||
*/
|
||||
public class ProxyRootInvokeInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
|
||||
public class ProxyRootInvokeInstrumentation extends AbstractShardingSphereV4Instrumentation {
|
||||
|
||||
private static final String ENHANCE_CLASS = "org.apache.shardingsphere.shardingproxy.frontend.command.CommandExecutorTask";
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@
|
|||
* Oracle Driver (Optional¹)
|
||||
* H2 Driver 1.3.x -> 1.4.x
|
||||
* [Sharding-JDBC](https://github.com/shardingjdbc/sharding-jdbc) 1.5.x
|
||||
* [ShardingSphere](https://github.com/apache/shardingsphere) 3.0.0, 4.0.0-RC1, 4.0.0 -> 4.1.1
|
||||
* [ShardingSphere](https://github.com/apache/shardingsphere) 3.0.0, 4.0.0-RC1, 4.1.0, 4.1.1
|
||||
* PostgreSQL Driver 8.x, 9.x, 42.x
|
||||
* Mariadb Driver 2.x, 1.8
|
||||
* RPC Frameworks
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
|
||||
<test.framework.version>[4.0.0, 4.1.1]</test.framework.version>
|
||||
<test.framework.version>4.1.0</test.framework.version>
|
||||
|
||||
<log4j.version>2.6.2</log4j.version>
|
||||
<spring.version>4.3.8.RELEASE</spring.version>
|
||||
|
|
@ -48,9 +48,9 @@
|
|||
<version>${test.framework.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-dbcp</groupId>
|
||||
<artifactId>commons-dbcp</artifactId>
|
||||
<version>1.4</version>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-dbcp2</artifactId>
|
||||
<version>2.2.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
|
|
|||
|
|
@ -18,13 +18,14 @@
|
|||
|
||||
package org.apache.skywalking.apm.testcase.shardingsphere.service.utility.config;
|
||||
|
||||
import org.apache.commons.dbcp2.BasicDataSource;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import javax.sql.DataSource;
|
||||
import org.apache.commons.dbcp.BasicDataSource;
|
||||
|
||||
public class DataSourceUtil {
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,5 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
4.0.0
|
||||
4.0.1
|
||||
4.1.0
|
||||
4.1.1
|
||||
4.1.1
|
||||
|
|
|
|||
Loading…
Reference in New Issue