Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ public final class DebuggerConfig {
"dynamic.instrumentation.source.file.tracking.enabled";
public static final String THIRD_PARTY_INCLUDES = "third.party.includes";
public static final String THIRD_PARTY_EXCLUDES = "third.party.excludes";
public static final String THIRD_PARTY_DETECTION_INCLUDES = "third.party.detection.includes";
public static final String THIRD_PARTY_DETECTION_EXCLUDES = "third.party.detection.excludes";
public static final String THIRD_PARTY_SHADING_IDENTIFIERS = "third.party.shading.identifiers";

private DebuggerConfig() {}
Expand Down
12 changes: 10 additions & 2 deletions internal-api/src/main/java/datadog/trace/api/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,8 @@
import static datadog.trace.api.config.DebuggerConfig.SYMBOL_DATABASE_ENABLED;
import static datadog.trace.api.config.DebuggerConfig.SYMBOL_DATABASE_FLUSH_THRESHOLD;
import static datadog.trace.api.config.DebuggerConfig.SYMBOL_DATABASE_FORCE_UPLOAD;
import static datadog.trace.api.config.DebuggerConfig.THIRD_PARTY_DETECTION_EXCLUDES;
import static datadog.trace.api.config.DebuggerConfig.THIRD_PARTY_DETECTION_INCLUDES;
import static datadog.trace.api.config.DebuggerConfig.THIRD_PARTY_EXCLUDES;
import static datadog.trace.api.config.DebuggerConfig.THIRD_PARTY_INCLUDES;
import static datadog.trace.api.config.DebuggerConfig.THIRD_PARTY_SHADING_IDENTIFIERS;
Expand Down Expand Up @@ -2607,8 +2609,14 @@ PROFILING_DATADOG_PROFILER_ENABLED, isDatadogProfilerSafeInCurrentEnvironment())
configProvider.getBoolean(
DEBUGGER_SOURCE_FILE_TRACKING_ENABLED, DEFAULT_DEBUGGER_SOURCE_FILE_TRACKING_ENABLED);

debuggerThirdPartyIncludes = tryMakeImmutableSet(configProvider.getList(THIRD_PARTY_INCLUDES));
debuggerThirdPartyExcludes = tryMakeImmutableSet(configProvider.getList(THIRD_PARTY_EXCLUDES));
debuggerThirdPartyIncludes =
tryMakeImmutableSet(
configProvider.getList(
THIRD_PARTY_INCLUDES, Collections.emptyList(), THIRD_PARTY_DETECTION_INCLUDES));
debuggerThirdPartyExcludes =
tryMakeImmutableSet(
configProvider.getList(
THIRD_PARTY_EXCLUDES, Collections.emptyList(), THIRD_PARTY_DETECTION_EXCLUDES));
debuggerShadingIdentifiers =
tryMakeImmutableSet(configProvider.getList(THIRD_PARTY_SHADING_IDENTIFIERS));

Expand Down
2 changes: 2 additions & 0 deletions metadata/supported-configurations.json
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,8 @@
"DD_TEST_SESSION_NAME": ["A"],
"DD_THIRD_PARTY_EXCLUDES": ["A"],
"DD_THIRD_PARTY_INCLUDES": ["A"],
"DD_THIRD_PARTY_DETECTION_EXCLUDES": ["A"],
"DD_THIRD_PARTY_DETECTION_INCLUDES": ["A"],
"DD_THIRD_PARTY_SHADING_IDENTIFIERS": ["A"],
"DD_TRACE_128_BIT_TRACEID_GENERATION_ENABLED": ["A"],
"DD_TRACE_128_BIT_TRACEID_LOGGING_ENABLED": ["A"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,12 +303,12 @@ public List<String> getList(String key) {
return ConfigConverter.parseList(getString(key));
}

public List<String> getList(String key, List<String> defaultValue) {
public List<String> getList(String key, List<String> defaultValue, String... aliases) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❔ question: ‏Isn't this change going to allocate an empty array for all calls?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

true, but not different from
https://github.com/DataDog/dd-trace-java/blob/master/utils/config-utils/src/main/java/datadog/trace/bootstrap/config/provider/ConfigProvider.java#L73

  /**
   * Gets a string value with a default fallback and optional aliases. Use for configs with
   * meaningful defaults. Reports default to telemetry.
   */
  public String getString(String key, String defaultValue, String... aliases) {
    if (collectConfig) {
      reportDefault(key, defaultValue);
    }
    String value = getStringInternal(key, aliases);

    return value != null ? value : defaultValue;
  }

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree! We might review it in a separate PR then 👌

// Ensure the first item at DEFAULT is the accurate one
if (collectConfig) {
reportDefault(key, defaultValue);
}
String list = getStringInternal(key);
String list = getStringInternal(key, aliases);
if (null == list) {
return defaultValue;
} else {
Expand Down
Loading