Muzzle and Expand Cassandra Instrumentation
Add muzzle block and remove class loader matcher method. Muzzling the instrumentation works for versions 2.3+
RENAME
dd-java-agent/instrumentation/datastax-cassandra-3.2/datastax-cassandra-3.2.gradle
dd-java-agent/instrumentation/datastax-cassandra-2.3/datastax-cassandra-2.3.gradle
-// 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"

RENAME
dd-java-agent/instrumentation/datastax-cassandra-3.2/src/main/java/datadog/trace/instrumentation/datastax/cassandra/CassandraClientInstrumentation.java
dd-java-agent/instrumentation/datastax-cassandra-2.3/src/main/java/datadog/trace/instrumentation/datastax/cassandra/CassandraClientInstrumentation.java
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[] {

RENAME
dd-java-agent/instrumentation/datastax-cassandra-3.2/src/main/java/datadog/trace/instrumentation/datastax/cassandra/TracingSession.java
dd-java-agent/instrumentation/datastax-cassandra-2.3/src/main/java/datadog/trace/instrumentation/datastax/cassandra/TracingSession.java
RENAME
dd-java-agent/instrumentation/datastax-cassandra-3.2/src/test/groovy/CassandraClientTest.groovy
dd-java-agent/instrumentation/datastax-cassandra-2.3/src/test/groovy/CassandraClientTest.groovy
MODIFY
settings.gradle
settings.gradle
@@ -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'

Muzzle and Expand Cassandra Instrumentation

Add muzzle block and remove class loader matcher method. Muzzling the instrumentation works for versions 2.3+