未验证 提交 ea8a4963 编写于 作者: R ralphgj 提交者: GitHub

fix recording url tag with wrong port (#6214)

上级 4e43f227
......@@ -34,6 +34,7 @@ Release Notes.
* Fix duplicated `EnhancedInstance` interface added.
* Fix thread leaks caused by the elasticsearch-6.x-plugin plugin.
* Support reading segmentId and spanId with toolkit.
* Fix RestTemplate plugin recording url tag with wrong port
#### OAP-Backend
......
......@@ -50,8 +50,8 @@ public class RestExecuteInterceptor implements InstanceMethodsAroundInterceptor
AbstractSpan span = ContextManager.createExitSpan(uri, contextCarrier, remotePeer);
span.setComponent(ComponentsDefine.SPRING_REST_TEMPLATE);
Tags.URL.set(span, requestURL.getScheme() + "://" + requestURL.getHost() + ":" + requestURL.getPort() + requestURL
.getPath());
Tags.URL.set(span, requestURL.getScheme() + "://" + requestURL.getHost() +
(requestURL.getPort() > 0 ? ":" + requestURL.getPort() : "") + requestURL.getPath());
Tags.HTTP.METHOD.set(span, httpMethod.toString());
SpanLayer.asHttp(span);
RestTemplateRuntimeContextHelper.addUri(uri);
......
......@@ -46,8 +46,8 @@ public class RestExecuteInterceptor implements InstanceMethodsAroundInterceptor
AbstractSpan span = ContextManager.createExitSpan(formatURIPath, contextCarrier, remotePeer);
span.setComponent(ComponentsDefine.SPRING_REST_TEMPLATE);
Tags.URL.set(span, requestURL.getScheme() + "://" + requestURL.getHost() + ":" + requestURL.getPort() + requestURL
.getPath());
Tags.URL.set(span, requestURL.getScheme() + "://" + requestURL.getHost() +
(requestURL.getPort() > 0 ? ":" + requestURL.getPort() : "") + requestURL.getPath());
Tags.HTTP.METHOD.set(span, httpMethod.toString());
SpanLayer.asHttp(span);
......
......@@ -48,7 +48,7 @@ segmentItems:
spanType: Exit
peer: github.com:443
tags:
- {key: url, value: 'https://github.com:-1/apache/skywalking'}
- {key: url, value: 'https://github.com/apache/skywalking'}
- {key: http.method, value: GET}
skipAnalysis: 'false'
- operationName: Threading/test.apache.skywalking.apm.testcase.jdk.threading.Application$TestController$1/run
......@@ -81,7 +81,7 @@ segmentItems:
spanType: Exit
peer: github.com:443
tags:
- {key: url, value: 'https://github.com:-1/apache/skywalking'}
- {key: url, value: 'https://github.com/apache/skywalking'}
- {key: http.method, value: GET}
skipAnalysis: 'false'
- operationName: Threading/test.apache.skywalking.apm.testcase.jdk.threading.Application$TestController$2/call
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册