未验证 提交 776f19c7 编写于 作者: L liqiangz 提交者: GitHub

Fix spanLayer is null in optional plugin(gateway-2.0.x-plugin gateway-2.1.x-plugin) (#6683)

上级 f6e2467e
......@@ -31,6 +31,7 @@ Release Notes.
* Fix NullPointerException with `ReactiveRequestHolder.getHeaders`.
* Fix springmvc reactive api can't collect HTTP statusCode.
* Fix bug that asynchttpclient plugin does not record the response status code
* Fix spanLayer is null in optional plugin(gateway-2.0.x-plugin gateway-2.1.x-plugin).
#### OAP-Backend
* Allow user-defined `JAVA_OPTS` in the startup script.
......
......@@ -26,6 +26,7 @@ import org.apache.skywalking.apm.agent.core.context.ContextCarrier;
import org.apache.skywalking.apm.agent.core.context.ContextManager;
import org.apache.skywalking.apm.agent.core.context.tag.Tags;
import org.apache.skywalking.apm.agent.core.context.trace.AbstractSpan;
import org.apache.skywalking.apm.agent.core.context.trace.SpanLayer;
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult;
......@@ -52,7 +53,7 @@ public class HttpClientRequestInterceptor implements InstanceMethodsAroundInterc
"SpringCloudGateway/sendRequest", contextCarrier, getPeer(url));
abstractSpan.prepareForAsync();
Tags.URL.set(abstractSpan, String.valueOf(allArguments[1]));
abstractSpan.setLayer(SpanLayer.HTTP);
abstractSpan.setComponent(SPRING_CLOUD_GATEWAY);
ContextManager.stopSpan(abstractSpan);
......
......@@ -25,6 +25,7 @@ import org.apache.skywalking.apm.agent.core.context.ContextCarrier;
import org.apache.skywalking.apm.agent.core.context.ContextManager;
import org.apache.skywalking.apm.agent.core.context.tag.Tags;
import org.apache.skywalking.apm.agent.core.context.trace.AbstractSpan;
import org.apache.skywalking.apm.agent.core.context.trace.SpanLayer;
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult;
......@@ -53,7 +54,7 @@ public class HttpClientFinalizerSendInterceptor implements InstanceMethodsAround
Tags.URL.set(abstractSpan, enhanceObjectCache.getUrl());
abstractSpan.prepareForAsync();
abstractSpan.setComponent(SPRING_CLOUD_GATEWAY);
abstractSpan.setLayer(SpanLayer.HTTP);
ContextManager.stopSpan(abstractSpan);
ContextManager.stopSpan(span);
......
......@@ -65,6 +65,7 @@ segmentItems:
operationId: 0
parentSpanId: 0
spanId: 1
spanLayer: Http
startTime: nq 0
endTime: nq 0
componentId: 61
......
......@@ -65,6 +65,7 @@ segmentItems:
operationId: 0
parentSpanId: 0
spanId: 1
spanLayer: Http
startTime: nq 0
endTime: nq 0
componentId: 61
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册