Browse Source

Strict context check on okhttp3 (#3925)

Lauri Tulmin 3 years ago
parent
commit
a923efc077

+ 0 - 4
instrumentation/okhttp/okhttp-3.0/javaagent/build.gradle.kts

@@ -27,7 +27,3 @@ dependencies {
 
   testImplementation(project(":instrumentation:okhttp:okhttp-3.0:testing"))
 }
-
-tasks.withType<Test>().configureEach {
-  jvmArgs("-Dio.opentelemetry.javaagent.shaded.io.opentelemetry.context.enableStrictContext=false")
-}

+ 2 - 0
instrumentation/okhttp/okhttp-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/okhttp/v3_0/OkHttp3IgnoredTypesConfigurer.java

@@ -19,5 +19,7 @@ public class OkHttp3IgnoredTypesConfigurer implements IgnoredTypesConfigurer {
     // similar to an event loop. The submitted tasks themselves should already be
     // instrumented to allow async propagation.
     builder.ignoreTaskClass("okhttp3.internal.concurrent.TaskRunner");
+    // ConnectionPool constructor creates an anonymous Runnable for cleanup
+    builder.ignoreTaskClass("okhttp3.ConnectionPool");
   }
 }