Fix muzzle test for 3.0
MODIFY
dd-java-agent/instrumentation/jedis-1.4/src/main/java/datadog/trace/instrumentation/jedis/JedisInstrumentation.java
dd-java-agent/instrumentation/jedis-1.4/src/main/java/datadog/trace/instrumentation/jedis/JedisInstrumentation.java
package datadog.trace.instrumentation.jedis;
+import static datadog.trace.agent.tooling.ClassLoaderMatcher.classLoaderHasClasses;
import static datadog.trace.instrumentation.api.AgentTracer.activateSpan;
import static datadog.trace.instrumentation.api.AgentTracer.startSpan;
import static datadog.trace.instrumentation.jedis.JedisClientDecorator.DECORATE;
@@ -7,6 +8,7 @@ import static java.util.Collections.singletonMap;
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
import static net.bytebuddy.matcher.ElementMatchers.isPublic;
import static net.bytebuddy.matcher.ElementMatchers.named;
+import static net.bytebuddy.matcher.ElementMatchers.not;
import static net.bytebuddy.matcher.ElementMatchers.takesArgument;
import com.google.auto.service.AutoService;
@@ -30,9 +32,14 @@ public final class JedisInstrumentation extends Instrumenter.Default {
super("jedis", "redis");
}
+ @Override
+ public ElementMatcher<ClassLoader> classLoaderMatcher() {
+ return not(classLoaderHasClasses("redis.clients.jedis.commands.ProtocolCommand"));
+ }
+
@Override
public ElementMatcher<TypeDescription> typeMatcher() {
- return named("redis.clients.jedis.Protocol").and(named("redis.clients.jedis.JedisCommands"));
+ return named("redis.clients.jedis.Protocol");
}
@Override

MODIFY
dd-java-agent/instrumentation/jedis-3.0/jedis-3.0.gradle
dd-java-agent/instrumentation/jedis-3.0/jedis-3.0.gradle
muzzle {
+ fail {
+ group = "redis.clients"
+ module = "jedis"
+ versions = "[,3.0.0)"
+ }
+
pass {
group = "redis.clients"
module = "jedis"
versions = "[3.0.0,)"
- assertInverse = true
}
}

MODIFY
dd-java-agent/instrumentation/jedis-3.0/src/main/java/datadog/trace/instrumentation/jedis30/JedisInstrumentation.java
dd-java-agent/instrumentation/jedis-3.0/src/main/java/datadog/trace/instrumentation/jedis30/JedisInstrumentation.java
@@ -30,8 +30,7 @@ public final class JedisInstrumentation extends Instrumenter.Default {
@Override
public ElementMatcher<TypeDescription> typeMatcher() {
- return named("redis.clients.jedis.Protocol")
- .and(named("redis.clients.jedis.commands.ProtocolCommand"));
+ return named("redis.clients.jedis.Protocol");
}
@Override

Fix muzzle test for 3.0