Clarify log messages when tracing is disabled
MODIFY
dd-java-agent/agent-tooling/src/main/java/datadog/trace/agent/tooling/AgentInstaller.java
dd-java-agent/agent-tooling/src/main/java/datadog/trace/agent/tooling/AgentInstaller.java
@@ -46,6 +46,8 @@ public class AgentInstaller {
public static void installBytebuddyAgent(final Instrumentation inst) {
if (Config.get().isTraceEnabled()) {
installBytebuddyAgent(inst, new AgentBuilder.Listener[0]);
+ } else {
+ log.debug("Tracing is disabled, not installing instrumentations.");
}
}

MODIFY
dd-java-agent/agent-tooling/src/main/java/datadog/trace/agent/tooling/TracerInstaller.java
dd-java-agent/agent-tooling/src/main/java/datadog/trace/agent/tooling/TracerInstaller.java
@@ -8,7 +8,8 @@ import lombok.extern.slf4j.Slf4j;
public class TracerInstaller {
/** Register a global tracer if no global tracer is already registered. */
public static synchronized void installGlobalTracer() {
- if (Config.get().isTraceEnabled() && !io.opentracing.util.GlobalTracer.isRegistered()) {
+ if (Config.get().isTraceEnabled()) {
+ if (!io.opentracing.util.GlobalTracer.isRegistered()) {
final DDTracer tracer = new DDTracer();
try {
io.opentracing.util.GlobalTracer.register(tracer);
@@ -19,6 +20,9 @@ public class TracerInstaller {
} else {
log.debug("GlobalTracer already registered.");
}
+ } else {
+ log.debug("Tracing is disabled, not installing GlobalTracer.");
+ }
}
public static void logVersionInfo() {

Clarify log messages when tracing is disabled