Strict context check on okhttp3
MODIFY
instrumentation/okhttp/okhttp-3.0/javaagent/build.gradle.kts
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")
-}

MODIFY
instrumentation/okhttp/okhttp-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/okhttp/v3_0/OkHttp3IgnoredTypesConfigurer.java
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");
}
}

Strict context check on okhttp3 (#3925)