adding a close method to flush traces

This commit is contained in:
Guillaume Polaert 2017-05-16 12:11:58 +02:00
parent c5184070f4
commit 0c06397094
1 changed files with 31 additions and 27 deletions

View File

@ -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;