adding a close method to flush traces
MODIFY
src/main/java/com/datadoghq/trace/DDTracer.java
src/main/java/com/datadoghq/trace/DDTracer.java
@@ -139,6 +139,10 @@ public class DDTracer implements io.opentracing.Tracer {
}
}
+ public void close() {
+ writer.close();
+ }
+
/**
* Spans are built using this builder
*/
@@ -281,7 +285,7 @@ public class DDTracer implements io.opentracing.Tracer {
String serviceName = this.serviceName;
if (serviceName == null) {
- if(p != null){
+ if (p != null && p.getServiceName() != null) {
serviceName = p.getServiceName();
} else {
serviceName = defaultServiceName;

adding a close method to flush traces