Refresh the tracer with changed config properties now that we are using instances
MODIFY
dd-java-agent/testing/src/main/groovy/datadog/trace/agent/test/AgentTestRunner.java
dd-java-agent/testing/src/main/groovy/datadog/trace/agent/test/AgentTestRunner.java
@@ -64,12 +64,12 @@ public abstract class AgentTestRunner extends Specification {
*
* <p>Before the start of each test the reported traces will be reset.
*/
- public static final ListWriter TEST_WRITER;
+ public static ListWriter TEST_WRITER;
// having a reference to io.opentracing.Tracer in test field
// loads opentracing before bootstrap classpath is setup
// so we declare tracer as an object and cast when needed.
- protected static final Object TEST_TRACER;
+ protected static Object TEST_TRACER;
protected static final Set<String> TRANSFORMED_CLASSES = Sets.newConcurrentHashSet();
private static final AtomicInteger INSTRUMENTATION_ERROR_COUNT = new AtomicInteger();
@@ -85,7 +85,10 @@ public abstract class AgentTestRunner extends Specification {
((Logger) LoggerFactory.getLogger("datadog")).setLevel(Level.DEBUG);
ConfigUtils.makeConfigInstanceModifiable();
+ refreshTestTracer();
+ }
+ public static void refreshTestTracer() {
TEST_WRITER =
new ListWriter() {
@Override

MODIFY
dd-trace-api/src/main/java/datadog/trace/api/Config.java
dd-trace-api/src/main/java/datadog/trace/api/Config.java
@@ -385,7 +385,7 @@ public class Config {
traceAnnotations = properties.getProperty(TRACE_ANNOTATIONS, parent.traceAnnotations);
- traceMethods = properties.getProperty(TRACE_METHODS, parent.traceAnnotations);
+ traceMethods = properties.getProperty(TRACE_METHODS, parent.traceMethods);
traceExecutorsAll =
getPropertyBooleanValue(properties, TRACE_EXECUTORS_ALL, parent.traceExecutorsAll);

Refresh the tracer with changed config properties now that we are using instances