small fixes due to ES instrumentation

This commit is contained in:
renaudboutet 2017-05-24 09:21:41 +02:00
parent 1cd1183f07
commit 5239736d14
2 changed files with 2 additions and 3 deletions

View File

@ -1,4 +1,4 @@
# --------------------------------------------------------
# --------------------------------------------------------
# Instrument mongo client
RULE Mongo Client instrumentation
CLASS com.mongodb.MongoClientOptions$Builder
@ -81,7 +81,6 @@ AT ENTRY
IF currentSpan() == null
DO
span = getTracer().buildSpan($2.getClass().getSimpleName())
.asChildOf()
.withTag(io.opentracing.tag.Tags.SPAN_KIND.getKey(), io.opentracing.tag.Tags.SPAN_KIND_CLIENT)
.start();
# decorator.onRequest(span);

View File

@ -238,7 +238,7 @@ public class DDTracer implements io.opentracing.Tracer {
}
public DDTracer.DDSpanBuilder asChildOf(Span span) {
return asChildOf(span.context());
return asChildOf(span==null? null : span.context());
}
public DDTracer.DDSpanBuilder asChildOf(SpanContext spanContext) {