Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,13 @@ public void onStart(T context) {
Span.Builder extractedSpan = this.propagator.extract(context.getCarrier(),
(carrier, key) -> context.getGetter().get(carrier, key));
extractedSpan.kind(Span.Kind.valueOf(context.getKind().name()));
String name = context.getContextualName() != null ? context.getContextualName() : context.getName();
extractedSpan.name(name);
getTracingContext(context).setSpan(customizeExtractedSpan(context, extractedSpan).start());
}

/**
* Customizes the extracted span (e.g. you can set the {@link Span.Kind} via
* {@link Span.Builder#kind(Span.Kind)}).
* @param context context
* @param builder span builder
* @return span builder
*/
Expand All @@ -77,6 +76,7 @@ public void onStop(T context) {
Span span = getRequiredSpan(context);
tagSpan(context, span);
customizeReceiverSpan(context, span);
span.name(getSpanName(context));
span.end();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,10 @@ public Span createSenderSpan(T context) {
if (parentSpan != null) {
builder = builder.setParent(parentSpan.context());
}
String name = context.getContextualName() != null ? context.getContextualName() : context.getName();
if (context.getRemoteServiceName() != null) {
builder = builder.remoteServiceName(context.getRemoteServiceName());
}
return builder.name(name).start();
return builder.start();
}

@Override
Expand All @@ -83,6 +82,7 @@ public void onStop(T context) {
Span span = getRequiredSpan(context);
tagSpan(context, span);
customizeSenderSpan(context, span);
span.name(getSpanName(context));
span.end();
}

Expand Down