Skip to content

Commit

Permalink
Change SymDB config
Browse files Browse the repository at this point in the history
Replace DD_DYNAMIC_INSTRUMENTATION_SYMBOL_ENABLED
to DD_SYMBOL_DATABASE_UPLOAD_ENABLED
Add DD_INTERNAL_FORCE_SYMBOL_DATABASE_UPLOAD for testing
  • Loading branch information
jpbempel committed Oct 31, 2023
1 parent 34c6955 commit 7045199
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public static synchronized void run(
} else {
log.debug("No configuration poller available from SharedCommunicationObjects");
}
if (config.getDebuggerSymbolEnabled()) {
if (config.isDebuggerSymbolEnabled() || config.isDebuggerSymbolForceUpload()) {
instrumentation.addTransformer(
new SymbolExtractionTransformer(debuggerSink.getSymbolSink(), config));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ public final class ConfigDefaults {
static final boolean DEFAULT_DEBUGGER_INSTRUMENT_THE_WORLD = false;
static final int DEFAULT_DEBUGGER_CAPTURE_TIMEOUT = 100; // milliseconds
static final boolean DEFAULT_DEBUGGER_SYMBOL_ENABLED = false;
static final boolean DEFAULT_DEBUGGER_SYMBOL_FORCE_UPLOAD = false;
static final int DEFAULT_DEBUGGER_SYMBOL_FLUSH_THRESHOLD = 100; // nb of classes

static final boolean DEFAULT_TRACE_REPORT_HOSTNAME = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ public final class DebuggerConfig {
public static final String DEBUGGER_REDACTED_IDENTIFIERS =
"dynamic.instrumentation.redacted.identifiers";
public static final String DEBUGGER_REDACTED_TYPES = "dynamic.instrumentation.redacted.types";
public static final String DEBUGGER_SYMBOL_ENABLED = "dynamic.instrumentation.symbol.enabled";
public static final String DEBUGGER_SYMBOL_INCLUDES = "dynamic.instrumentation.symbol.includes";
public static final String DEBUGGER_SYMBOL_FLUSH_THRESHOLD =
"dynamic.instrumentation.symbol.flush.threshold";
public static final String DEBUGGER_SYMBOL_ENABLED = "symbol.database.upload.enabled";
public static final String DEBUGGER_SYMBOL_FORCE_UPLOAD = "internal.force.symbol.database.upload";
public static final String DEBUGGER_SYMBOL_INCLUDES = "symbol.database.includes";
public static final String DEBUGGER_SYMBOL_FLUSH_THRESHOLD = "symbol.database.flush.threshold";

private DebuggerConfig() {}
}
12 changes: 11 additions & 1 deletion internal-api/src/main/java/datadog/trace/api/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
import static datadog.trace.api.ConfigDefaults.DEFAULT_DEBUGGER_POLL_INTERVAL;
import static datadog.trace.api.ConfigDefaults.DEFAULT_DEBUGGER_SYMBOL_ENABLED;
import static datadog.trace.api.ConfigDefaults.DEFAULT_DEBUGGER_SYMBOL_FLUSH_THRESHOLD;
import static datadog.trace.api.ConfigDefaults.DEFAULT_DEBUGGER_SYMBOL_FORCE_UPLOAD;
import static datadog.trace.api.ConfigDefaults.DEFAULT_DEBUGGER_UPLOAD_BATCH_SIZE;
import static datadog.trace.api.ConfigDefaults.DEFAULT_DEBUGGER_UPLOAD_FLUSH_INTERVAL;
import static datadog.trace.api.ConfigDefaults.DEFAULT_DEBUGGER_UPLOAD_TIMEOUT;
Expand Down Expand Up @@ -185,6 +186,7 @@
import static datadog.trace.api.config.DebuggerConfig.DEBUGGER_REDACTED_TYPES;
import static datadog.trace.api.config.DebuggerConfig.DEBUGGER_SYMBOL_ENABLED;
import static datadog.trace.api.config.DebuggerConfig.DEBUGGER_SYMBOL_FLUSH_THRESHOLD;
import static datadog.trace.api.config.DebuggerConfig.DEBUGGER_SYMBOL_FORCE_UPLOAD;
import static datadog.trace.api.config.DebuggerConfig.DEBUGGER_SYMBOL_INCLUDES;
import static datadog.trace.api.config.DebuggerConfig.DEBUGGER_UPLOAD_BATCH_SIZE;
import static datadog.trace.api.config.DebuggerConfig.DEBUGGER_UPLOAD_FLUSH_INTERVAL;
Expand Down Expand Up @@ -738,6 +740,7 @@ static class HostNameHolder {
private final String debuggerRedactedIdentifiers;
private final String debuggerRedactedTypes;
private final boolean debuggerSymbolEnabled;
private final boolean debuggerSymbolForceUpload;
private final String debuggerSymbolIncludes;
private final int debuggerSymbolFlushThreshold;

Expand Down Expand Up @@ -1686,6 +1689,9 @@ private Config(final ConfigProvider configProvider, final InstrumenterConfig ins
debuggerRedactedTypes = configProvider.getString(DEBUGGER_REDACTED_TYPES, null);
debuggerSymbolEnabled =
configProvider.getBoolean(DEBUGGER_SYMBOL_ENABLED, DEFAULT_DEBUGGER_SYMBOL_ENABLED);
debuggerSymbolForceUpload =
configProvider.getBoolean(
DEBUGGER_SYMBOL_FORCE_UPLOAD, DEFAULT_DEBUGGER_SYMBOL_FORCE_UPLOAD);
debuggerSymbolIncludes = configProvider.getString(DEBUGGER_SYMBOL_INCLUDES, null);
debuggerSymbolFlushThreshold =
configProvider.getInteger(
Expand Down Expand Up @@ -2776,7 +2782,11 @@ public int getDebuggerCaptureTimeout() {
return debuggerCaptureTimeout;
}

public boolean getDebuggerSymbolEnabled() {
public boolean isDebuggerSymbolEnabled() {
return debuggerSymbolEnabled;
}

public boolean isDebuggerSymbolForceUpload() {
return debuggerSymbolEnabled;
}

Expand Down

0 comments on commit 7045199

Please sign in to comment.