Restored cross process propagation (BUG) + additional test
MODIFY
dd-trace/src/main/java/com/datadoghq/trace/DDTracer.java
dd-trace/src/main/java/com/datadoghq/trace/DDTracer.java
@@ -233,11 +233,11 @@ public class DDTracer implements io.opentracing.Tracer {
DDActiveSpan current = activeSpan();
if(current!=null){
activeParent = current;
- }
- }
//Ensure parent inheritance
asChildOf(activeParent);
+ }
+ }
//Create the active span
DDActiveSpan activeSpan = new DDActiveSpan(activeParent,this.timestamp, buildSpanContext());

MODIFY
dd-trace/src/test/java/com/datadoghq/trace/DDActiveSpanTest.java
dd-trace/src/test/java/com/datadoghq/trace/DDActiveSpanTest.java
@@ -20,7 +20,7 @@ public class DDActiveSpanTest {
}
@Test
- public void testContextPropagation() {
+ public void testThreadContextPropagation() {
DDActiveSpan span1 = ddTracer.buildSpan("op1").startActive();
@@ -116,4 +116,14 @@ public class DDActiveSpanTest {
assertThat(manualSpan.startTimeNano).isEqualTo(span1.startTimeNano);
assertThat(manualSpan.startTimeMicro).isEqualTo(span1.startTimeMicro);
}
+
+ @Test
+ public void testCrossContextPropagation() {
+ final DDSpan manualSpan = ddTracer.buildSpan("op1").startManual();
+
+ DDActiveSpan activeSpan = ddTracer.buildSpan("op2").asChildOf(manualSpan.context()).startActive();
+
+ assertThat(activeSpan.getParentId()).isEqualTo(manualSpan.getSpanId());
+ assertThat(activeSpan.getTraceId()).isEqualTo(manualSpan.getTraceId());
+ }
}

MODIFY
dd-trace/src/test/resources/logback.xml
dd-trace/src/test/resources/logback.xml
</layout>
</appender>
- <root level="trace">
+ <root level="info">
<appender-ref ref="console"/>
</root>

Restored cross process propagation (BUG) + additional test