Muzzle OKHttp 3 Instrumentation
Add muzzle block and remove class loader matcher method.
MODIFY
dd-java-agent/instrumentation/okhttp-3/okhttp-3.gradle
dd-java-agent/instrumentation/okhttp-3/okhttp-3.gradle
-apply plugin: 'version-scan'
-
-versionScan {
+muzzle {
+ pass {
group = "com.squareup.okhttp3"
module = "okhttp"
versions = "[3.0,)"
- legacyGroup = "com.squareup.okhttp"
- verifyPresent = [
- "okhttp3.Cookie" : null,
- "okhttp3.ConnectionPool": null,
- "okhttp3.Headers" : null,
- ]
+ assertInverse = true
+ }
}
apply from: "${rootDir}/gradle/java.gradle"

MODIFY
dd-java-agent/instrumentation/okhttp-3/src/main/java/datadog/trace/instrumentation/okhttp3/OkHttp3Instrumentation.java
dd-java-agent/instrumentation/okhttp-3/src/main/java/datadog/trace/instrumentation/okhttp3/OkHttp3Instrumentation.java
package datadog.trace.instrumentation.okhttp3;
-import static datadog.trace.agent.tooling.ClassLoaderMatcher.classLoaderHasClasses;
import static datadog.trace.instrumentation.okhttp3.OkHttpClientSpanDecorator.STANDARD_TAGS;
import static net.bytebuddy.matcher.ElementMatchers.isConstructor;
import static net.bytebuddy.matcher.ElementMatchers.named;
@@ -30,17 +29,6 @@ public class OkHttp3Instrumentation extends Instrumenter.Default {
return named("okhttp3.OkHttpClient");
}
- @Override
- public ElementMatcher<ClassLoader> classLoaderMatcher() {
- return classLoaderHasClasses(
- "okhttp3.Request",
- "okhttp3.Response",
- "okhttp3.Connection",
- "okhttp3.Cookie",
- "okhttp3.ConnectionPool",
- "okhttp3.Headers");
- }
-
@Override
public String[] helperClassNames() {
return new String[] {

Muzzle OKHttp 3 Instrumentation

Add muzzle block and remove class loader matcher method.