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

This commit is contained in:
liqiangz 2021-04-04 20:01:06 +08:00 committed by GitHub
parent f6e2467e09
commit 776f19c702
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 2 deletions

View File

@ -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.

View File

@ -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);

View File

@ -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);

View File

@ -65,6 +65,7 @@ segmentItems:
operationId: 0
parentSpanId: 0
spanId: 1
spanLayer: Http
startTime: nq 0
endTime: nq 0
componentId: 61

View File

@ -65,6 +65,7 @@ segmentItems:
operationId: 0
parentSpanId: 0
spanId: 1
spanLayer: Http
startTime: nq 0
endTime: nq 0
componentId: 61