From 4b66f1e0a73bf6c107005be6d6acf040dc7cb6bd Mon Sep 17 00:00:00 2001 From: wallezhang Date: Sat, 14 Aug 2021 20:17:46 +0800 Subject: [PATCH] fix: Fix MultiScopesAnalysisListener#setPublicAttrs log warn frequently (#7271) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: Fix MultiScopesAnalysisListener#setPublicAttrs log warn frequently. #6562 1. Rename current STATUS_CODE to HTTP_RESPONSE_STATUS_CODE, real tag key should be http.status_code. 2. Add a new string tag RPC_RESPONSE_STATUS_CODE to hold all string type value tag. The key is `rpc.status_code`. 3. At the backend, keep responseCode for HTTP_RESPONSE_STATUS_CODE tag, but add @Deprecated. Also, add httpResponseStatusCode(a duplicate of responseCode) and rpcStatusCode(for RPC_RESPONSE_STATUS_CODE) fields for OAL. * Modify `Tags.STATUS_CODE` field name to `Tags.HTTP_RESPONSE_STATUS_CODE` and type from `StringTag` to `IntegerTag`, add `Tags.RPC_RESPONSE_STATUS_CODE` field to hold rpc response code value. * Add `rpcStatusCode` for `rpc.status_code` tag in the OAL objects. The `responseCode` field is marked as deprecated and replaced by `httpResponseStatusCode` field. * Tag `status_code` is still supported in the backend for forward compatbility. Will be removed one year later. Co-authored-by: 吴晟 Wu Sheng --- CHANGES.md | 2 + .../agent/core/context/tag/IntegerTag.java | 44 +++++++++++++++++++ .../apm/agent/core/context/tag/Tags.java | 8 +++- .../v2/AsyncHandlerWrapper.java | 2 +- .../http/v9/DefaultHttpClientInterceptor.java | 2 +- .../v9/LoadBalancerHttpClientInterceptor.java | 2 +- .../grpc/v1/client/TracingClientCall.java | 20 ++++----- .../grpc/v1/server/TracingServerCall.java | 9 ++-- .../v4/HttpClientExecuteInterceptor.java | 2 +- .../HttpAsyncResponseConsumerWrapper.java | 2 +- .../v3/HttpClientExecuteInterceptor.java | 2 +- .../jetty/v9/server/HandleInterceptor.java | 2 +- .../JsonServiceExporterInterceptor.java | 2 +- .../light4j/HandleRequestInterceptor.java | 2 +- .../nutz/http/sync/SenderSendInterceptor.java | 2 +- .../nutz/mvc/ActionMethodInterceptor.java | 2 +- .../okhttp/common/RealCallInterceptor.java | 2 +- .../apm/plugin/play/v2x/TracingFilter.java | 2 +- .../SynchronousDispatcherInterceptor.java | 2 +- .../ProducerOperationHandlerInterceptor.java | 2 +- .../TransportClientHandlerInterceptor.java | 2 +- .../ProducerOperationHandlerInterceptor.java | 2 +- .../v1/TransportClientHandlerInterceptor.java | 2 +- .../spring/mvc/v5/InvokeInterceptor.java | 2 +- .../AbstractMethodInterceptor.java | 2 +- .../sync/RestResponseInterceptor.java | 2 +- .../WebFluxWebClientInterceptor.java | 2 +- .../plugin/struts2/Struts2Interceptor.java | 2 +- .../tomcat78x/TomcatInvokeInterceptor.java | 2 +- .../undertow/v2x/handler/TracingHandler.java | 2 +- ...tRequestImplHandleResponseInterceptor.java | 2 +- ...textHandleDispatchResponseInterceptor.java | 2 +- .../HttpServerResponseImplInterceptor.java | 2 +- .../http/HttpClientParseHttpInterceptor.java | 2 +- .../v20x/HttpClientRequestInterceptor.java | 2 +- ...inalizerResponseConnectionInterceptor.java | 2 +- ...inalizerResponseConnectionInterceptor.java | 2 +- ...patcherHandlerHandleMethodInterceptor.java | 10 ++--- .../concepts-and-designs/scope-definitions.md | 28 +++++++++--- .../guides/Java-Plugin-Development-Guide.md | 2 +- .../provider/trace/parser/SpanTags.java | 9 ++++ .../listener/MultiScopesAnalysisListener.java | 11 +++-- .../trace/parser/listener/SourceBuilder.java | 21 +++++++++ .../oap/server/core/source/All.java | 7 +++ .../oap/server/core/source/Endpoint.java | 7 +++ .../server/core/source/EndpointRelation.java | 7 +++ .../oap/server/core/source/Service.java | 7 +++ .../server/core/source/ServiceInstance.java | 7 +++ .../core/source/ServiceInstanceRelation.java | 7 +++ .../server/core/source/ServiceRelation.java | 7 +++ .../receiver/trace/mock/ServiceAMock.java | 4 +- .../MultiScopesAnalysisListenerTest.java | 9 +++- .../config/expectedData.yaml | 2 +- .../config/expectedData.yaml | 2 +- .../config/expectedData.yaml | 4 +- .../config/expectedData.yaml | 4 +- .../config/expectedData.yaml | 4 +- .../grpc-scenario/config/expectedData.yaml | 10 ++--- .../config/expectedData.yaml | 2 +- .../config/expectedData.yaml | 2 +- .../config/expectedData.yaml | 2 +- .../config/expectedData.yaml | 8 ++-- .../config/expectedData.yaml | 16 +++---- .../config/expectedData.yaml | 16 +++---- .../webflux-scenario/config/expectedData.yaml | 26 +++++------ 65 files changed, 273 insertions(+), 115 deletions(-) create mode 100644 apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/tag/IntegerTag.java diff --git a/CHANGES.md b/CHANGES.md index 4f21273eb..efb4f49b0 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -14,6 +14,7 @@ Release Notes. #### Java Agent * Support Multiple DNS period resolving mechanism +* Modify `Tags.STATUS_CODE` field name to `Tags.HTTP_RESPONSE_STATUS_CODE` and type from `StringTag` to `IntegerTag`, add `Tags.RPC_RESPONSE_STATUS_CODE` field to hold rpc response code value. #### OAP-Backend @@ -36,6 +37,7 @@ Release Notes. * [Break Change] Remove endpoint name in the backend log query condition. Only support `query by endpoint id`. * [Break Change] Fix typo for a column `page_path_id`(was `pate_path_id`) of storage entity `browser_error_log`. * Add component id for Python falcon plugin. +* Add `rpcStatusCode` for `rpc.status_code` tag. The `responseCode` field is marked as deprecated and replaced by `httpResponseStatusCode` field. #### UI diff --git a/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/tag/IntegerTag.java b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/tag/IntegerTag.java new file mode 100644 index 000000000..d951662cd --- /dev/null +++ b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/tag/IntegerTag.java @@ -0,0 +1,44 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package org.apache.skywalking.apm.agent.core.context.tag; + +import org.apache.skywalking.apm.agent.core.context.trace.AbstractSpan; + +/** + * A subclass of {@link AbstractTag}, represent a tag with a {@link Integer} value. + */ +public class IntegerTag extends AbstractTag { + + public IntegerTag(int id, String tagKey, boolean canOverwrite) { + super(id, tagKey, canOverwrite); + } + + public IntegerTag(String key) { + super(key); + } + + public IntegerTag(int id, String tagKey) { + super(id, tagKey, false); + } + + @Override + public void set(AbstractSpan span, Integer tagValue) { + span.tag(this, Integer.toString(tagValue)); + } +} diff --git a/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/tag/Tags.java b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/tag/Tags.java index f911d0663..50d20d0ab 100644 --- a/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/tag/Tags.java +++ b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/tag/Tags.java @@ -40,7 +40,7 @@ public final class Tags { /** * STATUS_CODE records the http status code of the response. */ - public static final StringTag STATUS_CODE = new StringTag(2, "status_code", true); + public static final IntegerTag HTTP_RESPONSE_STATUS_CODE = new IntegerTag(2, "http.status_code", true); /** * DB_TYPE records database type, such as sql, redis, cassandra and so on. @@ -90,6 +90,12 @@ public final class Tags { */ public static final StringTag TRANSMISSION_LATENCY = new StringTag(15, "transmission.latency", false); + /** + * RESPONSE_CODE records the code string of the response. This is different from status code, which is + * used to record http response code. + */ + public static final StringTag RPC_RESPONSE_STATUS_CODE = new StringTag(18, "rpc.status_code", true); + public static final class HTTP { public static final StringTag METHOD = new StringTag(10, "http.method"); diff --git a/apm-sniffer/apm-sdk-plugin/asynchttpclient-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/asynchttpclient/v2/AsyncHandlerWrapper.java b/apm-sniffer/apm-sdk-plugin/asynchttpclient-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/asynchttpclient/v2/AsyncHandlerWrapper.java index c668231c0..faebf4740 100644 --- a/apm-sniffer/apm-sdk-plugin/asynchttpclient-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/asynchttpclient/v2/AsyncHandlerWrapper.java +++ b/apm-sniffer/apm-sdk-plugin/asynchttpclient-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/asynchttpclient/v2/AsyncHandlerWrapper.java @@ -51,7 +51,7 @@ public class AsyncHandlerWrapper implements AsyncHandler { @Override public State onStatusReceived(final HttpResponseStatus httpResponseStatus) throws Exception { int statusCode = httpResponseStatus.getStatusCode(); - Tags.STATUS_CODE.set(asyncSpan, String.valueOf(statusCode)); + Tags.HTTP_RESPONSE_STATUS_CODE.set(asyncSpan, statusCode); if (statusCode >= 400) { asyncSpan.errorOccurred(); } diff --git a/apm-sniffer/apm-sdk-plugin/feign-default-http-9.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/feign/http/v9/DefaultHttpClientInterceptor.java b/apm-sniffer/apm-sdk-plugin/feign-default-http-9.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/feign/http/v9/DefaultHttpClientInterceptor.java index 6b91d15ee..f254b8a74 100644 --- a/apm-sniffer/apm-sdk-plugin/feign-default-http-9.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/feign/http/v9/DefaultHttpClientInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/feign-default-http-9.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/feign/http/v9/DefaultHttpClientInterceptor.java @@ -156,7 +156,7 @@ public class DefaultHttpClientInterceptor implements InstanceMethodsAroundInterc AbstractSpan span = ContextManager.activeSpan(); if (statusCode >= 400) { span.errorOccurred(); - Tags.STATUS_CODE.set(span, Integer.toString(statusCode)); + Tags.HTTP_RESPONSE_STATUS_CODE.set(span, statusCode); } } diff --git a/apm-sniffer/apm-sdk-plugin/feign-default-http-9.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/feign/http/v9/LoadBalancerHttpClientInterceptor.java b/apm-sniffer/apm-sdk-plugin/feign-default-http-9.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/feign/http/v9/LoadBalancerHttpClientInterceptor.java index 000c28191..720c07f3a 100644 --- a/apm-sniffer/apm-sdk-plugin/feign-default-http-9.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/feign/http/v9/LoadBalancerHttpClientInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/feign-default-http-9.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/feign/http/v9/LoadBalancerHttpClientInterceptor.java @@ -83,7 +83,7 @@ public class LoadBalancerHttpClientInterceptor implements InstanceMethodsAroundI AbstractSpan span = ContextManager.activeSpan(); if (statusCode >= 400) { span.errorOccurred(); - Tags.STATUS_CODE.set(span, Integer.toString(statusCode)); + Tags.HTTP_RESPONSE_STATUS_CODE.set(span, statusCode); } } diff --git a/apm-sniffer/apm-sdk-plugin/grpc-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/grpc/v1/client/TracingClientCall.java b/apm-sniffer/apm-sdk-plugin/grpc-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/grpc/v1/client/TracingClientCall.java index fc3a58534..81dc21a7b 100644 --- a/apm-sniffer/apm-sdk-plugin/grpc-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/grpc/v1/client/TracingClientCall.java +++ b/apm-sniffer/apm-sdk-plugin/grpc-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/grpc/v1/client/TracingClientCall.java @@ -18,6 +18,15 @@ package org.apache.skywalking.apm.plugin.grpc.v1.client; +import static org.apache.skywalking.apm.plugin.grpc.v1.Constants.BLOCKING_CALL_EXIT_SPAN; +import static org.apache.skywalking.apm.plugin.grpc.v1.Constants.CLIENT; +import static org.apache.skywalking.apm.plugin.grpc.v1.Constants.REQUEST_ON_CANCEL_OPERATION_NAME; +import static org.apache.skywalking.apm.plugin.grpc.v1.Constants.REQUEST_ON_COMPLETE_OPERATION_NAME; +import static org.apache.skywalking.apm.plugin.grpc.v1.Constants.REQUEST_ON_MESSAGE_OPERATION_NAME; +import static org.apache.skywalking.apm.plugin.grpc.v1.Constants.RESPONSE_ON_CLOSE_OPERATION_NAME; +import static org.apache.skywalking.apm.plugin.grpc.v1.Constants.RESPONSE_ON_MESSAGE_OPERATION_NAME; +import static org.apache.skywalking.apm.plugin.grpc.v1.OperationNameFormatUtil.formatOperationName; + import io.grpc.Channel; import io.grpc.ClientCall; import io.grpc.ForwardingClientCall; @@ -36,15 +45,6 @@ import org.apache.skywalking.apm.agent.core.context.trace.SpanLayer; import org.apache.skywalking.apm.network.trace.component.ComponentsDefine; import org.apache.skywalking.apm.plugin.grpc.v1.OperationNameFormatUtil; -import static org.apache.skywalking.apm.plugin.grpc.v1.Constants.BLOCKING_CALL_EXIT_SPAN; -import static org.apache.skywalking.apm.plugin.grpc.v1.Constants.CLIENT; -import static org.apache.skywalking.apm.plugin.grpc.v1.Constants.REQUEST_ON_CANCEL_OPERATION_NAME; -import static org.apache.skywalking.apm.plugin.grpc.v1.Constants.REQUEST_ON_COMPLETE_OPERATION_NAME; -import static org.apache.skywalking.apm.plugin.grpc.v1.Constants.REQUEST_ON_MESSAGE_OPERATION_NAME; -import static org.apache.skywalking.apm.plugin.grpc.v1.Constants.RESPONSE_ON_CLOSE_OPERATION_NAME; -import static org.apache.skywalking.apm.plugin.grpc.v1.Constants.RESPONSE_ON_MESSAGE_OPERATION_NAME; -import static org.apache.skywalking.apm.plugin.grpc.v1.OperationNameFormatUtil.formatOperationName; - /** * Fully client tracing for gRPC servers. */ @@ -199,7 +199,7 @@ class TracingClientCall extends ForwardingClientCall.SimpleFo ContextManager.continued(contextSnapshot); if (!status.isOk()) { span.log(status.asRuntimeException()); - Tags.STATUS_CODE.set(span, status.getCode().name()); + Tags.RPC_RESPONSE_STATUS_CODE.set(span, status.getCode().name()); } try { diff --git a/apm-sniffer/apm-sdk-plugin/grpc-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/grpc/v1/server/TracingServerCall.java b/apm-sniffer/apm-sdk-plugin/grpc-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/grpc/v1/server/TracingServerCall.java index d5543466d..66935421b 100644 --- a/apm-sniffer/apm-sdk-plugin/grpc-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/grpc/v1/server/TracingServerCall.java +++ b/apm-sniffer/apm-sdk-plugin/grpc-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/grpc/v1/server/TracingServerCall.java @@ -18,6 +18,10 @@ package org.apache.skywalking.apm.plugin.grpc.v1.server; +import static org.apache.skywalking.apm.plugin.grpc.v1.Constants.RESPONSE_ON_CLOSE_OPERATION_NAME; +import static org.apache.skywalking.apm.plugin.grpc.v1.Constants.RESPONSE_ON_MESSAGE_OPERATION_NAME; +import static org.apache.skywalking.apm.plugin.grpc.v1.Constants.SERVER; + import io.grpc.ForwardingServerCall; import io.grpc.Metadata; import io.grpc.ServerCall; @@ -27,9 +31,6 @@ 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.network.trace.component.ComponentsDefine; -import static org.apache.skywalking.apm.plugin.grpc.v1.Constants.RESPONSE_ON_CLOSE_OPERATION_NAME; -import static org.apache.skywalking.apm.plugin.grpc.v1.Constants.RESPONSE_ON_MESSAGE_OPERATION_NAME; -import static org.apache.skywalking.apm.plugin.grpc.v1.Constants.SERVER; import org.apache.skywalking.apm.plugin.grpc.v1.OperationNameFormatUtil; public class TracingServerCall extends ForwardingServerCall.SimpleForwardingServerCall { @@ -91,7 +92,7 @@ public class TracingServerCall extends ForwardingServerCall.S } break; } - Tags.STATUS_CODE.set(span, status.getCode().name()); + Tags.RPC_RESPONSE_STATUS_CODE.set(span, status.getCode().name()); try { super.close(status, trailers); diff --git a/apm-sniffer/apm-sdk-plugin/httpClient-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/httpClient/v4/HttpClientExecuteInterceptor.java b/apm-sniffer/apm-sdk-plugin/httpClient-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/httpClient/v4/HttpClientExecuteInterceptor.java index 38edb702d..e6a741055 100644 --- a/apm-sniffer/apm-sdk-plugin/httpClient-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/httpClient/v4/HttpClientExecuteInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/httpClient-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/httpClient/v4/HttpClientExecuteInterceptor.java @@ -91,7 +91,7 @@ public class HttpClientExecuteInterceptor implements InstanceMethodsAroundInterc AbstractSpan span = ContextManager.activeSpan(); if (statusCode >= 400) { span.errorOccurred(); - Tags.STATUS_CODE.set(span, Integer.toString(statusCode)); + Tags.HTTP_RESPONSE_STATUS_CODE.set(span, statusCode); } HttpRequest httpRequest = (HttpRequest) allArguments[1]; // Active HTTP parameter collection automatically in the profiling context. diff --git a/apm-sniffer/apm-sdk-plugin/httpasyncclient-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/httpasyncclient/v4/wrapper/HttpAsyncResponseConsumerWrapper.java b/apm-sniffer/apm-sdk-plugin/httpasyncclient-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/httpasyncclient/v4/wrapper/HttpAsyncResponseConsumerWrapper.java index 4cbe2f6a1..147fe72e3 100644 --- a/apm-sniffer/apm-sdk-plugin/httpasyncclient-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/httpasyncclient/v4/wrapper/HttpAsyncResponseConsumerWrapper.java +++ b/apm-sniffer/apm-sdk-plugin/httpasyncclient-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/httpasyncclient/v4/wrapper/HttpAsyncResponseConsumerWrapper.java @@ -49,7 +49,7 @@ public class HttpAsyncResponseConsumerWrapper implements HttpAsyncResponseCon int statusCode = response.getStatusLine().getStatusCode(); if (statusCode >= 400) { AbstractSpan span = ContextManager.activeSpan().errorOccurred(); - Tags.STATUS_CODE.set(span, String.valueOf(statusCode)); + Tags.HTTP_RESPONSE_STATUS_CODE.set(span, statusCode); } ContextManager.stopSpan(); } diff --git a/apm-sniffer/apm-sdk-plugin/httpclient-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/httpclient/v3/HttpClientExecuteInterceptor.java b/apm-sniffer/apm-sdk-plugin/httpclient-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/httpclient/v3/HttpClientExecuteInterceptor.java index b23990cba..fa367e2f6 100644 --- a/apm-sniffer/apm-sdk-plugin/httpclient-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/httpclient/v3/HttpClientExecuteInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/httpclient-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/httpclient/v3/HttpClientExecuteInterceptor.java @@ -77,7 +77,7 @@ public class HttpClientExecuteInterceptor implements InstanceMethodsAroundInterc final AbstractSpan span = ContextManager.activeSpan(); if (statusCode >= 400) { span.errorOccurred(); - Tags.STATUS_CODE.set(span, Integer.toString(statusCode)); + Tags.HTTP_RESPONSE_STATUS_CODE.set(span, statusCode); } final HttpMethod httpMethod = (HttpMethod) allArguments[1]; if (httpMethod == null) { diff --git a/apm-sniffer/apm-sdk-plugin/jetty-plugin/jetty-server-9.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jetty/v9/server/HandleInterceptor.java b/apm-sniffer/apm-sdk-plugin/jetty-plugin/jetty-server-9.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jetty/v9/server/HandleInterceptor.java index d872fdc6f..85250d6c7 100644 --- a/apm-sniffer/apm-sdk-plugin/jetty-plugin/jetty-server-9.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jetty/v9/server/HandleInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/jetty-plugin/jetty-server-9.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jetty/v9/server/HandleInterceptor.java @@ -73,7 +73,7 @@ public class HandleInterceptor implements InstanceMethodsAroundInterceptor { AbstractSpan span = ContextManager.activeSpan(); if (IS_SERVLET_GET_STATUS_METHOD_EXIST && servletResponse.getStatus() >= 400) { span.errorOccurred(); - Tags.STATUS_CODE.set(span, Integer.toString(servletResponse.getStatus())); + Tags.HTTP_RESPONSE_STATUS_CODE.set(span, servletResponse.getStatus()); } ContextManager.stopSpan(); ContextManager.getRuntimeContext().remove(Constants.FORWARD_REQUEST_FLAG); diff --git a/apm-sniffer/apm-sdk-plugin/jsonrpc4j-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jsonrpc4j/JsonServiceExporterInterceptor.java b/apm-sniffer/apm-sdk-plugin/jsonrpc4j-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jsonrpc4j/JsonServiceExporterInterceptor.java index ebd5add5d..3be6ee47c 100644 --- a/apm-sniffer/apm-sdk-plugin/jsonrpc4j-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jsonrpc4j/JsonServiceExporterInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/jsonrpc4j-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jsonrpc4j/JsonServiceExporterInterceptor.java @@ -68,7 +68,7 @@ public class JsonServiceExporterInterceptor implements InstanceMethodsAroundInte HttpServletResponse response = (HttpServletResponse) objects[1]; AbstractSpan span = ContextManager.activeSpan(); if (IS_SERVLET_GET_STATUS_METHOD_EXIST) { - Tags.STATUS_CODE.set(span, String.valueOf(response.getStatus())); + Tags.HTTP_RESPONSE_STATUS_CODE.set(span, response.getStatus()); } ContextManager.stopSpan(); diff --git a/apm-sniffer/apm-sdk-plugin/light4j-plugins/light4j-plugin/src/main/java/org/apache/skywalking/apm/plugin/light4j/HandleRequestInterceptor.java b/apm-sniffer/apm-sdk-plugin/light4j-plugins/light4j-plugin/src/main/java/org/apache/skywalking/apm/plugin/light4j/HandleRequestInterceptor.java index 09a035cf3..92c7b7e2e 100644 --- a/apm-sniffer/apm-sdk-plugin/light4j-plugins/light4j-plugin/src/main/java/org/apache/skywalking/apm/plugin/light4j/HandleRequestInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/light4j-plugins/light4j-plugin/src/main/java/org/apache/skywalking/apm/plugin/light4j/HandleRequestInterceptor.java @@ -76,7 +76,7 @@ public class HandleRequestInterceptor implements InstanceMethodsAroundIntercepto if (exchange.getStatusCode() >= 400) { span.errorOccurred(); - Tags.STATUS_CODE.set(span, String.valueOf(exchange.getStatusCode())); + Tags.HTTP_RESPONSE_STATUS_CODE.set(span, exchange.getStatusCode()); } ContextManager.stopSpan(span); diff --git a/apm-sniffer/apm-sdk-plugin/nutz-plugins/http-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/nutz/http/sync/SenderSendInterceptor.java b/apm-sniffer/apm-sdk-plugin/nutz-plugins/http-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/nutz/http/sync/SenderSendInterceptor.java index 22faeeed6..18073215a 100644 --- a/apm-sniffer/apm-sdk-plugin/nutz-plugins/http-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/nutz/http/sync/SenderSendInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/nutz-plugins/http-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/nutz/http/sync/SenderSendInterceptor.java @@ -68,7 +68,7 @@ public class SenderSendInterceptor implements InstanceMethodsAroundInterceptor { if (response == null || response.getStatus() >= 400) { span.errorOccurred(); if (response != null) - Tags.STATUS_CODE.set(span, Integer.toString(response.getStatus())); + Tags.HTTP_RESPONSE_STATUS_CODE.set(span, response.getStatus()); } ContextManager.stopSpan(); return ret; diff --git a/apm-sniffer/apm-sdk-plugin/nutz-plugins/mvc-annotation-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/nutz/mvc/ActionMethodInterceptor.java b/apm-sniffer/apm-sdk-plugin/nutz-plugins/mvc-annotation-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/nutz/mvc/ActionMethodInterceptor.java index 143f39e98..67a02a43b 100644 --- a/apm-sniffer/apm-sdk-plugin/nutz-plugins/mvc-annotation-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/nutz/mvc/ActionMethodInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/nutz-plugins/mvc-annotation-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/nutz/mvc/ActionMethodInterceptor.java @@ -76,7 +76,7 @@ public class ActionMethodInterceptor implements InstanceMethodsAroundInterceptor AbstractSpan span = ContextManager.activeSpan(); if (response.getStatus() >= 400) { span.errorOccurred(); - Tags.STATUS_CODE.set(span, Integer.toString(response.getStatus())); + Tags.HTTP_RESPONSE_STATUS_CODE.set(span, response.getStatus()); } ContextManager.stopSpan(); return ret; diff --git a/apm-sniffer/apm-sdk-plugin/okhttp-common/src/main/java/org/apache/skywalking/apm/plugin/okhttp/common/RealCallInterceptor.java b/apm-sniffer/apm-sdk-plugin/okhttp-common/src/main/java/org/apache/skywalking/apm/plugin/okhttp/common/RealCallInterceptor.java index 089bbc490..c94464953 100644 --- a/apm-sniffer/apm-sdk-plugin/okhttp-common/src/main/java/org/apache/skywalking/apm/plugin/okhttp/common/RealCallInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/okhttp-common/src/main/java/org/apache/skywalking/apm/plugin/okhttp/common/RealCallInterceptor.java @@ -107,7 +107,7 @@ public class RealCallInterceptor implements InstanceMethodsAroundInterceptor, In AbstractSpan span = ContextManager.activeSpan(); if (statusCode >= 400) { span.errorOccurred(); - Tags.STATUS_CODE.set(span, Integer.toString(statusCode)); + Tags.HTTP_RESPONSE_STATUS_CODE.set(span, statusCode); } } diff --git a/apm-sniffer/apm-sdk-plugin/play-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/play/v2x/TracingFilter.java b/apm-sniffer/apm-sdk-plugin/play-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/play/v2x/TracingFilter.java index 32914b31f..bb0ce3b55 100644 --- a/apm-sniffer/apm-sdk-plugin/play-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/play/v2x/TracingFilter.java +++ b/apm-sniffer/apm-sdk-plugin/play-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/play/v2x/TracingFilter.java @@ -80,7 +80,7 @@ public class TracingFilter extends Filter { CompletionStage stage = next.apply(request).thenApply(result -> { if (result.status() >= 400) { span.errorOccurred(); - Tags.STATUS_CODE.set(span, Integer.toString(result.status())); + Tags.HTTP_RESPONSE_STATUS_CODE.set(span, result.status()); } try { span.asyncFinish(); diff --git a/apm-sniffer/apm-sdk-plugin/resteasy-plugin/resteasy-server-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/resteasy/v3/server/SynchronousDispatcherInterceptor.java b/apm-sniffer/apm-sdk-plugin/resteasy-plugin/resteasy-server-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/resteasy/v3/server/SynchronousDispatcherInterceptor.java index 78aff12ab..2930b1993 100644 --- a/apm-sniffer/apm-sdk-plugin/resteasy-plugin/resteasy-server-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/resteasy/v3/server/SynchronousDispatcherInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/resteasy-plugin/resteasy-server-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/resteasy/v3/server/SynchronousDispatcherInterceptor.java @@ -61,7 +61,7 @@ public class SynchronousDispatcherInterceptor implements InstanceMethodsAroundIn AbstractSpan span = ContextManager.activeSpan(); if (response.getStatus() >= 400) { span.errorOccurred(); - Tags.STATUS_CODE.set(span, Integer.toString(response.getStatus())); + Tags.HTTP_RESPONSE_STATUS_CODE.set(span, response.getStatus()); } ContextManager.stopSpan(); return ret; diff --git a/apm-sniffer/apm-sdk-plugin/servicecomb-plugin/servicecomb-java-chassis-0.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/servicecomb/ProducerOperationHandlerInterceptor.java b/apm-sniffer/apm-sdk-plugin/servicecomb-plugin/servicecomb-java-chassis-0.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/servicecomb/ProducerOperationHandlerInterceptor.java index 9f3e8543b..07cf0295f 100644 --- a/apm-sniffer/apm-sdk-plugin/servicecomb-plugin/servicecomb-java-chassis-0.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/servicecomb/ProducerOperationHandlerInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/servicecomb-plugin/servicecomb-java-chassis-0.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/servicecomb/ProducerOperationHandlerInterceptor.java @@ -59,7 +59,7 @@ public class ProducerOperationHandlerInterceptor implements InstanceMethodsAroun int statusCode = invocation.getStatus().getStatusCode(); if (statusCode >= 400) { span.errorOccurred(); - Tags.STATUS_CODE.set(span, Integer.toString(statusCode)); + Tags.HTTP_RESPONSE_STATUS_CODE.set(span, statusCode); } ContextManager.stopSpan(); return ret; diff --git a/apm-sniffer/apm-sdk-plugin/servicecomb-plugin/servicecomb-java-chassis-0.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/servicecomb/TransportClientHandlerInterceptor.java b/apm-sniffer/apm-sdk-plugin/servicecomb-plugin/servicecomb-java-chassis-0.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/servicecomb/TransportClientHandlerInterceptor.java index 17ee3f851..c505a2a6b 100644 --- a/apm-sniffer/apm-sdk-plugin/servicecomb-plugin/servicecomb-java-chassis-0.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/servicecomb/TransportClientHandlerInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/servicecomb-plugin/servicecomb-java-chassis-0.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/servicecomb/TransportClientHandlerInterceptor.java @@ -68,7 +68,7 @@ public class TransportClientHandlerInterceptor implements InstanceMethodsAroundI int statusCode = invocation.getStatus().getStatusCode(); if (statusCode >= 400) { span.errorOccurred(); - Tags.STATUS_CODE.set(span, Integer.toString(statusCode)); + Tags.HTTP_RESPONSE_STATUS_CODE.set(span, statusCode); } ContextManager.stopSpan(); return ret; diff --git a/apm-sniffer/apm-sdk-plugin/servicecomb-plugin/servicecomb-java-chassis-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/servicecomb/v1/ProducerOperationHandlerInterceptor.java b/apm-sniffer/apm-sdk-plugin/servicecomb-plugin/servicecomb-java-chassis-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/servicecomb/v1/ProducerOperationHandlerInterceptor.java index 80150c739..c9e0a2399 100644 --- a/apm-sniffer/apm-sdk-plugin/servicecomb-plugin/servicecomb-java-chassis-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/servicecomb/v1/ProducerOperationHandlerInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/servicecomb-plugin/servicecomb-java-chassis-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/servicecomb/v1/ProducerOperationHandlerInterceptor.java @@ -59,7 +59,7 @@ public class ProducerOperationHandlerInterceptor implements InstanceMethodsAroun int statusCode = invocation.getStatus().getStatusCode(); if (statusCode >= 400) { span.errorOccurred(); - Tags.STATUS_CODE.set(span, Integer.toString(statusCode)); + Tags.HTTP_RESPONSE_STATUS_CODE.set(span, statusCode); } ContextManager.stopSpan(); return ret; diff --git a/apm-sniffer/apm-sdk-plugin/servicecomb-plugin/servicecomb-java-chassis-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/servicecomb/v1/TransportClientHandlerInterceptor.java b/apm-sniffer/apm-sdk-plugin/servicecomb-plugin/servicecomb-java-chassis-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/servicecomb/v1/TransportClientHandlerInterceptor.java index 9686b5c4c..9debb8b92 100644 --- a/apm-sniffer/apm-sdk-plugin/servicecomb-plugin/servicecomb-java-chassis-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/servicecomb/v1/TransportClientHandlerInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/servicecomb-plugin/servicecomb-java-chassis-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/servicecomb/v1/TransportClientHandlerInterceptor.java @@ -68,7 +68,7 @@ public class TransportClientHandlerInterceptor implements InstanceMethodsAroundI int statusCode = invocation.getStatus().getStatusCode(); if (statusCode >= 400) { span.errorOccurred(); - Tags.STATUS_CODE.set(span, Integer.toString(statusCode)); + Tags.HTTP_RESPONSE_STATUS_CODE.set(span, statusCode); } ContextManager.stopSpan(); return ret; diff --git a/apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/v5/InvokeInterceptor.java b/apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/v5/InvokeInterceptor.java index 50eb1ea7a..7a19cdf3f 100644 --- a/apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/v5/InvokeInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/v5/InvokeInterceptor.java @@ -73,7 +73,7 @@ public class InvokeInterceptor implements InstanceMethodsAroundInterceptorV2 { HttpStatus httpStatus = exchange.getResponse().getStatusCode(); if (httpStatus != null && httpStatus.isError()) { span.errorOccurred(); - Tags.STATUS_CODE.set(span, Integer.toString(httpStatus.value())); + Tags.HTTP_RESPONSE_STATUS_CODE.set(span, httpStatus.value()); } span.asyncFinish(); }); diff --git a/apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-commons/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/commons/interceptor/AbstractMethodInterceptor.java b/apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-commons/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/commons/interceptor/AbstractMethodInterceptor.java index c6121a65f..9e8493a8a 100644 --- a/apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-commons/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/commons/interceptor/AbstractMethodInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-commons/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/commons/interceptor/AbstractMethodInterceptor.java @@ -229,7 +229,7 @@ public abstract class AbstractMethodInterceptor implements InstanceMethodsAround if (statusCode != null && statusCode >= 400) { span.errorOccurred(); - Tags.STATUS_CODE.set(span, Integer.toString(statusCode)); + Tags.HTTP_RESPONSE_STATUS_CODE.set(span, statusCode); } runtimeContext.remove(REACTIVE_ASYNC_SPAN_IN_RUNTIME_CONTEXT); diff --git a/apm-sniffer/apm-sdk-plugin/spring-plugins/resttemplate-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/resttemplate/sync/RestResponseInterceptor.java b/apm-sniffer/apm-sdk-plugin/spring-plugins/resttemplate-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/resttemplate/sync/RestResponseInterceptor.java index bc2b35e20..121444a5b 100644 --- a/apm-sniffer/apm-sdk-plugin/spring-plugins/resttemplate-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/resttemplate/sync/RestResponseInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/spring-plugins/resttemplate-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/resttemplate/sync/RestResponseInterceptor.java @@ -44,7 +44,7 @@ public class RestResponseInterceptor implements InstanceMethodsAroundInterceptor AbstractSpan span = ContextManager.activeSpan(); if (statusCode >= 400) { span.errorOccurred(); - Tags.STATUS_CODE.set(span, Integer.toString(statusCode)); + Tags.HTTP_RESPONSE_STATUS_CODE.set(span, statusCode); } return ret; } diff --git a/apm-sniffer/apm-sdk-plugin/spring-plugins/spring-webflux-5.x-webclient-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/webflux/v5/webclient/WebFluxWebClientInterceptor.java b/apm-sniffer/apm-sdk-plugin/spring-plugins/spring-webflux-5.x-webclient-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/webflux/v5/webclient/WebFluxWebClientInterceptor.java index a32272fb3..dd386d3d2 100644 --- a/apm-sniffer/apm-sdk-plugin/spring-plugins/spring-webflux-5.x-webclient-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/webflux/v5/webclient/WebFluxWebClientInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/spring-plugins/spring-webflux-5.x-webclient-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/webflux/v5/webclient/WebFluxWebClientInterceptor.java @@ -81,7 +81,7 @@ public class WebFluxWebClientInterceptor implements InstanceMethodsAroundInterce return ret1.doOnSuccess(clientResponse -> { HttpStatus httpStatus = clientResponse.statusCode(); if (httpStatus != null) { - Tags.STATUS_CODE.set(span, Integer.toString(httpStatus.value())); + Tags.HTTP_RESPONSE_STATUS_CODE.set(span, httpStatus.value()); if (httpStatus.isError()) { span.errorOccurred(); } diff --git a/apm-sniffer/apm-sdk-plugin/struts2-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/struts2/Struts2Interceptor.java b/apm-sniffer/apm-sdk-plugin/struts2-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/struts2/Struts2Interceptor.java index 1fc63b0a9..70f2db997 100644 --- a/apm-sniffer/apm-sdk-plugin/struts2-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/struts2/Struts2Interceptor.java +++ b/apm-sniffer/apm-sdk-plugin/struts2-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/struts2/Struts2Interceptor.java @@ -71,7 +71,7 @@ public class Struts2Interceptor implements InstanceMethodsAroundInterceptor { AbstractSpan span = ContextManager.activeSpan(); if (IS_SERVLET_GET_STATUS_METHOD_EXIST && response.getStatus() >= 400) { span.errorOccurred(); - Tags.STATUS_CODE.set(span, Integer.toString(response.getStatus())); + Tags.HTTP_RESPONSE_STATUS_CODE.set(span, response.getStatus()); } ContextManager.stopSpan(); return ret; diff --git a/apm-sniffer/apm-sdk-plugin/tomcat-7.x-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/tomcat78x/TomcatInvokeInterceptor.java b/apm-sniffer/apm-sdk-plugin/tomcat-7.x-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/tomcat78x/TomcatInvokeInterceptor.java index f54ab78e7..326e2a9f1 100644 --- a/apm-sniffer/apm-sdk-plugin/tomcat-7.x-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/tomcat78x/TomcatInvokeInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/tomcat-7.x-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/tomcat78x/TomcatInvokeInterceptor.java @@ -95,7 +95,7 @@ public class TomcatInvokeInterceptor implements InstanceMethodsAroundInterceptor AbstractSpan span = ContextManager.activeSpan(); if (IS_SERVLET_GET_STATUS_METHOD_EXIST && response.getStatus() >= 400) { span.errorOccurred(); - Tags.STATUS_CODE.set(span, Integer.toString(response.getStatus())); + Tags.HTTP_RESPONSE_STATUS_CODE.set(span, response.getStatus()); } // Active HTTP parameter collection automatically in the profiling context. if (!TomcatPluginConfig.Plugin.Tomcat.COLLECT_HTTP_PARAMS && span.isProfiling()) { diff --git a/apm-sniffer/apm-sdk-plugin/undertow-plugins/undertow-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/undertow/v2x/handler/TracingHandler.java b/apm-sniffer/apm-sdk-plugin/undertow-plugins/undertow-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/undertow/v2x/handler/TracingHandler.java index 8bf79f55a..d41c2992a 100644 --- a/apm-sniffer/apm-sdk-plugin/undertow-plugins/undertow-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/undertow/v2x/handler/TracingHandler.java +++ b/apm-sniffer/apm-sdk-plugin/undertow-plugins/undertow-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/undertow/v2x/handler/TracingHandler.java @@ -72,7 +72,7 @@ public class TracingHandler implements HttpHandler { nextListener.proceed(); if (httpServerExchange.getStatusCode() >= 400) { span.errorOccurred(); - Tags.STATUS_CODE.set(span, Integer.toString(httpServerExchange.getStatusCode())); + Tags.HTTP_RESPONSE_STATUS_CODE.set(span, httpServerExchange.getStatusCode()); } span.asyncFinish(); } diff --git a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpClientRequestImplHandleResponseInterceptor.java b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpClientRequestImplHandleResponseInterceptor.java index d1ed6fab0..087551d1a 100644 --- a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpClientRequestImplHandleResponseInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpClientRequestImplHandleResponseInterceptor.java @@ -40,7 +40,7 @@ public class HttpClientRequestImplHandleResponseInterceptor implements InstanceM HttpClientRequestContext requestContext = (HttpClientRequestContext) objInst.getSkyWalkingDynamicField(); if (!requestContext.usingWebClient) { VertxContext context = requestContext.vertxContext; - Tags.STATUS_CODE.set(context.getSpan(), Integer.toString(((HttpClientResponse) allArguments[0]).statusCode())); + Tags.HTTP_RESPONSE_STATUS_CODE.set(context.getSpan(), ((HttpClientResponse) allArguments[0]).statusCode()); context.getSpan().asyncFinish(); AbstractSpan span = ContextManager.createLocalSpan("#" + context.getSpan().getOperationName()); diff --git a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpContextHandleDispatchResponseInterceptor.java b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpContextHandleDispatchResponseInterceptor.java index 3629a0cb6..18e0d9342 100644 --- a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpContextHandleDispatchResponseInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpContextHandleDispatchResponseInterceptor.java @@ -42,7 +42,7 @@ public class HttpContextHandleDispatchResponseInterceptor implements InstanceMet HttpClientRequest clientRequest = httpContext.clientRequest(); VertxContext context = ((HttpClientRequestContext) ((EnhancedInstance) clientRequest) .getSkyWalkingDynamicField()).vertxContext; - Tags.STATUS_CODE.set(context.getSpan(), Integer.toString(httpContext.clientResponse().statusCode())); + Tags.HTTP_RESPONSE_STATUS_CODE.set(context.getSpan(), httpContext.clientResponse().statusCode()); context.getSpan().asyncFinish(); AbstractSpan span = ContextManager.createLocalSpan("#" + context.getSpan().getOperationName()); diff --git a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpServerResponseImplInterceptor.java b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpServerResponseImplInterceptor.java index c68ead8fd..ae9fb51bb 100644 --- a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpServerResponseImplInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpServerResponseImplInterceptor.java @@ -43,7 +43,7 @@ public class HttpServerResponseImplInterceptor implements InstanceMethodsAroundI if ((VertxContext.VERTX_VERSION < 36 && allArguments[0] instanceof ByteBuf) || ((VertxContext.VERTX_VERSION >= 36 && VertxContext.VERTX_VERSION <= 37) || allArguments.length == 2)) { VertxContext context = (VertxContext) objInst.getSkyWalkingDynamicField(); - Tags.STATUS_CODE.set(context.getSpan(), Integer.toString(((HttpServerResponse) objInst).getStatusCode())); + Tags.HTTP_RESPONSE_STATUS_CODE.set(context.getSpan(), ((HttpServerResponse) objInst).getStatusCode()); context.getSpan().asyncFinish(); } } diff --git a/apm-sniffer/bootstrap-plugins/jdk-http-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdk/http/HttpClientParseHttpInterceptor.java b/apm-sniffer/bootstrap-plugins/jdk-http-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdk/http/HttpClientParseHttpInterceptor.java index a409ad284..02315107c 100644 --- a/apm-sniffer/bootstrap-plugins/jdk-http-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdk/http/HttpClientParseHttpInterceptor.java +++ b/apm-sniffer/bootstrap-plugins/jdk-http-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdk/http/HttpClientParseHttpInterceptor.java @@ -46,7 +46,7 @@ public class HttpClientParseHttpInterceptor implements InstanceMethodsAroundInte if (responseCode >= 400) { AbstractSpan span = ContextManager.activeSpan(); span.errorOccurred(); - Tags.STATUS_CODE.set(span, Integer.toString(responseCode)); + Tags.HTTP_RESPONSE_STATUS_CODE.set(span, responseCode); } ContextManager.stopSpan(); return ret; diff --git a/apm-sniffer/optional-plugins/optional-spring-plugins/optional-spring-cloud/gateway-2.0.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/cloud/gateway/v20x/HttpClientRequestInterceptor.java b/apm-sniffer/optional-plugins/optional-spring-plugins/optional-spring-cloud/gateway-2.0.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/cloud/gateway/v20x/HttpClientRequestInterceptor.java index e05597995..a0630305e 100644 --- a/apm-sniffer/optional-plugins/optional-spring-plugins/optional-spring-cloud/gateway-2.0.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/cloud/gateway/v20x/HttpClientRequestInterceptor.java +++ b/apm-sniffer/optional-plugins/optional-spring-plugins/optional-spring-cloud/gateway-2.0.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/cloud/gateway/v20x/HttpClientRequestInterceptor.java @@ -92,7 +92,7 @@ public class HttpClientRequestInterceptor implements InstanceMethodsAroundInterc } else if (httpClientResponse.status().code() > 400) { abstractSpan.errorOccurred(); } - Tags.STATUS_CODE.set(abstractSpan, String.valueOf(httpClientResponse.status().code())); + Tags.HTTP_RESPONSE_STATUS_CODE.set(abstractSpan, httpClientResponse.status().code()); abstractSpan.asyncFinish(); } diff --git a/apm-sniffer/optional-plugins/optional-spring-plugins/optional-spring-cloud/gateway-2.1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/cloud/gateway/v21x/HttpClientFinalizerResponseConnectionInterceptor.java b/apm-sniffer/optional-plugins/optional-spring-plugins/optional-spring-cloud/gateway-2.1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/cloud/gateway/v21x/HttpClientFinalizerResponseConnectionInterceptor.java index 9c9fd191c..1d67b7c0f 100644 --- a/apm-sniffer/optional-plugins/optional-spring-plugins/optional-spring-cloud/gateway-2.1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/cloud/gateway/v21x/HttpClientFinalizerResponseConnectionInterceptor.java +++ b/apm-sniffer/optional-plugins/optional-spring-plugins/optional-spring-cloud/gateway-2.1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/cloud/gateway/v21x/HttpClientFinalizerResponseConnectionInterceptor.java @@ -43,7 +43,7 @@ public class HttpClientFinalizerResponseConnectionInterceptor implements Instanc if (response.status().code() >= 400) { cache.getSpan().errorOccurred(); } - Tags.STATUS_CODE.set(cache.getSpan(), String.valueOf(response.status().code())); + Tags.HTTP_RESPONSE_STATUS_CODE.set(cache.getSpan(), response.status().code()); cache.getSpan().asyncFinish(); } diff --git a/apm-sniffer/optional-plugins/optional-spring-plugins/optional-spring-cloud/gateway-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/cloud/gateway/v3x/HttpClientFinalizerResponseConnectionInterceptor.java b/apm-sniffer/optional-plugins/optional-spring-plugins/optional-spring-cloud/gateway-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/cloud/gateway/v3x/HttpClientFinalizerResponseConnectionInterceptor.java index eef52f49a..0ef159d44 100644 --- a/apm-sniffer/optional-plugins/optional-spring-plugins/optional-spring-cloud/gateway-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/cloud/gateway/v3x/HttpClientFinalizerResponseConnectionInterceptor.java +++ b/apm-sniffer/optional-plugins/optional-spring-plugins/optional-spring-cloud/gateway-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/cloud/gateway/v3x/HttpClientFinalizerResponseConnectionInterceptor.java @@ -52,7 +52,7 @@ public class HttpClientFinalizerResponseConnectionInterceptor implements Instanc if (response.status().code() >= HttpResponseStatus.BAD_REQUEST.code()) { cache.getSpan().errorOccurred(); } - Tags.STATUS_CODE.set(cache.getSpan(), String.valueOf(response.status().code())); + Tags.HTTP_RESPONSE_STATUS_CODE.set(cache.getSpan(), response.status().code()); cache.getSpan().asyncFinish(); } diff --git a/apm-sniffer/optional-plugins/optional-spring-plugins/spring-webflux-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/webflux/v5/DispatcherHandlerHandleMethodInterceptor.java b/apm-sniffer/optional-plugins/optional-spring-plugins/spring-webflux-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/webflux/v5/DispatcherHandlerHandleMethodInterceptor.java index 915f76b29..e40584e0a 100644 --- a/apm-sniffer/optional-plugins/optional-spring-plugins/spring-webflux-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/webflux/v5/DispatcherHandlerHandleMethodInterceptor.java +++ b/apm-sniffer/optional-plugins/optional-spring-plugins/spring-webflux-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/webflux/v5/DispatcherHandlerHandleMethodInterceptor.java @@ -62,7 +62,7 @@ public class DispatcherHandlerHandleMethodInterceptor implements InstanceMethods } AbstractSpan span = ContextManager.createEntrySpan(exchange.getRequest().getURI().getPath(), carrier); - + if (instance != null && instance.getSkyWalkingDynamicField() != null) { ContextManager.continued((ContextSnapshot) instance.getSkyWalkingDynamicField()); } @@ -76,7 +76,7 @@ public class DispatcherHandlerHandleMethodInterceptor implements InstanceMethods exchange.getAttributes().put("SKYWALING_SPAN", span); } - + private void maybeSetPattern(AbstractSpan span, ServerWebExchange exchange) { if (span != null) { PathPattern pathPattern = exchange.getAttribute(HandlerMapping.BEST_MATCHING_PATTERN_ATTRIBUTE); @@ -95,17 +95,17 @@ public class DispatcherHandlerHandleMethodInterceptor implements InstanceMethods ServerWebExchange exchange = (ServerWebExchange) allArguments[0]; AbstractSpan span = (AbstractSpan) exchange.getAttributes().get("SKYWALING_SPAN"); - + return ((Mono) ret).doFinally(s -> { if (span != null) { maybeSetPattern(span, exchange); try { - + HttpStatus httpStatus = exchange.getResponse().getStatusCode(); // fix webflux-2.0.0-2.1.0 version have bug. httpStatus is null. not support if (httpStatus != null) { - Tags.STATUS_CODE.set(span, Integer.toString(httpStatus.value())); + Tags.HTTP_RESPONSE_STATUS_CODE.set(span, httpStatus.value()); if (httpStatus.isError()) { span.errorOccurred(); } diff --git a/docs/en/concepts-and-designs/scope-definitions.md b/docs/en/concepts-and-designs/scope-definitions.md index 812f777b3..146368ab5 100644 --- a/docs/en/concepts-and-designs/scope-definitions.md +++ b/docs/en/concepts-and-designs/scope-definitions.md @@ -10,7 +10,9 @@ Using the Aggregation Function, the requests will be grouped by time and **Group | endpoint | The endpoint path of each request. | | string | | latency | The time taken by each request. | | int(in ms) | | status | The success or failure of the request. | | bool(true for success) | -| responseCode | The response code of the HTTP response, and if this request is the HTTP call. E.g. 200, 404, 302| | int | +| ~~responseCode~~ | Deprecated.The response code of the HTTP response, and if this request is the HTTP call. E.g. 200, 404, 302| | int | +| httpResponseStatusCode | The response code of the HTTP response, and if this request is the HTTP call. E.g. 200, 404, 302| | int | +| rpcStatusCode | The string value of the rpc response code. | | string | | type | The type of each request, such as Database, HTTP, RPC, or gRPC. | | enum | | tags | The labels of each request. Each value is made up by `TagKey:TagValue` in the segment. | | `List` | @@ -26,7 +28,9 @@ This calculates the metrics data from each request of the service. | endpointName | The name of the endpoint, such as a full path of HTTP URI. | | string | | latency | The time taken by each request. | | int | | status | Indicates the success or failure of the request. | | bool(true for success) | -| responseCode | The response code of the HTTP response, if this request is an HTTP call. | | int| +| ~~responseCode~~ | Deprecated.The response code of the HTTP response, and if this request is the HTTP call. E.g. 200, 404, 302| | int | +| httpResponseStatusCode | The response code of the HTTP response, and if this request is the HTTP call. E.g. 200, 404, 302| | int | +| rpcStatusCode | The string value of the rpc response code. | | string | | type | The type of each request. Such as: Database, HTTP, RPC, gRPC. | | enum | | tags | The labels of each request. Each value is made up by `TagKey:TagValue` in the segment. | | `List` | | sideCar.internalErrorCode | The sidecar/gateway proxy internal error code. The value is based on the implementation. | | string| @@ -45,7 +49,9 @@ This calculates the metrics data from each request of the service instance. | endpointName | The name of the endpoint, such as a full path of the HTTP URI. | | string| | latency | The time taken by each request. | | int | | status | Indicates the success or failure of the request. | | bool(true for success) | -| responseCode | The response code of HTTP response, if this request is an HTTP call. | | int | +| ~~responseCode~~ | Deprecated.The response code of the HTTP response, and if this request is the HTTP call. E.g. 200, 404, 302| | int | +| httpResponseStatusCode | The response code of the HTTP response, and if this request is the HTTP call. E.g. 200, 404, 302| | int | +| rpcStatusCode | The string value of the rpc response code. | | string | | type | The type of each request, such as Database, HTTP, RPC, or gRPC. | | enum | | tags | The labels of each request. Each value is made up by `TagKey:TagValue` in the segment. | | `List` | | sideCar.internalErrorCode | The sidecar/gateway proxy internal error code. The value is based on the implementation. | | string| @@ -134,7 +140,9 @@ This calculates the metrics data from each request of the endpoint in the servic | serviceInstanceName | The name of the service instance ID. | | string | | latency | The time taken by each request. | | int | | status | Indicates the success or failure of the request.| | bool(true for success) | -| responseCode | The response code of HTTP response, if this request is an HTTP call. | | int | +| ~~responseCode~~ | Deprecated.The response code of the HTTP response, and if this request is the HTTP call. E.g. 200, 404, 302| | int | +| httpResponseStatusCode | The response code of the HTTP response, and if this request is the HTTP call. E.g. 200, 404, 302| | int | +| rpcStatusCode | The string value of the rpc response code. | | string | | type | The type of each request, such as Database, HTTP, RPC, or gRPC. | | enum | | tags | The labels of each request. Each value is made up by `TagKey:TagValue` in the segment. | | `List` | | sideCar.internalErrorCode | The sidecar/gateway proxy internal error code. The value is based on the implementation. | | string| @@ -157,7 +165,9 @@ This calculates the metrics data from each request between services. | componentId | The ID of component used in this call. | yes | string | latency | The time taken by each request. | | int | | status | Indicates the success or failure of the request.| | bool(true for success) | -| responseCode | The response code of HTTP response, if this request is an HTTP call. | | int | +| ~~responseCode~~ | Deprecated.The response code of the HTTP response, and if this request is the HTTP call. E.g. 200, 404, 302| | int | +| httpResponseStatusCode | The response code of the HTTP response, and if this request is the HTTP call. E.g. 200, 404, 302| | int | +| rpcStatusCode | The string value of the rpc response code. | | string | | type | The type of each request, such as Database, HTTP, RPC, or gRPC. | | enum | | detectPoint | Where the relation is detected. The value may be client, server, or proxy. | yes | enum| | tlsMode | The TLS mode between source and destination services, such as `service_relation_mtls_cpm = from(ServiceRelation.*).filter(tlsMode == "mTLS").cpm()` || string| @@ -181,7 +191,9 @@ This calculates the metrics data from each request between service instances. | componentId | The ID of the component used in this call. | yes | string | latency | The time taken by each request. | | int | | status | Indicates the success or failure of the request.| | bool(true for success) | -| responseCode | The response code of the HTTP response, if this request is an HTTP call. | | int | +| ~~responseCode~~ | Deprecated.The response code of the HTTP response, and if this request is the HTTP call. E.g. 200, 404, 302| | int | +| httpResponseStatusCode | The response code of the HTTP response, and if this request is the HTTP call. E.g. 200, 404, 302| | int | +| rpcStatusCode | The string value of the rpc response code. | | string | | type | The type of each request, such as Database, HTTP, RPC, or gRPC. | | enum | | detectPoint | Where the relation is detected. The value may be client, server, or proxy. | yes | enum| | tlsMode | The TLS mode between source and destination service instances, such as `service_instance_relation_mtls_cpm = from(ServiceInstanceRelation.*).filter(tlsMode == "mTLS").cpm()` || string| @@ -208,7 +220,9 @@ including auto instrument agents (like Java and .NET), OpenCensus SkyWalking exp | rpcLatency | The latency of the RPC between the parent endpoint and childEndpoint, excluding the latency caused by the parent endpoint itself. | componentId | The ID of the component used in this call. | yes | string | status | Indicates the success or failure of the request.| | bool(true for success) | -| responseCode | The response code of the HTTP response, if this request is an HTTP call. | | int | +| ~~responseCode~~ | Deprecated.The response code of the HTTP response, and if this request is the HTTP call. E.g. 200, 404, 302| | int | +| httpResponseStatusCode | The response code of the HTTP response, and if this request is the HTTP call. E.g. 200, 404, 302| | int | +| rpcStatusCode | The string value of the rpc response code. | | string | | type | The type of each request, such as Database, HTTP, RPC, or gRPC. | | enum | | detectPoint | Indicates where the relation is detected. The value may be client, server, or proxy. | yes | enum| diff --git a/docs/en/guides/Java-Plugin-Development-Guide.md b/docs/en/guides/Java-Plugin-Development-Guide.md index 757b060d8..7fca22b99 100644 --- a/docs/en/guides/Java-Plugin-Development-Guide.md +++ b/docs/en/guides/Java-Plugin-Development-Guide.md @@ -159,7 +159,7 @@ For extension of the component name/ID, please follow the [component library def ### Special Span Tags All tags are available in the trace view. Meanwhile, in the OAP backend analysis, some special tags or tag combinations provide other advanced features. -#### Tag key `status_code` +#### Tag key `http.status_code` The value should be an integer. The response code of OAL entities corresponds to this value. #### Tag keys `db.statement` and `db.type`. diff --git a/oap-server/analyzer/agent-analyzer/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/trace/parser/SpanTags.java b/oap-server/analyzer/agent-analyzer/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/trace/parser/SpanTags.java index 982d5e8ea..6260ed008 100644 --- a/oap-server/analyzer/agent-analyzer/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/trace/parser/SpanTags.java +++ b/oap-server/analyzer/agent-analyzer/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/trace/parser/SpanTags.java @@ -22,8 +22,17 @@ package org.apache.skywalking.oap.server.analyzer.provider.trace.parser; * Reserved keys of the span. The backend analysis the metrics according the existed tags. */ public class SpanTags { + public static final String HTTP_RESPONSE_STATUS_CODE = "http.status_code"; + /** + * Deprecated. The old status_code tag, in order to be compatible with the old version of agent. + * It should be replaced by {@link #HTTP_RESPONSE_STATUS_CODE} or using + * {@link #RPC_RESPONSE_STATUS_CODE} if status code is related to a rpc call. + */ + @Deprecated public static final String STATUS_CODE = "status_code"; + public static final String RPC_RESPONSE_STATUS_CODE = "rpc.status_code"; + public static final String DB_STATEMENT = "db.statement"; public static final String DB_TYPE = "db.type"; diff --git a/oap-server/analyzer/agent-analyzer/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/trace/parser/listener/MultiScopesAnalysisListener.java b/oap-server/analyzer/agent-analyzer/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/trace/parser/listener/MultiScopesAnalysisListener.java index 7aae0fab0..927fd0dca 100644 --- a/oap-server/analyzer/agent-analyzer/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/trace/parser/listener/MultiScopesAnalysisListener.java +++ b/oap-server/analyzer/agent-analyzer/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/trace/parser/listener/MultiScopesAnalysisListener.java @@ -18,6 +18,8 @@ package org.apache.skywalking.oap.server.analyzer.provider.trace.parser.listener; +import static org.apache.skywalking.oap.server.analyzer.provider.trace.parser.SpanTags.LOGIC_ENDPOINT; + import com.google.gson.Gson; import com.google.gson.JsonObject; import java.util.ArrayList; @@ -49,8 +51,6 @@ import org.apache.skywalking.oap.server.core.source.ServiceInstanceRelation; import org.apache.skywalking.oap.server.core.source.SourceReceiver; import org.apache.skywalking.oap.server.library.module.ModuleManager; -import static org.apache.skywalking.oap.server.analyzer.provider.trace.parser.SpanTags.LOGIC_ENDPOINT; - /** * MultiScopesSpanListener includes the most segment to source(s) logic. * @@ -239,13 +239,18 @@ public class MultiScopesAnalysisListener implements EntryAnalysisListener, ExitA sourceBuilder.setTimeBucket(TimeBucket.getMinuteTimeBucket(span.getStartTime())); sourceBuilder.setLatency((int) latency); sourceBuilder.setResponseCode(Const.NONE); + sourceBuilder.setHttpResponseStatusCode(Const.NONE); span.getTagsList().forEach(tag -> { - if (SpanTags.STATUS_CODE.equals(tag.getKey())) { + final String tagKey = tag.getKey(); + if (SpanTags.STATUS_CODE.equals(tagKey) || SpanTags.HTTP_RESPONSE_STATUS_CODE.equals(tagKey)) { try { sourceBuilder.setResponseCode(Integer.parseInt(tag.getValue())); + sourceBuilder.setHttpResponseStatusCode(Integer.parseInt(tag.getValue())); } catch (NumberFormatException e) { log.warn("span {} has illegal status code {}", span, tag.getValue()); } + } else if (SpanTags.RPC_RESPONSE_STATUS_CODE.equals(tagKey)) { + sourceBuilder.setRpcStatusCode(tag.getValue()); } sourceBuilder.setTag(tag); }); diff --git a/oap-server/analyzer/agent-analyzer/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/trace/parser/listener/SourceBuilder.java b/oap-server/analyzer/agent-analyzer/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/trace/parser/listener/SourceBuilder.java index c5e243b42..589f90e79 100644 --- a/oap-server/analyzer/agent-analyzer/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/trace/parser/listener/SourceBuilder.java +++ b/oap-server/analyzer/agent-analyzer/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/trace/parser/listener/SourceBuilder.java @@ -85,9 +85,16 @@ class SourceBuilder { private boolean status; @Getter @Setter + @Deprecated private int responseCode; @Getter @Setter + private int httpResponseStatusCode; + @Getter + @Setter + private String rpcStatusCode; + @Getter + @Setter private RequestType type; @Getter @Setter @@ -119,6 +126,8 @@ class SourceBuilder { all.setLatency(latency); all.setStatus(status); all.setResponseCode(responseCode); + all.setHttpResponseStatusCode(httpResponseStatusCode); + all.setRpcStatusCode(rpcStatusCode); all.setType(type); all.setTimeBucket(timeBucket); all.setTags(tags); @@ -137,6 +146,8 @@ class SourceBuilder { service.setLatency(latency); service.setStatus(status); service.setResponseCode(responseCode); + service.setHttpResponseStatusCode(httpResponseStatusCode); + service.setRpcStatusCode(rpcStatusCode); service.setType(type); service.setTags(tags); service.setTimeBucket(timeBucket); @@ -159,6 +170,8 @@ class SourceBuilder { serviceRelation.setLatency(latency); serviceRelation.setStatus(status); serviceRelation.setResponseCode(responseCode); + serviceRelation.setHttpResponseStatusCode(httpResponseStatusCode); + serviceRelation.setRpcStatusCode(rpcStatusCode); serviceRelation.setType(type); serviceRelation.setDetectPoint(detectPoint); serviceRelation.setTimeBucket(timeBucket); @@ -178,6 +191,8 @@ class SourceBuilder { serviceInstance.setLatency(latency); serviceInstance.setStatus(status); serviceInstance.setResponseCode(responseCode); + serviceInstance.setHttpResponseStatusCode(httpResponseStatusCode); + serviceInstance.setRpcStatusCode(rpcStatusCode); serviceInstance.setType(type); serviceInstance.setTags(tags); serviceInstance.setTimeBucket(timeBucket); @@ -203,6 +218,8 @@ class SourceBuilder { serviceInstanceRelation.setLatency(latency); serviceInstanceRelation.setStatus(status); serviceInstanceRelation.setResponseCode(responseCode); + serviceInstanceRelation.setHttpResponseStatusCode(httpResponseStatusCode); + serviceInstanceRelation.setRpcStatusCode(rpcStatusCode); serviceInstanceRelation.setType(type); serviceInstanceRelation.setDetectPoint(detectPoint); serviceInstanceRelation.setTimeBucket(timeBucket); @@ -221,6 +238,8 @@ class SourceBuilder { endpoint.setLatency(latency); endpoint.setStatus(status); endpoint.setResponseCode(responseCode); + endpoint.setHttpResponseStatusCode(httpResponseStatusCode); + endpoint.setRpcStatusCode(rpcStatusCode); endpoint.setType(type); endpoint.setTags(tags); endpoint.setTimeBucket(timeBucket); @@ -252,6 +271,8 @@ class SourceBuilder { endpointRelation.setRpcLatency(latency); endpointRelation.setStatus(status); endpointRelation.setResponseCode(responseCode); + endpointRelation.setHttpResponseStatusCode(httpResponseStatusCode); + endpointRelation.setRpcStatusCode(rpcStatusCode); endpointRelation.setType(type); endpointRelation.setDetectPoint(detectPoint); endpointRelation.setTimeBucket(timeBucket); diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/source/All.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/source/All.java index 7c81c47bc..8d7be47e1 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/source/All.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/source/All.java @@ -53,9 +53,16 @@ public class All extends Source { private boolean status; @Getter @Setter + @Deprecated private int responseCode; @Getter @Setter + private int httpResponseStatusCode; + @Getter + @Setter + private String rpcStatusCode; + @Getter + @Setter private RequestType type; @Getter @Setter diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/source/Endpoint.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/source/Endpoint.java index c5c438d26..57b5e2e92 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/source/Endpoint.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/source/Endpoint.java @@ -72,9 +72,16 @@ public class Endpoint extends Source { private boolean status; @Getter @Setter + @Deprecated private int responseCode; @Getter @Setter + private int httpResponseStatusCode; + @Getter + @Setter + private String rpcStatusCode; + @Getter + @Setter private RequestType type; @Getter @Setter diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/source/EndpointRelation.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/source/EndpointRelation.java index 77b5ceac7..665a416aa 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/source/EndpointRelation.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/source/EndpointRelation.java @@ -83,9 +83,16 @@ public class EndpointRelation extends Source { private boolean status; @Getter @Setter + @Deprecated private int responseCode; @Getter @Setter + private int httpResponseStatusCode; + @Getter + @Setter + private String rpcStatusCode; + @Getter + @Setter private RequestType type; @Getter @Setter diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/source/Service.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/source/Service.java index 07a2c6567..ba4891d5b 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/source/Service.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/source/Service.java @@ -67,9 +67,16 @@ public class Service extends Source { private boolean status; @Getter @Setter + @Deprecated private int responseCode; @Getter @Setter + private int httpResponseStatusCode; + @Getter + @Setter + private String rpcStatusCode; + @Getter + @Setter private RequestType type; @Getter @Setter diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/source/ServiceInstance.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/source/ServiceInstance.java index b93742c0d..5099aed57 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/source/ServiceInstance.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/source/ServiceInstance.java @@ -70,9 +70,16 @@ public class ServiceInstance extends Source { private boolean status; @Getter @Setter + @Deprecated private int responseCode; @Getter @Setter + private int httpResponseStatusCode; + @Getter + @Setter + private String rpcStatusCode; + @Getter + @Setter private RequestType type; @Getter @Setter diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/source/ServiceInstanceRelation.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/source/ServiceInstanceRelation.java index 775561a23..c41212f0f 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/source/ServiceInstanceRelation.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/source/ServiceInstanceRelation.java @@ -92,9 +92,16 @@ public class ServiceInstanceRelation extends Source { private boolean status; @Getter @Setter + @Deprecated private int responseCode; @Getter @Setter + private int httpResponseStatusCode; + @Getter + @Setter + private String rpcStatusCode; + @Getter + @Setter private RequestType type; @Getter @Setter diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/source/ServiceRelation.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/source/ServiceRelation.java index 9b13d71cc..4b6668acb 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/source/ServiceRelation.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/source/ServiceRelation.java @@ -86,9 +86,16 @@ public class ServiceRelation extends Source { private boolean status; @Getter @Setter + @Deprecated private int responseCode; @Getter @Setter + private int httpResponseStatusCode; + @Getter + @Setter + private String rpcStatusCode; + @Getter + @Setter private RequestType type; @Getter @Setter diff --git a/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/test/java/org/apache/skywalking/oap/server/receiver/trace/mock/ServiceAMock.java b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/test/java/org/apache/skywalking/oap/server/receiver/trace/mock/ServiceAMock.java index 6192eb536..41d6b3cec 100644 --- a/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/test/java/org/apache/skywalking/oap/server/receiver/trace/mock/ServiceAMock.java +++ b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/test/java/org/apache/skywalking/oap/server/receiver/trace/mock/ServiceAMock.java @@ -64,8 +64,8 @@ class ServiceAMock { span.setOperationName(REST_ENDPOINT); span.setIsError(false); span.addTags(KeyStringValuePair.newBuilder().setKey("http.method").setValue("get").build()); - span.addTags(KeyStringValuePair.newBuilder().setKey("status_code").setValue("404").build()); - span.addTags(KeyStringValuePair.newBuilder().setKey("status_code").setValue("200").build()); + span.addTags(KeyStringValuePair.newBuilder().setKey("http.status_code").setValue("404").build()); + span.addTags(KeyStringValuePair.newBuilder().setKey("http.status_code").setValue("200").build()); return span; } diff --git a/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/test/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/listener/MultiScopesAnalysisListenerTest.java b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/test/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/listener/MultiScopesAnalysisListenerTest.java index 5d37e7092..dad8813aa 100644 --- a/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/test/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/listener/MultiScopesAnalysisListenerTest.java +++ b/oap-server/server-receiver-plugin/skywalking-trace-receiver-plugin/src/test/java/org/apache/skywalking/oap/server/receiver/trace/provider/parser/listener/MultiScopesAnalysisListenerTest.java @@ -134,10 +134,15 @@ public class MultiScopesAnalysisListenerTest { .setSpanType(SpanType.Entry) .addTags( KeyStringValuePair.newBuilder() - .setKey(SpanTags.STATUS_CODE) + .setKey(SpanTags.HTTP_RESPONSE_STATUS_CODE) .setValue("500") .build() ) + .addTags( + KeyStringValuePair.newBuilder() + .setKey(SpanTags.RPC_RESPONSE_STATUS_CODE) + .setValue("OK") + .build()) .build(); final SegmentObject segment = SegmentObject.newBuilder() .setService("mock-service") @@ -158,6 +163,8 @@ public class MultiScopesAnalysisListenerTest { final EndpointRelation endpointRelation = (EndpointRelation) receivedSources.get(6); Assert.assertEquals("mock-service", service.getName()); Assert.assertEquals(500, service.getResponseCode()); + Assert.assertEquals(500, service.getHttpResponseStatusCode()); + Assert.assertEquals("OK", service.getRpcStatusCode()); Assert.assertFalse(service.isStatus()); Assert.assertEquals("mock-instance", serviceInstance.getName()); Assert.assertEquals("/springMVC", endpoint.getName()); diff --git a/test/plugin/scenarios/asynchttpclient-scenario/config/expectedData.yaml b/test/plugin/scenarios/asynchttpclient-scenario/config/expectedData.yaml index 1db379fab..c422508f1 100644 --- a/test/plugin/scenarios/asynchttpclient-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/asynchttpclient-scenario/config/expectedData.yaml @@ -34,7 +34,7 @@ segmentItems: tags: - {key: http.method, value: GET} - {key: url, value: 'http://localhost:8080/asynchttpclient/back'} - - {key: status_code, value: '200'} + - {key: http.status_code, value: '200'} - operationName: /asynchttpclient/case operationId: 0 parentSpanId: -1 diff --git a/test/plugin/scenarios/correlation-autotag-scenario/config/expectedData.yaml b/test/plugin/scenarios/correlation-autotag-scenario/config/expectedData.yaml index 3c39f92df..6167a6722 100644 --- a/test/plugin/scenarios/correlation-autotag-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/correlation-autotag-scenario/config/expectedData.yaml @@ -213,7 +213,7 @@ segmentItems: peer: '' skipAnalysis: false tags: - - {key: status_code, value: OK} + - {key: rpc.status_code, value: OK} - operationName: Greeter.sayHello/server/Request/onComplete operationId: 0 parentSpanId: -1 diff --git a/test/plugin/scenarios/gateway-2.0.x-scenario/config/expectedData.yaml b/test/plugin/scenarios/gateway-2.0.x-scenario/config/expectedData.yaml index bdc66a31e..2eae775da 100644 --- a/test/plugin/scenarios/gateway-2.0.x-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/gateway-2.0.x-scenario/config/expectedData.yaml @@ -57,7 +57,7 @@ segmentItems: tags: - {key: url, value: 'http://localhost:8080/provider/b/testcase'} - {key: http.method, value: GET} - - {key: status_code, value: '200'} + - {key: http.status_code, value: '200'} skipAnalysis: 'false' - segmentId: not null spans: @@ -74,7 +74,7 @@ segmentItems: peer: 'localhost:18070' tags: - {key: url, value: not null} - - {key: status_code, value: '200'} + - {key: http.status_code, value: '200'} skipAnalysis: 'false' - operationName: SpringCloudGateway/RoutingFilter operationId: 0 diff --git a/test/plugin/scenarios/gateway-2.1.x-scenario/config/expectedData.yaml b/test/plugin/scenarios/gateway-2.1.x-scenario/config/expectedData.yaml index bdc66a31e..2eae775da 100644 --- a/test/plugin/scenarios/gateway-2.1.x-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/gateway-2.1.x-scenario/config/expectedData.yaml @@ -57,7 +57,7 @@ segmentItems: tags: - {key: url, value: 'http://localhost:8080/provider/b/testcase'} - {key: http.method, value: GET} - - {key: status_code, value: '200'} + - {key: http.status_code, value: '200'} skipAnalysis: 'false' - segmentId: not null spans: @@ -74,7 +74,7 @@ segmentItems: peer: 'localhost:18070' tags: - {key: url, value: not null} - - {key: status_code, value: '200'} + - {key: http.status_code, value: '200'} skipAnalysis: 'false' - operationName: SpringCloudGateway/RoutingFilter operationId: 0 diff --git a/test/plugin/scenarios/gateway-3.x-scenario/config/expectedData.yaml b/test/plugin/scenarios/gateway-3.x-scenario/config/expectedData.yaml index bdc66a31e..2eae775da 100644 --- a/test/plugin/scenarios/gateway-3.x-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/gateway-3.x-scenario/config/expectedData.yaml @@ -57,7 +57,7 @@ segmentItems: tags: - {key: url, value: 'http://localhost:8080/provider/b/testcase'} - {key: http.method, value: GET} - - {key: status_code, value: '200'} + - {key: http.status_code, value: '200'} skipAnalysis: 'false' - segmentId: not null spans: @@ -74,7 +74,7 @@ segmentItems: peer: 'localhost:18070' tags: - {key: url, value: not null} - - {key: status_code, value: '200'} + - {key: http.status_code, value: '200'} skipAnalysis: 'false' - operationName: SpringCloudGateway/RoutingFilter operationId: 0 diff --git a/test/plugin/scenarios/grpc-scenario/config/expectedData.yaml b/test/plugin/scenarios/grpc-scenario/config/expectedData.yaml index 28258edbf..8ddf28c2e 100644 --- a/test/plugin/scenarios/grpc-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/grpc-scenario/config/expectedData.yaml @@ -169,7 +169,7 @@ segmentItems: spanType: Local peer: '' tags: - - {key: status_code, value: OK} + - {key: rpc.status_code, value: OK} skipAnalysis: 'false' - operationName: GreeterBlocking.sayHello/server/Request/onComplete operationId: 0 @@ -231,7 +231,7 @@ segmentItems: spanType: Local peer: '' tags: - - {key: status_code, value: OK} + - {key: rpc.status_code, value: OK} skipAnalysis: 'false' - operationName: Greeter.sayHello/server/Request/onComplete operationId: 0 @@ -317,7 +317,7 @@ segmentItems: spanType: Local peer: '' tags: - - {key: status_code, value: UNKNOWN} + - {key: rpc.status_code, value: UNKNOWN} logs: - logEvent: - {key: event, value: error} @@ -370,7 +370,7 @@ segmentItems: spanType: Local peer: '' tags: - - {key: status_code, value: UNKNOWN} + - {key: rpc.status_code, value: UNKNOWN} logs: - logEvent: - {key: event, value: error} @@ -428,7 +428,7 @@ segmentItems: tags: - {key: url, value: 'http://localhost:8080/grpc-scenario/case/grpc-scenario'} - {key: http.method, value: GET} - - {key: status_code, value: '500'} + - {key: http.status_code, value: '500'} logs: - logEvent: - {key: event, value: error} diff --git a/test/plugin/scenarios/jsonrpc4j-1.x-scenario/config/expectedData.yaml b/test/plugin/scenarios/jsonrpc4j-1.x-scenario/config/expectedData.yaml index 3d4a45238..9bdfe3ce7 100644 --- a/test/plugin/scenarios/jsonrpc4j-1.x-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/jsonrpc4j-1.x-scenario/config/expectedData.yaml @@ -77,7 +77,7 @@ segmentItems: value: 'http://localhost:8080/jsonrpc4j-1.x-scenario/path/to/demo-service', } - { key: jsonrpc.method, value: sayHello } - - { key: status_code, value: '200' } + - { key: http.status_code, value: '200' } refs: - { parentEndpoint: /jsonrpc4j-1.x-scenario/case/json-rpc, diff --git a/test/plugin/scenarios/springmvc-reactive-devtools-scenario/config/expectedData.yaml b/test/plugin/scenarios/springmvc-reactive-devtools-scenario/config/expectedData.yaml index 95dd65009..3751817f2 100644 --- a/test/plugin/scenarios/springmvc-reactive-devtools-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/springmvc-reactive-devtools-scenario/config/expectedData.yaml @@ -93,7 +93,7 @@ segmentItems: tags: - {key: url, value: not null} - {key: http.method, value: GET} - - {key: status_code, value: '500'} + - {key: http.status_code, value: '500'} logs: - logEvent: - {key: event, value: error} diff --git a/test/plugin/scenarios/springmvc-reactive-scenario/config/expectedData.yaml b/test/plugin/scenarios/springmvc-reactive-scenario/config/expectedData.yaml index 160ca0620..f6035621e 100644 --- a/test/plugin/scenarios/springmvc-reactive-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/springmvc-reactive-scenario/config/expectedData.yaml @@ -93,7 +93,7 @@ segmentItems: tags: - {key: url, value: not null} - {key: http.method, value: GET} - - {key: status_code, value: '500'} + - {key: http.status_code, value: '500'} logs: - logEvent: - {key: event, value: error} diff --git a/test/plugin/scenarios/vertx-eventbus-3.x-scenario/config/expectedData.yaml b/test/plugin/scenarios/vertx-eventbus-3.x-scenario/config/expectedData.yaml index 237511440..6fc6978b1 100644 --- a/test/plugin/scenarios/vertx-eventbus-3.x-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/vertx-eventbus-3.x-scenario/config/expectedData.yaml @@ -46,7 +46,7 @@ segmentItems: tags: - {key: http.method, value: HEAD} - {key: url, value: '/vertx-eventbus-3-scenario/case/healthCheck'} - - {key: status_code, value: '200'} + - {key: http.status_code, value: '200'} - segmentId: not null spans: - operationName: local-message-receiver @@ -97,7 +97,7 @@ segmentItems: tags: - {key: http.method, value: GET} - {key: url, value: '/vertx-eventbus-3-scenario/case/executeTest'} - - {key: status_code, value: '200'} + - {key: http.status_code, value: '200'} - operationName: org.apache.skywalking.apm.testcase.vertxeventbus.controller.VertxEventbusController$$Lambda$.handle(RoutingContext) operationId: 0 parentSpanId: 0 @@ -125,7 +125,7 @@ segmentItems: tags: - {key: http.method, value: GET} - {key: url, value: '/vertx-eventbus-3-scenario/case/eventbus-case'} - - {key: status_code, value: '200'} + - {key: http.status_code, value: '200'} - segmentId: not null spans: - operationName: '#/vertx-eventbus-3-scenario/case/executeTest' @@ -207,7 +207,7 @@ segmentItems: tags: - {key: http.method, value: GET} - {key: url, value: '/vertx-eventbus-3-scenario/case/executeTest'} - - {key: status_code, value: '200'} + - {key: http.status_code, value: '200'} refs: - {parentEndpoint: '{GET}/vertx-eventbus-3-scenario/case/eventbus-case', networkAddress: 'localhost:8080', refType: CrossProcess, parentSpanId: 2, parentTraceSegmentId: not null, diff --git a/test/plugin/scenarios/vertx-web-3.54minus-scenario/config/expectedData.yaml b/test/plugin/scenarios/vertx-web-3.54minus-scenario/config/expectedData.yaml index df7a69a48..4b918ddb1 100644 --- a/test/plugin/scenarios/vertx-web-3.54minus-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/vertx-web-3.54minus-scenario/config/expectedData.yaml @@ -46,7 +46,7 @@ segmentItems: tags: - {key: http.method, value: HEAD} - {key: url, value: '/vertx-web-3_54minus-scenario/case/healthCheck'} - - {key: status_code, value: '200'} + - {key: http.status_code, value: '200'} - segmentId: not null spans: - operationName: '/vertx-web-3_54minus-scenario/dynamicEndpoint/100' @@ -64,7 +64,7 @@ segmentItems: tags: - {key: http.method, value: GET} - {key: url, value: '/vertx-web-3_54minus-scenario/dynamicEndpoint/100'} - - {key: status_code, value: '200'} + - {key: http.status_code, value: '200'} - operationName: '/vertx-web-3_54minus-scenario/case/healthCheck' operationId: 0 parentSpanId: 1 @@ -80,7 +80,7 @@ segmentItems: tags: - {key: http.method, value: HEAD} - {key: url, value: '/vertx-web-3_54minus-scenario/case/healthCheck'} - - {key: status_code, value: '200'} + - {key: http.status_code, value: '200'} - operationName: org.apache.skywalking.apm.testcase.vertxweb.controller.VertxWebController$$Lambda$.handle(RoutingContext) operationId: 0 parentSpanId: 0 @@ -108,7 +108,7 @@ segmentItems: tags: - {key: http.method, value: GET} - {key: url, value: '/vertx-web-3_54minus-scenario/case/web-case'} - - {key: status_code, value: '200'} + - {key: http.status_code, value: '200'} - segmentId: not null spans: - operationName: org.apache.skywalking.apm.testcase.vertxweb.controller.VertxWebController$$Lambda$.handle(RoutingContext) @@ -138,7 +138,7 @@ segmentItems: tags: - {key: http.method, value: HEAD} - {key: url, value: '/vertx-web-3_54minus-scenario/case/healthCheck'} - - {key: status_code, value: '200'} + - {key: http.status_code, value: '200'} refs: - {parentEndpoint: '{GET}/vertx-web-3_54minus-scenario/case/web-case', networkAddress: 'localhost:8080', refType: CrossProcess, parentSpanId: 3, parentTraceSegmentId: not null, @@ -173,7 +173,7 @@ segmentItems: tags: - {key: http.method, value: GET} - {key: url, value: '/vertx-web-3_54minus-scenario/dynamicEndpoint/100'} - - {key: status_code, value: '200'} + - {key: http.status_code, value: '200'} refs: - {parentEndpoint: '{GET}/vertx-web-3_54minus-scenario/case/web-case', networkAddress: 'localhost:8080', refType: CrossProcess, parentSpanId: 2, parentTraceSegmentId: not null, @@ -208,7 +208,7 @@ segmentItems: tags: - {key: http.method, value: GET} - {key: url, value: '/vertx-web-3_54minus-scenario/case/web-case/withBodyHandler'} - - {key: status_code, value: '200'} + - {key: http.status_code, value: '200'} refs: - {parentEndpoint: '#/vertx-web-3_54minus-scenario/case/healthCheck', networkAddress: 'localhost:8080', refType: CrossProcess, parentSpanId: 1, parentTraceSegmentId: not null, @@ -269,7 +269,7 @@ segmentItems: tags: - {key: http.method, value: GET} - {key: url, value: '/vertx-web-3_54minus-scenario/case/web-case/withBodyHandler'} - - {key: status_code, value: '200'} + - {key: http.status_code, value: '200'} - operationName: '#/vertx-web-3_54minus-scenario/case/healthCheck' operationId: 0 parentSpanId: -1 diff --git a/test/plugin/scenarios/vertx-web-3.6plus-scenario/config/expectedData.yaml b/test/plugin/scenarios/vertx-web-3.6plus-scenario/config/expectedData.yaml index 5de5e8f28..7289b5d42 100644 --- a/test/plugin/scenarios/vertx-web-3.6plus-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/vertx-web-3.6plus-scenario/config/expectedData.yaml @@ -46,7 +46,7 @@ segmentItems: tags: - {key: http.method, value: HEAD} - {key: url, value: '/vertx-web-3_6plus-scenario/case/healthCheck'} - - {key: status_code, value: '200'} + - {key: http.status_code, value: '200'} - segmentId: not null spans: - operationName: '/vertx-web-3_6plus-scenario/dynamicEndpoint/100' @@ -64,7 +64,7 @@ segmentItems: tags: - {key: http.method, value: GET} - {key: url, value: '/vertx-web-3_6plus-scenario/dynamicEndpoint/100'} - - {key: status_code, value: '200'} + - {key: http.status_code, value: '200'} - operationName: '/vertx-web-3_6plus-scenario/case/healthCheck' operationId: 0 parentSpanId: 1 @@ -80,7 +80,7 @@ segmentItems: tags: - {key: http.method, value: HEAD} - {key: url, value: '/vertx-web-3_6plus-scenario/case/healthCheck'} - - {key: status_code, value: '200'} + - {key: http.status_code, value: '200'} - operationName: org.apache.skywalking.apm.testcase.vertxweb.controller.VertxWebController$$Lambda$.handle(RoutingContext) operationId: 0 parentSpanId: 0 @@ -108,7 +108,7 @@ segmentItems: tags: - {key: http.method, value: GET} - {key: url, value: '/vertx-web-3_6plus-scenario/case/web-case'} - - {key: status_code, value: '200'} + - {key: http.status_code, value: '200'} - segmentId: not null spans: - operationName: org.apache.skywalking.apm.testcase.vertxweb.controller.VertxWebController$$Lambda$.handle(RoutingContext) @@ -138,7 +138,7 @@ segmentItems: tags: - {key: http.method, value: HEAD} - {key: url, value: '/vertx-web-3_6plus-scenario/case/healthCheck'} - - {key: status_code, value: '200'} + - {key: http.status_code, value: '200'} refs: - {parentEndpoint: '{GET}/vertx-web-3_6plus-scenario/case/web-case', networkAddress: 'localhost:8080', refType: CrossProcess, parentSpanId: 3, parentTraceSegmentId: not null, @@ -173,7 +173,7 @@ segmentItems: tags: - {key: http.method, value: GET} - {key: url, value: '/vertx-web-3_6plus-scenario/dynamicEndpoint/100'} - - {key: status_code, value: '200'} + - {key: http.status_code, value: '200'} refs: - {parentEndpoint: '{GET}/vertx-web-3_6plus-scenario/case/web-case', networkAddress: 'localhost:8080', refType: CrossProcess, parentSpanId: 2, parentTraceSegmentId: not null, @@ -208,7 +208,7 @@ segmentItems: tags: - {key: http.method, value: GET} - {key: url, value: '/vertx-web-3_6plus-scenario/case/web-case/withBodyHandler'} - - {key: status_code, value: '200'} + - {key: http.status_code, value: '200'} refs: - {parentEndpoint: '#/vertx-web-3_6plus-scenario/case/healthCheck', networkAddress: 'localhost:8080', refType: CrossProcess, parentSpanId: 1, parentTraceSegmentId: not null, @@ -269,7 +269,7 @@ segmentItems: tags: - {key: http.method, value: GET} - {key: url, value: '/vertx-web-3_6plus-scenario/case/web-case/withBodyHandler'} - - {key: status_code, value: '200'} + - {key: http.status_code, value: '200'} - operationName: '#/vertx-web-3_6plus-scenario/case/healthCheck' operationId: 0 parentSpanId: -1 diff --git a/test/plugin/scenarios/webflux-scenario/config/expectedData.yaml b/test/plugin/scenarios/webflux-scenario/config/expectedData.yaml index d6c62c74b..d2d5bf0d0 100644 --- a/test/plugin/scenarios/webflux-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/webflux-scenario/config/expectedData.yaml @@ -33,7 +33,7 @@ segmentItems: tags: - {key: url, value: 'http://localhost:18080/testcase/annotation/success'} - {key: http.method, value: GET} - - {key: status_code, value: '200'} + - {key: http.status_code, value: '200'} refs: - {parentEndpoint: /projectA/testcase, networkAddress: 'localhost:18080', refType: CrossProcess, parentSpanId: 1, parentTraceSegmentId: not null, parentServiceInstance: not @@ -55,7 +55,7 @@ segmentItems: tags: - {key: url, value: 'http://localhost:18080/testcase/annotation/error'} - {key: http.method, value: GET} - - {key: status_code, value: '500'} + - {key: http.status_code, value: '500'} refs: - {parentEndpoint: /projectA/testcase, networkAddress: 'localhost:18080', refType: CrossProcess, parentSpanId: 2, parentTraceSegmentId: not null, parentServiceInstance: not @@ -77,7 +77,7 @@ segmentItems: tags: - {key: url, value: 'http://localhost:18080/testcase/annotation/foo'} - {key: http.method, value: GET} - - {key: status_code, value: '200'} + - {key: http.status_code, value: '200'} refs: - {parentEndpoint: /projectA/testcase, networkAddress: 'localhost:18080', refType: CrossProcess, parentSpanId: 3, parentTraceSegmentId: not null, parentServiceInstance: not @@ -99,7 +99,7 @@ segmentItems: tags: - {key: url, value: 'http://localhost:18080/testcase/annotation/loo'} - {key: http.method, value: GET} - - {key: status_code, value: '200'} + - {key: http.status_code, value: '200'} refs: - {parentEndpoint: /projectA/testcase, networkAddress: 'localhost:18080', refType: CrossProcess, parentSpanId: 4, parentTraceSegmentId: not null, parentServiceInstance: not @@ -121,7 +121,7 @@ segmentItems: tags: - {key: url, value: 'http://localhost:18080/testcase/route/success'} - {key: http.method, value: GET} - - {key: status_code, value: '200'} + - {key: http.status_code, value: '200'} refs: - {parentEndpoint: /projectA/testcase, networkAddress: 'localhost:18080', refType: CrossProcess, parentSpanId: 5, parentTraceSegmentId: not null, parentServiceInstance: not @@ -143,7 +143,7 @@ segmentItems: tags: - {key: url, value: 'http://localhost:18080/testcase/route/error'} - {key: http.method, value: GET} - - {key: status_code, value: '500'} + - {key: http.status_code, value: '500'} refs: - {parentEndpoint: /projectA/testcase, networkAddress: 'localhost:18080', refType: CrossProcess, parentSpanId: 6, parentTraceSegmentId: not null, parentServiceInstance: not @@ -165,7 +165,7 @@ segmentItems: tags: - {key: url, value: 'http://localhost:18080/notFound'} - {key: http.method, value: GET} - - {key: status_code, value: '404'} + - {key: http.status_code, value: '404'} refs: - {parentEndpoint: /projectA/testcase, networkAddress: 'localhost:18080', refType: CrossProcess, parentSpanId: 7, parentTraceSegmentId: not null, parentServiceInstance: not @@ -187,7 +187,7 @@ segmentItems: tags: - {key: url, value: 'http://localhost:18080/testcase/annotation/mono/hello'} - {key: http.method, value: GET} - - {key: status_code, value: '200'} + - {key: http.status_code, value: '200'} refs: - {parentEndpoint: /projectA/testcase, networkAddress: 'localhost:18080', refType: CrossProcess, parentSpanId: 8, parentTraceSegmentId: not null, parentServiceInstance: not @@ -209,7 +209,7 @@ segmentItems: tags: - {key: url, value: 'http://localhost:18080/testcase/webclient/server'} - {key: http.method, value: GET} - - {key: status_code, value: '200'} + - {key: http.status_code, value: '200'} refs: - {parentEndpoint: /projectA/testcase, networkAddress: 'localhost:18080', refType: CrossProcess, parentSpanId: 9, parentTraceSegmentId: not null, parentServiceInstance: not @@ -249,7 +249,7 @@ segmentItems: tags: - {key: url, value: not null} - {key: http.method, value: GET} - - {key: status_code, value: '500'} + - {key: http.status_code, value: '500'} skipAnalysis: 'false' - operationName: /testcase/annotation/foo operationId: 0 @@ -310,7 +310,7 @@ segmentItems: tags: - {key: url, value: not null} - {key: http.method, value: GET} - - {key: status_code, value: '500'} + - {key: http.status_code, value: '500'} skipAnalysis: 'false' - operationName: /notFound operationId: 0 @@ -326,7 +326,7 @@ segmentItems: tags: - {key: url, value: not null} - {key: http.method, value: GET} - - {key: status_code, value: '404'} + - {key: http.status_code, value: '404'} skipAnalysis: 'false' - operationName: /testcase/annotation/mono/hello operationId: 0 @@ -357,7 +357,7 @@ segmentItems: tags: - {key: url, value: not null} - {key: http.method, value: GET} - - {key: status_code, value:'200'} + - {key: http.status_code, value: '200'} skipAnalysis: 'false' - operationName: /projectA/testcase operationId: 0