Skip to content

Commit

Permalink
Set span kind on the sender span
Browse files Browse the repository at this point in the history
  • Loading branch information
marcingrzejszczak committed Jul 18, 2022
1 parent 01a5249 commit b3fff55
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ public void onStart(T context) {
*/
public Span createSenderSpan(T context) {
Span parentSpan = getParentSpan(context);
Span senderSpan = parentSpan != null ? getTracer().nextSpan(parentSpan) : getTracer().nextSpan();
Span.Builder builder = getTracer().spanBuilder().kind(Span.Kind.valueOf(context.getKind().name()));
builder = parentSpan != null ? builder.setParent(parentSpan.context()) : builder.setNoParent();
String name = context.getContextualName() != null ? context.getContextualName() : context.getName();
senderSpan.name(name);
return senderSpan;
return builder.name(name).start();
}

@Override
Expand Down

0 comments on commit b3fff55

Please sign in to comment.