Skip to content

Commit

Permalink
bugfix for httpasyncclient
Browse files Browse the repository at this point in the history
  • Loading branch information
lu-xiaoshuang authored and luxiaoshuang committed Aug 12, 2024
1 parent aa24777 commit 4bd08f4
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,13 @@ public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allAr
int port = httpHost.getPort();
AbstractSpan span = ContextManager.createExitSpan(operationName, contextCarrier, httpHost.getHostName() + ":" + (port == -1 ? 80 : port));
span.setComponent(ComponentsDefine.HTTP_ASYNC_CLIENT);
Tags.URL.set(span, requestWrapper.getOriginal().getRequestLine().getUri());
if (uri.startsWith("http")) {
Tags.URL.set(span, requestWrapper.getOriginal().getRequestLine().getUri());
} else if (uri.startsWith("/")) {
Tags.URL.set(span, httpHost.toURI() + uri);
} else {
Tags.URL.set(span, httpHost.toURI() + "/" + uri);
}
Tags.HTTP.METHOD.set(span, requestLine.getMethod());
SpanLayer.asHttp(span);
CarrierItem next = contextCarrier.items();
Expand Down

0 comments on commit 4bd08f4

Please sign in to comment.