Updates to thread propagation debug property
MODIFY
gradle/instrumentation.gradle
gradle/instrumentation.gradle
@@ -115,8 +115,6 @@ tasks.withType(Test).configureEach {
jvmArgs "-javaagent:${project(":testing:agent-for-testing").tasks.shadowJar.archiveFile.get().asFile.absolutePath}"
jvmArgs "-Dotel.javaagent.experimental.initializer.jar=${shadowJar.archiveFile.get().asFile.absolutePath}"
jvmArgs "-Dotel.javaagent.testing.additional-library-ignores.enabled=false"
- // always run with the thread propagation debugger to help track down sporadic test failures
- jvmArgs "-Dotel.javaagent.experimental.thread-propagation-debugger.enabled=true"
jvmArgs "-Dotel.javaagent.testing.fail-on-context-leak=true"
// prevent sporadic gradle deadlocks, see SafeLogger for more details
jvmArgs "-Dotel.javaagent.testing.transform-safe-logging.enabled=true"

MODIFY
instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/context/ContextPropagationDebug.java
instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/context/ContextPropagationDebug.java
@@ -8,6 +8,7 @@ package io.opentelemetry.instrumentation.api.context;
import io.opentelemetry.api.trace.Span;
import io.opentelemetry.context.Context;
import io.opentelemetry.context.ContextKey;
+import io.opentelemetry.instrumentation.api.config.Config;
import java.util.Iterator;
import java.util.List;
import org.slf4j.Logger;
@@ -22,9 +23,13 @@ public final class ContextPropagationDebug {
ContextKey.named("thread-propagation-locations");
private static final boolean THREAD_PROPAGATION_DEBUGGER =
- Boolean.getBoolean("otel.javaagent.experimental.thread-propagation-debugger.enabled");
+ Config.get()
+ .getBooleanProperty(
+ "otel.javaagent.experimental.thread-propagation-debugger.enabled",
+ Config.get().isAgentDebugEnabled());
+
private static final boolean FAIL_ON_CONTEXT_LEAK =
- Boolean.getBoolean("otel.javaagent.testing.fail-on-context-leak");
+ Config.get().getBooleanProperty("otel.javaagent.testing.fail-on-context-leak", false);
public static boolean isThreadPropagationDebuggerEnabled() {
return THREAD_PROPAGATION_DEBUGGER;

Updates to thread propagation debug property (#2500)