Muzzle Spymemcached
Add muzzle block and remove class loader matcher method.
MODIFY
dd-java-agent/instrumentation/spymemcached-2.12/spymemcached-2.12.gradle
dd-java-agent/instrumentation/spymemcached-2.12/spymemcached-2.12.gradle
-apply plugin: 'version-scan'
-
-versionScan {
+muzzle {
+ pass {
group = "net.spy"
module = 'spymemcached'
- versions = "[1.12.0,)"
- scanMethods = true
- verifyPresent = [
- "net.spy.memcached.ConnectionFactoryBuilder": "setListenerExecutorService",
- ]
+ versions = "[2.10.0,)"
+ assertInverse = true
+ }
}
apply from: "${rootDir}/gradle/java.gradle"

MODIFY
dd-java-agent/instrumentation/spymemcached-2.12/src/main/java/datadog/trace/instrumentation/spymemcached/MemcachedClientInstrumentation.java
dd-java-agent/instrumentation/spymemcached-2.12/src/main/java/datadog/trace/instrumentation/spymemcached/MemcachedClientInstrumentation.java
package datadog.trace.instrumentation.spymemcached;
-import static datadog.trace.agent.tooling.ClassLoaderMatcher.classLoaderHasClassWithMethod;
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
import static net.bytebuddy.matcher.ElementMatchers.isPublic;
import static net.bytebuddy.matcher.ElementMatchers.named;
@@ -38,15 +37,6 @@ public final class MemcachedClientInstrumentation extends Instrumenter.Default {
return named(MEMCACHED_PACKAGE + ".MemcachedClient");
}
- @Override
- public ElementMatcher<ClassLoader> classLoaderMatcher() {
- // Target 2.12 that has this method
- return classLoaderHasClassWithMethod(
- MEMCACHED_PACKAGE + ".ConnectionFactoryBuilder",
- "setListenerExecutorService",
- "java.util.concurrent.ExecutorService");
- }
-
@Override
public String[] helperClassNames() {
return new String[] {

Muzzle Spymemcached

Add muzzle block and remove class loader matcher method.