Tinkering with version compatibility
RepositoryProxyPostProcessor has different method sigs depending on the version of spring-data-commons.
As stop gap implemented both signatures, but probably need to split spring-data support by version.
MODIFY
dd-java-agent/instrumentation/spring-data/spring-data.gradle
dd-java-agent/instrumentation/spring-data/spring-data.gradle
@@ -21,13 +21,14 @@ testSets {
dependencies {
compileOnly(group: 'aopalliance', name: 'aopalliance', version: '1.0')
- compileOnly(group: 'org.springframework.data', name: 'spring-data-commons', version: '1.5.0.RELEASE')
+ compileOnly(group: 'org.springframework.data', name: 'spring-data-commons', version: '2.0.0.RELEASE')
compileOnly(group: 'org.springframework', name: 'spring-aop', version: '3.0.0.RELEASE')
testCompile project(':dd-java-agent:instrumentation:jdbc')
testCompile group: 'org.spockframework', name: 'spock-spring', version: "$versions.spock"
testCompile group: 'org.springframework', name: 'spring-test', version: '3.0.0.RELEASE'
testCompile group: 'org.springframework.data', name: 'spring-data-jpa', version: '1.2.0.RELEASE'
+ // testCompile group: 'org.springframework.data', name: 'spring-data-jdbc', version: '1.0.0.RELEASE'
testCompile group: 'com.mysema.querydsl', name: 'querydsl-jpa', version: '3.7.4'
testCompile group: 'org.hsqldb', name: 'hsqldb', version: '2.0.0'
testCompile group: 'org.hibernate', name: 'hibernate-entitymanager', version: '4.3.0.Final'

MODIFY
dd-java-agent/instrumentation/spring-data/src/main/java/datadog/trace/instrumentation/springdata/SpringRepositoryInstrumentation.java
dd-java-agent/instrumentation/spring-data/src/main/java/datadog/trace/instrumentation/springdata/SpringRepositoryInstrumentation.java
@@ -21,6 +21,7 @@ import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
import org.springframework.aop.framework.ProxyFactory;
import org.springframework.data.repository.Repository;
+import org.springframework.data.repository.core.RepositoryInformation;
import org.springframework.data.repository.core.support.RepositoryFactorySupport;
import org.springframework.data.repository.core.support.RepositoryProxyPostProcessor;
@@ -66,8 +67,14 @@ public final class SpringRepositoryInstrumentation extends Instrumenter.Default
public static final RepositoryProxyPostProcessor INSTANCE =
new InterceptingRepositoryProxyPostProcessor();
- @Override
- public void postProcess(ProxyFactory factory) {
+ // DQH - TODO: Implement old & new signatures of postProcess for versiosn compatibility
+ // Probably better to split by version
+
+ public void postProcess(final ProxyFactory factory) {
+ factory.addAdvice(0, RepositoryInterceptor.INSTANCE);
+ }
+
+ public void postProcess(final ProxyFactory factory, final RepositoryInformation repositoryInformation) {
factory.addAdvice(0, RepositoryInterceptor.INSTANCE);
}
}

Tinkering with version compatibility

RepositoryProxyPostProcessor has different method sigs depending on the version of spring-data-commons.

As stop gap implemented both signatures, but probably need to split spring-data support by version.