Skip to content

Commit

Permalink
finish span when actor finish received
Browse files Browse the repository at this point in the history
  • Loading branch information
twillouer committed Dec 24, 2019
1 parent c03100a commit 2f4bc7b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 2f4bc7b

Please sign in to comment.