Skip to content

Commit

Permalink
Merge pull request #13 from twillouer/distributed-message-must-finish…
Browse files Browse the repository at this point in the history
…-span

finish span when actor finish received
  • Loading branch information
malafeev committed Jan 2, 2020
2 parents c03100a + 2f4bc7b commit 8424125
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
Expand Up @@ -40,6 +40,8 @@ public static void aroundReceive(

try (Scope ignored = tracer.scopeManager().activate(span)) {
superConsumer.accept(receive, originalMessage);
} finally {
span.finish();
}
}
}
Expand Down
Expand Up @@ -69,17 +69,14 @@ Span activeSpan() {
}

Span activeSpan(final Tracer tracer) {
final Tracer.SpanBuilder spanBuilder = tracer.buildSpan("receive")
Tracer.SpanBuilder spanBuilder = tracer.buildSpan("receive")
.ignoreActiveSpan()
.withTag(Tags.SPAN_KIND.getKey(), Tags.SPAN_KIND_CONSUMER);
.withTag(Tags.SPAN_KIND.getKey(), Tags.SPAN_KIND_CONSUMER)
.withTag(Tags.COMPONENT, "java-akka");

final SpanContext context = spanContext(tracer);
if (context != null) {
spanBuilder.addReference(References.FOLLOWS_FROM, context);

Span span = spanBuilder.start();
Tags.COMPONENT.set(span, "akka");

spanBuilder = spanBuilder.addReference(References.FOLLOWS_FROM, context);
}
return spanBuilder.start();
}
Expand Down

0 comments on commit 8424125

Please sign in to comment.