Muzzle and Expand Cassandra Instrumentation

Add muzzle block and remove class loader matcher method. Muzzling the instrumentation works for versions 2.3+
This commit is contained in:
Gary Huang 2018-09-10 18:30:42 -04:00
parent 9c1b641069
commit a366ed9e80
No known key found for this signature in database
GPG Key ID: 225B4CE0235DF2D1
5 changed files with 7 additions and 20 deletions

View File

@ -1,16 +1,9 @@
// TODO: VersionScan plugin does not report which version failed, which is making it hard to get meaningful results out of this block.
// Once versionScan can report on which version failed, this can be enabled.
// The desire is to apply the instrumentation to cassandra-datastax 2.3 and beyond.
apply plugin: 'version-scan'
versionScan {
muzzle {
pass {
group = "com.datastax.cassandra"
module = "cassandra-driver-core"
versions = "[3.2.0,)"
verifyPresent = [
"com.datastax.driver.core.Duration": null,
]
versions = "[2.3.0,)"
}
}
apply from: "${rootDir}/gradle/java.gradle"

View File

@ -1,6 +1,5 @@
package datadog.trace.instrumentation.datastax.cassandra;
import static datadog.trace.agent.tooling.ClassLoaderMatcher.classLoaderHasClasses;
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
import static net.bytebuddy.matcher.ElementMatchers.isPrivate;
import static net.bytebuddy.matcher.ElementMatchers.named;
@ -30,11 +29,6 @@ public class CassandraClientInstrumentation extends Instrumenter.Default {
return named("com.datastax.driver.core.Cluster$Manager");
}
@Override
public ElementMatcher<ClassLoader> classLoaderMatcher() {
return classLoaderHasClasses("com.datastax.driver.core.Duration");
}
@Override
public String[] helperClassNames() {
return new String[] {

View File

@ -14,7 +14,7 @@ include ':dd-java-agent:instrumentation:apache-httpclient-4.3'
include ':dd-java-agent:instrumentation:aws-java-sdk-1.11.0'
include ':dd-java-agent:instrumentation:aws-java-sdk-1.11.106'
include ':dd-java-agent:instrumentation:couchbase-2.0'
include ':dd-java-agent:instrumentation:datastax-cassandra-3.2'
include ':dd-java-agent:instrumentation:datastax-cassandra-2.3'
include ':dd-java-agent:instrumentation:elasticsearch-rest-5'
include ':dd-java-agent:instrumentation:elasticsearch-transport-2'
include ':dd-java-agent:instrumentation:elasticsearch-transport-5'