[Agent] fix the context is incorrect issue

This commit is contained in:
ascrutae 2017-12-28 16:51:22 +08:00
parent 4a98bc94aa
commit 18ad96a643
1 changed files with 6 additions and 3 deletions

View File

@ -64,9 +64,12 @@ public class AsyncCallInterceptor implements InstanceConstructorInterceptor, Ins
EnhanceRequiredInfo enhanceRequiredInfo = (EnhanceRequiredInfo)objInst.getSkyWalkingDynamicField();
Request request = (Request)enhanceRequiredInfo.getRealCallEnhance().getSkyWalkingDynamicField();
ContextCarrier contextCarrier = new ContextCarrier();
HttpUrl requestUrl = request.url();
AbstractSpan span = ContextManager.createExitSpan(requestUrl.uri().getPath(), contextCarrier, requestUrl.host() + ":" + requestUrl.port());
AbstractSpan span = ContextManager.createExitSpan(requestUrl.uri().getPath(), requestUrl.host() + ":" + requestUrl.port());
ContextManager.continued(enhanceRequiredInfo.getContextSnapshot());
ContextCarrier contextCarrier = new ContextCarrier();
ContextManager.inject(contextCarrier);
span.setComponent(ComponentsDefine.OKHTTP);
Tags.HTTP.METHOD.set(span, request.method());
Tags.URL.set(span, requestUrl.uri().toString());
@ -86,7 +89,7 @@ public class AsyncCallInterceptor implements InstanceConstructorInterceptor, Ins
}
headersField.set(request, headerBuilder.build());
ContextManager.continued(enhanceRequiredInfo.getContextSnapshot());
}
@Override