adding a close method to flush traces
@@ -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;
