Sensor information instead of excluding the fields
MODIFY
dd-trace-api/src/main/java/datadog/trace/api/Config.java
dd-trace-api/src/main/java/datadog/trace/api/Config.java
@@ -38,7 +38,7 @@ import lombok.extern.slf4j.Slf4j;
* system property, but uppercased with '.' -> '_'.
*/
@Slf4j
-@ToString(includeFieldNames = true, exclude = {"profilingApiKey", "profilingProxyPassword"})
+@ToString(includeFieldNames = true)
public class Config {
/** Config keys below */
private static final String PREFIX = "dd.";
@@ -202,6 +202,14 @@ public class Config {
/** A tag intended for internal use only, hence not added to the public api DDTags class. */
private static final String INTERNAL_HOST_NAME = "_dd.hostname";
+ /** Used for masking sensitive information when doing toString */
+ @ToString.Include(name = "profilingApiKey")
+ private String profilingApiKeyMasker() { return "****"; }
+
+ /** Used for masking sensitive information when doing toString */
+ @ToString.Include(name = "profilingProxyPassword")
+ private String profilingProxyPasswordMasker() { return "****"; }
+
/**
* this is a random UUID that gets generated on JVM start up and is attached to every root span
* and every JMX metric that is sent out.

MODIFY
dd-trace-api/src/test/groovy/datadog/trace/api/ConfigTest.groovy
dd-trace-api/src/test/groovy/datadog/trace/api/ConfigTest.groovy
@@ -415,7 +415,9 @@ class ConfigTest extends DDSpecification {
def config = new Config()
then:
+ config.toString().contains("profilingApiKey=****");
!config.toString().contains("test-secret-api-key")
+ config.toString().contains("profilingProxyPassword=****");
!config.toString().contains("test-secret-proxy-password")
}

Sensor information instead of excluding the fields