Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates to thread propagation debug property #2500

Merged
merged 3 commits into from Mar 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 0 additions & 2 deletions gradle/instrumentation.gradle
Expand Up @@ -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"
Expand Down
Expand Up @@ -8,6 +8,7 @@
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;
Expand All @@ -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;
Expand Down