Fix create multiple EntrySpan (#2482)

This commit is contained in:
FuCheng,Yan 2019-04-14 07:28:58 +08:00 committed by 吴晟 Wu Sheng
parent 8f277f136f
commit 2f8e19f3ef
1 changed files with 7 additions and 5 deletions

View File

@ -45,11 +45,13 @@ public class OnInboundNextInterceptor implements InstanceMethodsAroundIntercepto
next.setHeadValue(request.headers().get(next.getHeadKey()));
}
AbstractSpan span = ContextManager.createEntrySpan(request.uri(), contextCarrier);
Tags.URL.set(span, request.uri());
Tags.HTTP.METHOD.set(span, request.method().name());
span.setComponent(ComponentsDefine.SPRING_MVC_ANNOTATION);
SpanLayer.asHttp(span);
if (allArguments[1] instanceof HttpRequest) {
AbstractSpan span = ContextManager.createEntrySpan(request.uri(), contextCarrier);
Tags.URL.set(span, request.uri());
Tags.HTTP.METHOD.set(span, request.method().name());
span.setComponent(ComponentsDefine.SPRING_MVC_ANNOTATION);
SpanLayer.asHttp(span);
}
}
}