From 29de696c42901206848575e20dc1de2ca4943e64 Mon Sep 17 00:00:00 2001 From: Evan <31562192+EvanLjp@users.noreply.github.com> Date: Wed, 9 Sep 2020 15:07:01 +0800 Subject: [PATCH] exception-ignore-plugin (#5426) --- .github/workflows/plugins-test.0.yaml | 2 + .../apm/toolkit/trace/IgnoredException.java | 35 +++++ .../apm/agent/core/conf/Config.java | 16 +- ...AnnotationMatchExceptionCheckStrategy.java | 36 +++++ .../context/status/ExceptionCheckContext.java | 50 ++++++ .../status/ExceptionCheckStrategy.java | 27 ++++ .../HierarchyMatchExceptionCheckStrategy.java | 46 ++++++ .../status/OffExceptionCheckStrategy.java | 29 ++++ .../context/status/StatusCheckService.java | 69 ++++++++ .../core/context/status/StatusChecker.java | 90 +++++++++++ .../context/trace/AbstractTracingSpan.java | 5 + ...skywalking.apm.agent.core.boot.BootService | 3 +- .../agent/core/boot/ServiceManagerTest.java | 2 +- .../core/context/ContextManagerTest.java | 2 - .../status/ExceptionCheckStrategyTest.java | 70 +++++++++ .../status/StatusCheckServiceCheckTest.java | 83 ++++++++++ .../context/status/StatusCheckerTest.java | 77 +++++++++ .../status/TestAnnotationMatchException.java | 56 +++++++ .../status/TestHierarchyMatchException.java | 44 ++++++ .../status/TestNamedMatchException.java | 44 ++++++ .../activemq/ActiveMQConsumerInterceptor.java | 2 +- .../activemq/ActiveMQProducerInterceptor.java | 2 +- .../armeria/Armeria084ClientInterceptor.java | 2 +- .../armeria/Armeria084ServerInterceptor.java | 2 +- .../armeria/Armeria085ServerInterceptor.java | 2 +- .../armeria/ArmeriaClientInterceptor.java | 2 +- .../avro/AbstractRequestInterceptor.java | 2 +- .../apm/plugin/avro/ResponderInterceptor.java | 2 +- .../plugin/baidu/brpc/ClientInterceptor.java | 1 - .../plugin/baidu/brpc/ServerInterceptor.java | 2 - .../apm/plugin/canal/CanalInterceptor.java | 2 +- .../driver/v3/ClusterConnectInterceptor.java | 1 - ...etFutureGetUninterruptiblyInterceptor.java | 1 - ...ecuteAsyncWithStatementArgInterceptor.java | 1 - .../plugin/asf/dubbo/DubboInterceptor.java | 1 - .../apm/plugin/dubbo/DubboInterceptor.java | 1 - .../ehcache/v2/EhcacheLockInterceptor.java | 2 +- .../v2/EhcacheOperateAllInterceptor.java | 2 +- .../v2/EhcacheOperateElementInterceptor.java | 2 +- .../v2/EhcacheOperateObjectInterceptor.java | 2 +- .../plugin/esjob/JobExecutorInterceptor.java | 2 +- .../ElasticJobExecutorInterceptor.java | 2 +- ...lainListenableActionFutureInterceptor.java | 2 +- .../TransportActionNodeProxyInterceptor.java | 2 +- ...tionFutureActionGetMethodsInterceptor.java | 2 +- ...erClientGetSettingsMethodsInterceptor.java | 6 +- ...ClusterClientHealthMethodsInterceptor.java | 6 +- ...erClientPutSettingsMethodsInterceptor.java | 8 +- ...IndicesClientCreateMethodsInterceptor.java | 8 +- ...IndicesClientDeleteMethodsInterceptor.java | 6 +- ...tHighLevelClientGetMethodsInterceptor.java | 8 +- ...ighLevelClientIndexMethodsInterceptor.java | 8 +- ...ghLevelClientSearchMethodsInterceptor.java | 8 +- ...ghLevelClientUpdateMethodsInterceptor.java | 8 +- ...ionNodeProxyExecuteMethodsInterceptor.java | 2 +- .../http/v9/DefaultHttpClientInterceptor.java | 1 - .../ClientDestTracingFilterInterceptor.java | 2 +- .../ClientTracingFilterInterceptor.java | 3 +- .../ServerTracingFilterInterceptor.java | 3 +- .../graphql/v12/GraphqlInterceptor.java | 1 - .../plugin/graphql/v8/GraphqlInterceptor.java | 1 - .../plugin/graphql/v9/GraphqlInterceptor.java | 1 - .../v1/client/BlockingCallInterceptor.java | 2 +- .../grpc/v1/client/TracingClientCall.java | 14 +- .../grpc/v1/server/TracingServerCall.java | 10 +- .../v1/server/TracingServerCallListener.java | 6 +- .../apm/plugin/hbase/HTableInterceptor.java | 1 - .../v4/HttpClientExecuteInterceptor.java | 1 - .../v4/wrapper/FutureCallbackWrapper.java | 2 +- .../HttpAsyncResponseConsumerWrapper.java | 2 +- .../v3/HttpClientExecuteInterceptor.java | 2 +- .../HystrixCommandGetFallbackInterceptor.java | 2 +- .../v1/HystrixCommandRunInterceptor.java | 2 +- .../InfluxDBMethodInterceptor.java | 2 +- .../ConnectionServiceMethodInterceptor.java | 2 +- .../jdbc/trace/CallableStatementTracing.java | 1 - .../jdbc/trace/PreparedStatementTracing.java | 1 - .../plugin/jdbc/trace/StatementTracing.java | 1 - .../apm/plugin/jdbc/ConnectionTracing.java | 1 - .../jedis/v2/JedisMethodInterceptor.java | 1 - .../SyncHttpRequestSendInterceptor.java | 2 +- .../SyncHttpRequestSendInterceptor.java | 2 +- .../jetty/v9/server/HandleInterceptor.java | 2 +- .../kafka/define/InterceptorMethod.java | 2 +- .../kafka/CallbackAdapterInterceptor.java | 4 +- .../apm/plugin/kafka/CallbackInterceptor.java | 4 +- .../kafka/KafkaConsumerInterceptor.java | 2 +- .../kafka/SubscribeMethodInterceptor.java | 2 +- .../v5/AsyncCommandMethodInterceptor.java | 2 +- .../v5/RedisChannelWriterInterceptor.java | 1 - .../apm/plugin/lettuce/v5/SWBiConsumer.java | 2 +- .../apm/plugin/lettuce/v5/SWConsumer.java | 2 +- .../light4j/HandleRequestInterceptor.java | 2 +- ...redStatementExecuteMethodsInterceptor.java | 2 +- .../StatementExecuteMethodsInterceptor.java | 2 +- .../MongoDBCollectionMethodInterceptor.java | 1 - .../interceptor/v30/MongoDBInterceptor.java | 1 - .../MongoDBOperationExecutorInterceptor.java | 1 - .../motan/MotanConsumerInterceptor.java | 2 - .../motan/MotanProviderInterceptor.java | 2 - ...redStatementExecuteMethodsInterceptor.java | 2 +- .../StatementExecuteMethodsInterceptor.java | 2 +- .../NettySocketIOConnectionInterceptor.java | 2 +- .../NettySocketIOOnEventInterceptor.java | 2 +- .../NettySocketIORoomInterceptor.java | 2 +- .../nutz/http/sync/SenderSendInterceptor.java | 2 +- .../nutz/mvc/ActionMethodInterceptor.java | 2 +- .../plugin/okhttp/v3/EnqueueInterceptor.java | 2 +- .../okhttp/v3/OnFailureInterceptor.java | 4 +- .../okhttp/v3/OnResponseInterceptor.java | 2 +- .../plugin/okhttp/v3/RealCallInterceptor.java | 1 - .../play/v2x/HttpFiltersInterceptor.java | 2 +- .../apm/plugin/play/v2x/TracingFilter.java | 2 +- ...redStatementExecuteMethodsInterceptor.java | 2 +- .../StatementExecuteMethodsInterceptor.java | 2 +- .../pulsar/PulsarConsumerInterceptor.java | 2 +- .../pulsar/PulsarProducerInterceptor.java | 2 +- .../pulsar/SendCallbackInterceptor.java | 4 +- .../apm/plugin/quasar/FiberInterceptor.java | 1 - .../rabbitmq/RabbitMQConsumerInterceptor.java | 2 +- .../rabbitmq/RabbitMQProducerInterceptor.java | 2 +- .../v3/RedisConnectionMethodInterceptor.java | 1 - ...hronousDispatcherExceptionInterceptor.java | 4 +- .../SynchronousDispatcherInterceptor.java | 2 +- .../v3/AbstractMessageConsumeInterceptor.java | 2 +- .../rocketMQ/v3/MessageSendInterceptor.java | 2 +- .../rocketMQ/v3/OnExceptionInterceptor.java | 2 +- .../rocketMQ/v3/OnSuccessInterceptor.java | 2 +- .../v4/AbstractMessageConsumeInterceptor.java | 2 +- .../rocketMQ/v4/MessageSendInterceptor.java | 2 +- .../rocketMQ/v4/OnExceptionInterceptor.java | 2 +- .../rocketMQ/v4/OnSuccessInterceptor.java | 2 +- .../ProducerOperationHandlerInterceptor.java | 1 - .../TransportClientHandlerInterceptor.java | 1 - .../ProducerOperationHandlerInterceptor.java | 1 - .../v1/TransportClientHandlerInterceptor.java | 1 - .../sjdbc/define/ExecuteInterceptor.java | 2 +- .../shardingsphere/ExecuteInterceptor.java | 2 +- .../JDBCRootInvokeInterceptor.java | 2 +- .../shardingsphere/ParseInterceptor.java | 2 +- .../ProxyRootInvokeInterceptor.java | 2 +- .../v40/ExecuteInterceptor.java | 2 +- .../v40/JDBCRootInvokeInterceptor.java | 2 +- .../shardingsphere/v40/ParseInterceptor.java | 2 +- .../v40/ProxyRootInvokeInterceptor.java | 2 +- .../v41/ExecuteInterceptor.java | 2 +- .../v41/JDBCRootInvokeInterceptor.java | 2 +- .../shardingsphere/v41/ParseInterceptor.java | 2 +- .../v41/ProxyRootInvokeInterceptor.java | 2 +- .../v4rc3/ExecuteInterceptor.java | 2 +- .../v4rc3/JDBCRootInvokeInterceptor.java | 2 +- .../v4rc3/ParseInterceptor.java | 2 +- .../v4rc3/ProxyRootInvokeInterceptor.java | 2 +- .../shardingsphere/v4/ExecuteInterceptor.java | 2 +- .../v4/JDBCRootInvokeInterceptor.java | 2 +- .../shardingsphere/v4/ParseInterceptor.java | 2 +- .../v4/ProxyRootInvokeInterceptor.java | 2 +- .../sofarpc/SofaRpcConsumerInterceptor.java | 1 - .../sofarpc/SofaRpcProviderInterceptor.java | 1 - .../plugin/solrj/SolrClientInterceptor.java | 2 +- .../solrj/SolrConnectorInterceptor.java | 2 +- .../apm/plugin/spring/async/SWCallable.java | 2 +- .../FailureCallbackInterceptor.java | 5 +- .../SuccessCallbackInterceptor.java | 2 +- .../AbstractMethodInterceptor.java | 2 +- .../async/FutureGetInterceptor.java | 2 +- .../async/RestExecuteInterceptor.java | 2 +- .../sync/RestExecuteInterceptor.java | 2 +- .../sync/RestResponseInterceptor.java | 2 +- .../scheduled/ScheduledMethodInterceptor.java | 2 +- .../v2/MemcachedMethodInterceptor.java | 1 - .../plugin/struts2/Struts2Interceptor.java | 2 +- .../tomcat78x/TomcatExceptionInterceptor.java | 2 +- .../tomcat78x/TomcatInvokeInterceptor.java | 1 - .../v2x/ListenerConfigInterceptor.java | 2 +- .../undertow/v2x/RootHandlerInterceptor.java | 2 +- .../v2x/RoutingHandlerInterceptor.java | 2 +- .../undertow/v2x/handler/TracingHandler.java | 2 +- ...lusteredEventBusSendRemoteInterceptor.java | 2 +- ...entBusImplDeliverToHandlerInterceptor.java | 2 +- .../HandlerRegistrationInterceptor.java | 2 +- ...RequestImplHandleExceptionInterceptor.java | 4 +- ...tRequestImplHandleResponseInterceptor.java | 2 +- .../HttpClientRequestImplInterceptor.java | 2 +- ...textHandleDispatchResponseInterceptor.java | 2 +- .../HttpContextSendRequestInterceptor.java | 2 +- ...esponseImplHandleExceptionInterceptor.java | 4 +- .../HttpServerResponseImplInterceptor.java | 2 +- .../vertx3/RouteImplHandlerInterceptor.java | 2 +- .../plugin/vertx3/RouteStateInterceptor.java | 2 +- ...verConnectionHandleMessageInterceptor.java | 2 +- .../v2/XMemcachedMethodInterceptor.java | 1 - .../ActiveSpanErrorThrowableInteceptor.java | 1 - .../CallableOrRunnableInvokeInterceptor.java | 2 +- .../IgnoredExceptionAnnotationActivation.java | 65 ++++++++ .../IgnoredExceptionConstructInterceptor.java | 36 +++++ .../trace/TagAnnotationMethodInterceptor.java | 2 +- .../TraceAnnotationMethodInterceptor.java | 2 +- .../src/main/resources/skywalking-plugin.def | 3 +- .../http/HttpClientParseHttpInterceptor.java | 2 +- .../HttpClientWriteRequestInterceptor.java | 2 +- .../threading/ThreadingMethodInterceptor.java | 2 +- apm-sniffer/config/agent.config | 7 + .../interceptor/BaseInterceptorMethods.java | 2 +- .../plugin/gson/GsonFromJsonInterceptor.java | 2 +- .../plugin/gson/GsonToJsonInterceptor.java | 2 +- .../v20x/HttpClientRequestInterceptor.java | 2 +- .../v20x/NettyRoutingFilterInterceptor.java | 2 +- .../v21x/NettyRoutingFilterInterceptor.java | 2 +- .../SpringAnnotationInterceptor.java | 2 +- .../EndTransactionMethodInterceptor.java | 2 +- .../GetTransactionMethodInterceptor.java | 2 +- .../quartz/JobRunShellMethodInterceptor.java | 2 +- .../zookeeper/ClientCnxnInterceptor.java | 1 - .../EventThreadMethodInterceptor.java | 2 +- .../java-agent/How-to-tolerate-exceptions.md | 114 ++++++++++++++ .../service-agent/java-agent/Plugin-list.md | 1 + .../setup/service-agent/java-agent/README.md | 4 +- .../bin/startup.sh | 21 +++ .../config/expectedData.yaml | 148 ++++++++++++++++++ .../configuration.yml | 22 +++ .../exception-checker-spring-scenario/pom.xml | 118 ++++++++++++++ .../src/main/assembly/assembly.xml | 41 +++++ .../apm/toolkit/trace/IgnoredException.java | 35 +++++ .../exceptionchecker/Application.java | 34 ++++ .../controller/CaseController.java | 79 ++++++++++ .../exception/TestAnnotatedException.java | 47 ++++++ .../exception/TestException.java | 44 ++++++ .../TestHierarchyListedException.java | 44 ++++++ .../exception/TestListedException.java | 44 ++++++ .../exceptionchecker/service/TestService.java | 50 ++++++ .../src/main/resources/application.yaml | 23 +++ .../src/main/resources/log4j2.xml | 30 ++++ .../support-version.list | 18 +++ .../config/expectedData.yaml | 132 ++++++++++++++++ .../configuration.yml | 23 +++ .../exception-checker-tomcat-scenario/pom.xml | 97 ++++++++++++ .../apm/toolkit/trace/IgnoredException.java | 35 +++++ .../controller/CaseController.java | 79 ++++++++++ .../exception/TestAnnotatedException.java | 47 ++++++ .../exception/TestException.java | 44 ++++++ .../TestHierarchyListedException.java | 44 ++++++ .../exception/TestListedException.java | 44 ++++++ .../TestOtherClassLoaderException.java | 44 ++++++ .../exceptionchecker/service/TestService.java | 50 ++++++ .../src/main/resources/log4j2.xml | 30 ++++ .../webapp/WEB-INF/spring-mvc-servlet.xml | 30 ++++ .../src/main/webapp/WEB-INF/web.xml | 34 ++++ .../support-version.list | 18 +++ .../grpc-scenario/config/expectedData.yaml | 2 +- 250 files changed, 2756 insertions(+), 249 deletions(-) create mode 100644 apm-application-toolkit/apm-toolkit-trace/src/main/java/org/apache/skywalking/apm/toolkit/trace/IgnoredException.java create mode 100644 apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/status/AnnotationMatchExceptionCheckStrategy.java create mode 100644 apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/status/ExceptionCheckContext.java create mode 100644 apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/status/ExceptionCheckStrategy.java create mode 100644 apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/status/HierarchyMatchExceptionCheckStrategy.java create mode 100644 apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/status/OffExceptionCheckStrategy.java create mode 100644 apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/status/StatusCheckService.java create mode 100644 apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/status/StatusChecker.java create mode 100644 apm-sniffer/apm-agent-core/src/test/java/org/apache/skywalking/apm/agent/core/context/status/ExceptionCheckStrategyTest.java create mode 100644 apm-sniffer/apm-agent-core/src/test/java/org/apache/skywalking/apm/agent/core/context/status/StatusCheckServiceCheckTest.java create mode 100644 apm-sniffer/apm-agent-core/src/test/java/org/apache/skywalking/apm/agent/core/context/status/StatusCheckerTest.java create mode 100644 apm-sniffer/apm-agent-core/src/test/java/org/apache/skywalking/apm/agent/core/context/status/TestAnnotationMatchException.java create mode 100644 apm-sniffer/apm-agent-core/src/test/java/org/apache/skywalking/apm/agent/core/context/status/TestHierarchyMatchException.java create mode 100644 apm-sniffer/apm-agent-core/src/test/java/org/apache/skywalking/apm/agent/core/context/status/TestNamedMatchException.java create mode 100644 apm-sniffer/apm-toolkit-activation/apm-toolkit-trace-activation/src/main/java/org/apache/skywalking/apm/toolkit/activation/trace/IgnoredExceptionAnnotationActivation.java create mode 100644 apm-sniffer/apm-toolkit-activation/apm-toolkit-trace-activation/src/main/java/org/apache/skywalking/apm/toolkit/activation/trace/IgnoredExceptionConstructInterceptor.java create mode 100644 docs/en/setup/service-agent/java-agent/How-to-tolerate-exceptions.md create mode 100644 test/plugin/scenarios/exception-checker-spring-scenario/bin/startup.sh create mode 100644 test/plugin/scenarios/exception-checker-spring-scenario/config/expectedData.yaml create mode 100644 test/plugin/scenarios/exception-checker-spring-scenario/configuration.yml create mode 100644 test/plugin/scenarios/exception-checker-spring-scenario/pom.xml create mode 100644 test/plugin/scenarios/exception-checker-spring-scenario/src/main/assembly/assembly.xml create mode 100644 test/plugin/scenarios/exception-checker-spring-scenario/src/main/java/org/apache/skywalking/apm/toolkit/trace/IgnoredException.java create mode 100644 test/plugin/scenarios/exception-checker-spring-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/exceptionchecker/Application.java create mode 100644 test/plugin/scenarios/exception-checker-spring-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/exceptionchecker/controller/CaseController.java create mode 100644 test/plugin/scenarios/exception-checker-spring-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/exceptionchecker/exception/TestAnnotatedException.java create mode 100644 test/plugin/scenarios/exception-checker-spring-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/exceptionchecker/exception/TestException.java create mode 100644 test/plugin/scenarios/exception-checker-spring-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/exceptionchecker/exception/TestHierarchyListedException.java create mode 100644 test/plugin/scenarios/exception-checker-spring-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/exceptionchecker/exception/TestListedException.java create mode 100644 test/plugin/scenarios/exception-checker-spring-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/exceptionchecker/service/TestService.java create mode 100644 test/plugin/scenarios/exception-checker-spring-scenario/src/main/resources/application.yaml create mode 100644 test/plugin/scenarios/exception-checker-spring-scenario/src/main/resources/log4j2.xml create mode 100644 test/plugin/scenarios/exception-checker-spring-scenario/support-version.list create mode 100644 test/plugin/scenarios/exception-checker-tomcat-scenario/config/expectedData.yaml create mode 100644 test/plugin/scenarios/exception-checker-tomcat-scenario/configuration.yml create mode 100644 test/plugin/scenarios/exception-checker-tomcat-scenario/pom.xml create mode 100644 test/plugin/scenarios/exception-checker-tomcat-scenario/src/main/java/org/apache/skywalking/apm/toolkit/trace/IgnoredException.java create mode 100644 test/plugin/scenarios/exception-checker-tomcat-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/exceptionchecker/controller/CaseController.java create mode 100644 test/plugin/scenarios/exception-checker-tomcat-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/exceptionchecker/exception/TestAnnotatedException.java create mode 100644 test/plugin/scenarios/exception-checker-tomcat-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/exceptionchecker/exception/TestException.java create mode 100644 test/plugin/scenarios/exception-checker-tomcat-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/exceptionchecker/exception/TestHierarchyListedException.java create mode 100644 test/plugin/scenarios/exception-checker-tomcat-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/exceptionchecker/exception/TestListedException.java create mode 100644 test/plugin/scenarios/exception-checker-tomcat-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/exceptionchecker/exception/TestOtherClassLoaderException.java create mode 100644 test/plugin/scenarios/exception-checker-tomcat-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/exceptionchecker/service/TestService.java create mode 100644 test/plugin/scenarios/exception-checker-tomcat-scenario/src/main/resources/log4j2.xml create mode 100644 test/plugin/scenarios/exception-checker-tomcat-scenario/src/main/webapp/WEB-INF/spring-mvc-servlet.xml create mode 100644 test/plugin/scenarios/exception-checker-tomcat-scenario/src/main/webapp/WEB-INF/web.xml create mode 100644 test/plugin/scenarios/exception-checker-tomcat-scenario/support-version.list diff --git a/.github/workflows/plugins-test.0.yaml b/.github/workflows/plugins-test.0.yaml index c40ec57a9..df86e2995 100644 --- a/.github/workflows/plugins-test.0.yaml +++ b/.github/workflows/plugins-test.0.yaml @@ -47,6 +47,8 @@ jobs: - { name: 'elasticsearch-5.x-scenario', title: 'ElasticSearch 5.x (3)' } - { name: 'elasticsearch-6.x-scenario', title: 'ElasticSearch 6.7.1-6.8.4 (7)' } - { name: 'elasticsearch-7.x-scenario', title: 'ElasticSearch 7.0.0-7.5.2 (14)' } + - { name: 'exception-checker-spring-scenario', title: 'SpringBoot exception checker 1.0.0 (1)' } + - { name: 'exception-checker-tomcat-scenario', title: 'Tomcat exception checker 1.0.0 (1)' } - { name: 'feign-scenario', title: 'Feign 9.0.0-9.5.1 (8)' } - { name: 'finagle-17.10.x-scenario', title: 'Finagle 17.10.0-20.1.0(19)' } - { name: 'finagle-6.25.x-scenario', title: 'Finagle 6.25.0-6.43.0 (18)' } diff --git a/apm-application-toolkit/apm-toolkit-trace/src/main/java/org/apache/skywalking/apm/toolkit/trace/IgnoredException.java b/apm-application-toolkit/apm-toolkit-trace/src/main/java/org/apache/skywalking/apm/toolkit/trace/IgnoredException.java new file mode 100644 index 000000000..372c25010 --- /dev/null +++ b/apm-application-toolkit/apm-toolkit-trace/src/main/java/org/apache/skywalking/apm/toolkit/trace/IgnoredException.java @@ -0,0 +1,35 @@ +/* + * 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.toolkit.trace; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * After the exception status checker activated in the agent, the span wouldn't be marked as error status if the + * exception has this annotation. + */ +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +@Inherited +public @interface IgnoredException { +} diff --git a/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/conf/Config.java b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/conf/Config.java index 47b8ebea3..c1b101954 100755 --- a/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/conf/Config.java +++ b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/conf/Config.java @@ -20,7 +20,6 @@ package org.apache.skywalking.apm.agent.core.conf; import java.util.HashMap; import java.util.Map; - import org.apache.skywalking.apm.agent.core.context.trace.TraceSegment; import org.apache.skywalking.apm.agent.core.logging.core.LogLevel; import org.apache.skywalking.apm.agent.core.logging.core.LogOutput; @@ -268,6 +267,21 @@ public class Config { public static String PATTERN = "%level %timestamp %thread %class : %msg %throwable"; } + public static class StatusCheck { + /** + * Listed exceptions would not be treated as an error. Because in some codes, the exception is being used as a + * way of controlling business flow. + */ + public static String IGNORED_EXCEPTIONS = ""; + + /** + * The max recursive depth when checking the exception traced by the agent. Typically, we don't recommend + * setting this more than 10, which could cause a performance issue. Negative value and 0 would be ignored, + * which means all exceptions would make the span tagged in error status. + */ + public static Integer MAX_RECURSIVE_DEPTH = 1; + } + public static class Plugin { /** * Control the length of the peer field. diff --git a/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/status/AnnotationMatchExceptionCheckStrategy.java b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/status/AnnotationMatchExceptionCheckStrategy.java new file mode 100644 index 000000000..61886ced5 --- /dev/null +++ b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/status/AnnotationMatchExceptionCheckStrategy.java @@ -0,0 +1,36 @@ +/* + * 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.status; + +import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance; + +/** + * AnnotationMatchExceptionCheckStrategy does an annotation matching check for a traced exception. If it has been + * annotated with org.apache.skywalking.apm.toolkit.trace.IgnoredException, the error status of the span wouldn't be + * changed. Because of the annotation supports integration, the subclasses would be also annotated with it. + */ +public class AnnotationMatchExceptionCheckStrategy implements ExceptionCheckStrategy { + + private static final String TAG_NAME = AnnotationMatchExceptionCheckStrategy.class.getSimpleName(); + + @Override + public boolean isError(final Throwable e) { + return !(e instanceof EnhancedInstance) || !TAG_NAME.equals(((EnhancedInstance) e).getSkyWalkingDynamicField()); + } +} \ No newline at end of file diff --git a/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/status/ExceptionCheckContext.java b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/status/ExceptionCheckContext.java new file mode 100644 index 000000000..7c9e1b407 --- /dev/null +++ b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/status/ExceptionCheckContext.java @@ -0,0 +1,50 @@ +/* + * 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.status; + +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; + +/** + * ExceptionCheckContext contains the exceptions that have been checked by the exceptionCheckStrategies. + */ +public enum ExceptionCheckContext { + INSTANCE; + + private final Set> ignoredExceptions = ConcurrentHashMap.newKeySet(32); + private final Set> errorStatusExceptions = ConcurrentHashMap.newKeySet(128); + + public boolean isChecked(Throwable throwable) { + return ignoredExceptions.contains(throwable.getClass()) || errorStatusExceptions.contains(throwable.getClass()); + } + + public boolean isError(Throwable throwable) { + Class clazz = throwable.getClass(); + return errorStatusExceptions.contains(clazz) || (!ignoredExceptions.contains(clazz)); + } + + public void registerIgnoredException(Throwable throwable) { + ignoredExceptions.add(throwable.getClass()); + } + + public void registerErrorStatusException(Throwable throwable) { + errorStatusExceptions.add(throwable.getClass()); + } + +} diff --git a/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/status/ExceptionCheckStrategy.java b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/status/ExceptionCheckStrategy.java new file mode 100644 index 000000000..7fcc10e8a --- /dev/null +++ b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/status/ExceptionCheckStrategy.java @@ -0,0 +1,27 @@ +/* + * 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.status; + +/** + * The strategy checks the status of exception traced in a span. + */ +public interface ExceptionCheckStrategy { + + boolean isError(Throwable e); +} diff --git a/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/status/HierarchyMatchExceptionCheckStrategy.java b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/status/HierarchyMatchExceptionCheckStrategy.java new file mode 100644 index 000000000..c1f80f3e0 --- /dev/null +++ b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/status/HierarchyMatchExceptionCheckStrategy.java @@ -0,0 +1,46 @@ +/* + * 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.status; + +import org.apache.skywalking.apm.agent.core.boot.ServiceManager; + +/** + * HierarchyMatchExceptionCheckStrategy does a hierarchy check for a traced exception. If it or its parent has been + * listed in org.apache.skywalking.apm.agent.core.conf.Config.StatusCheck#IGNORED_EXCEPTIONS, the error status of the + * span wouldn't be changed. + */ +public class HierarchyMatchExceptionCheckStrategy implements ExceptionCheckStrategy { + + @Override + public boolean isError(final Throwable e) { + Class clazz = e.getClass(); + StatusCheckService statusTriggerService = ServiceManager.INSTANCE.findService(StatusCheckService.class); + String[] ignoredExceptionNames = statusTriggerService.getIgnoredExceptionNames(); + for (final String ignoredExceptionName : ignoredExceptionNames) { + try { + Class parentClazz = Class.forName(ignoredExceptionName, true, clazz.getClassLoader()); + if (parentClazz.isAssignableFrom(clazz)) { + return false; + } + } catch (ClassNotFoundException ignore) { + } + } + return true; + } +} diff --git a/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/status/OffExceptionCheckStrategy.java b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/status/OffExceptionCheckStrategy.java new file mode 100644 index 000000000..820ec327c --- /dev/null +++ b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/status/OffExceptionCheckStrategy.java @@ -0,0 +1,29 @@ +/* + * 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.status; + +/** + * All exceptions would make the span tagged as the error status. + */ +public class OffExceptionCheckStrategy implements ExceptionCheckStrategy { + @Override + public boolean isError(final Throwable e) { + return true; + } +} diff --git a/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/status/StatusCheckService.java b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/status/StatusCheckService.java new file mode 100644 index 000000000..ebed2a4eb --- /dev/null +++ b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/status/StatusCheckService.java @@ -0,0 +1,69 @@ +/* + * 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.status; + +import java.util.Arrays; +import lombok.Getter; +import org.apache.skywalking.apm.agent.core.boot.BootService; +import org.apache.skywalking.apm.agent.core.boot.DefaultImplementor; +import org.apache.skywalking.apm.agent.core.conf.Config; +import org.apache.skywalking.apm.util.StringUtil; + +import static org.apache.skywalking.apm.agent.core.context.status.StatusChecker.HIERARCHY_MATCH; +import static org.apache.skywalking.apm.agent.core.context.status.StatusChecker.OFF; + +/** + * The StatusCheckService determines whether the span should be tagged in error status if an exception + * captured in the scope. + */ +@DefaultImplementor +public class StatusCheckService implements BootService { + + @Getter + private String[] ignoredExceptionNames; + + private StatusChecker statusChecker; + + @Override + public void prepare() throws Throwable { + ignoredExceptionNames = Arrays.stream(Config.StatusCheck.IGNORED_EXCEPTIONS.split(",")) + .filter(StringUtil::isNotEmpty) + .toArray(String[]::new); + statusChecker = Config.StatusCheck.MAX_RECURSIVE_DEPTH > 0 ? HIERARCHY_MATCH : OFF; + } + + @Override + public void boot() throws Throwable { + + } + + @Override + public void onComplete() throws Throwable { + + } + + @Override + public void shutdown() throws Throwable { + + } + + public boolean isError(Throwable e) { + return statusChecker.checkStatus(e); + } +} diff --git a/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/status/StatusChecker.java b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/status/StatusChecker.java new file mode 100644 index 000000000..ea03202d5 --- /dev/null +++ b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/status/StatusChecker.java @@ -0,0 +1,90 @@ +/* + * 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.status; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Objects; +import lombok.AllArgsConstructor; +import org.apache.skywalking.apm.agent.core.conf.Config; + +@AllArgsConstructor +public enum StatusChecker { + + /** + * All exceptions would make the span tagged as the error status. + */ + OFF( + Collections.singletonList(new OffExceptionCheckStrategy()), + (isError, throwable) -> { + } + ), + + /** + * Hierarchy check the status of the traced exception. + * + * @see HierarchyMatchExceptionCheckStrategy + * @see AnnotationMatchExceptionCheckStrategy + */ + HIERARCHY_MATCH( + Arrays.asList( + new HierarchyMatchExceptionCheckStrategy(), + new AnnotationMatchExceptionCheckStrategy() + ), + (isError, throwable) -> { + if (isError) { + ExceptionCheckContext.INSTANCE.registerErrorStatusException(throwable); + } else { + ExceptionCheckContext.INSTANCE.registerIgnoredException(throwable); + } + } + ); + + private final List strategies; + + private final ExceptionCheckCallback callback; + + public boolean checkStatus(Throwable e) { + int maxDepth = Config.StatusCheck.MAX_RECURSIVE_DEPTH; + boolean isError = true; + while (isError && Objects.nonNull(e) && maxDepth-- > 0) { + isError = check(e); + e = e.getCause(); + } + return isError; + } + + private boolean check(final Throwable e) { + boolean isError = ExceptionCheckContext.INSTANCE.isChecked(e) + ? ExceptionCheckContext.INSTANCE.isError(e) + : strategies.stream().allMatch(item -> item.isError(e)); + callback.onChecked(isError, e); + return isError; + } + + /** + * The callback function would be triggered after an exception is checked by StatusChecker. + */ + @FunctionalInterface + private interface ExceptionCheckCallback { + void onChecked(Boolean isError, Throwable throwable); + } + +} diff --git a/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/trace/AbstractTracingSpan.java b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/trace/AbstractTracingSpan.java index 4bcc7a099..a505e4627 100644 --- a/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/trace/AbstractTracingSpan.java +++ b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/trace/AbstractTracingSpan.java @@ -22,8 +22,10 @@ import java.util.ArrayList; import java.util.LinkedList; import java.util.List; import java.util.Map; +import org.apache.skywalking.apm.agent.core.boot.ServiceManager; import org.apache.skywalking.apm.agent.core.context.ContextManager; import org.apache.skywalking.apm.agent.core.context.TracingContext; +import org.apache.skywalking.apm.agent.core.context.status.StatusCheckService; import org.apache.skywalking.apm.agent.core.context.tag.AbstractTag; import org.apache.skywalking.apm.agent.core.context.tag.Tags; import org.apache.skywalking.apm.agent.core.context.util.KeyValuePair; @@ -163,6 +165,9 @@ public abstract class AbstractTracingSpan implements AbstractSpan { if (logs == null) { logs = new LinkedList<>(); } + if (!errorOccurred && ServiceManager.INSTANCE.findService(StatusCheckService.class).isError(t)) { + errorOccurred(); + } logs.add(new LogDataEntity.Builder().add(new KeyValuePair("event", "error")) .add(new KeyValuePair("error.kind", t.getClass().getName())) .add(new KeyValuePair("message", t.getMessage())) diff --git a/apm-sniffer/apm-agent-core/src/main/resources/META-INF/services/org.apache.skywalking.apm.agent.core.boot.BootService b/apm-sniffer/apm-agent-core/src/main/resources/META-INF/services/org.apache.skywalking.apm.agent.core.boot.BootService index e1d84b9f6..d04e7c137 100644 --- a/apm-sniffer/apm-agent-core/src/main/resources/META-INF/services/org.apache.skywalking.apm.agent.core.boot.BootService +++ b/apm-sniffer/apm-agent-core/src/main/resources/META-INF/services/org.apache.skywalking.apm.agent.core.boot.BootService @@ -30,4 +30,5 @@ org.apache.skywalking.apm.agent.core.profile.ProfileTaskChannelService org.apache.skywalking.apm.agent.core.profile.ProfileSnapshotSender org.apache.skywalking.apm.agent.core.profile.ProfileTaskExecutionService org.apache.skywalking.apm.agent.core.meter.MeterService -org.apache.skywalking.apm.agent.core.meter.MeterSender \ No newline at end of file +org.apache.skywalking.apm.agent.core.meter.MeterSender +org.apache.skywalking.apm.agent.core.context.status.StatusCheckService \ No newline at end of file diff --git a/apm-sniffer/apm-agent-core/src/test/java/org/apache/skywalking/apm/agent/core/boot/ServiceManagerTest.java b/apm-sniffer/apm-agent-core/src/test/java/org/apache/skywalking/apm/agent/core/boot/ServiceManagerTest.java index 829f10e23..618610868 100644 --- a/apm-sniffer/apm-agent-core/src/test/java/org/apache/skywalking/apm/agent/core/boot/ServiceManagerTest.java +++ b/apm-sniffer/apm-agent-core/src/test/java/org/apache/skywalking/apm/agent/core/boot/ServiceManagerTest.java @@ -58,7 +58,7 @@ public class ServiceManagerTest { public void testServiceDependencies() throws Exception { HashMap registryService = getFieldValue(ServiceManager.INSTANCE, "bootedServices"); - assertThat(registryService.size(), is(15)); + assertThat(registryService.size(), is(16)); assertTraceSegmentServiceClient(ServiceManager.INSTANCE.findService(TraceSegmentServiceClient.class)); assertContextManager(ServiceManager.INSTANCE.findService(ContextManager.class)); diff --git a/apm-sniffer/apm-agent-core/src/test/java/org/apache/skywalking/apm/agent/core/context/ContextManagerTest.java b/apm-sniffer/apm-agent-core/src/test/java/org/apache/skywalking/apm/agent/core/context/ContextManagerTest.java index 774da23a9..aeebccd7d 100644 --- a/apm-sniffer/apm-agent-core/src/test/java/org/apache/skywalking/apm/agent/core/context/ContextManagerTest.java +++ b/apm-sniffer/apm-agent-core/src/test/java/org/apache/skywalking/apm/agent/core/context/ContextManagerTest.java @@ -122,7 +122,6 @@ public class ContextManagerTest { ContextCarrier injectContextCarrier = new ContextCarrier(); AbstractSpan exitSpan = ContextManager.createExitSpan("/textExitSpan", injectContextCarrier, "127.0.0.1:12800"); - exitSpan.errorOccurred(); exitSpan.log(new RuntimeException("exception")); exitSpan.setComponent(ComponentsDefine.HTTPCLIENT); @@ -238,7 +237,6 @@ public class ContextManagerTest { ContextCarrier injectContextCarrier = new ContextCarrier(); AbstractSpan exitSpan = ContextManager.createExitSpan("/textExitSpan", injectContextCarrier, "127.0.0.1:12800"); - exitSpan.errorOccurred(); exitSpan.log(new RuntimeException("exception")); exitSpan.setComponent(ComponentsDefine.HTTPCLIENT); SpanLayer.asHttp(exitSpan); diff --git a/apm-sniffer/apm-agent-core/src/test/java/org/apache/skywalking/apm/agent/core/context/status/ExceptionCheckStrategyTest.java b/apm-sniffer/apm-agent-core/src/test/java/org/apache/skywalking/apm/agent/core/context/status/ExceptionCheckStrategyTest.java new file mode 100644 index 000000000..e3bb9cb8a --- /dev/null +++ b/apm-sniffer/apm-agent-core/src/test/java/org/apache/skywalking/apm/agent/core/context/status/ExceptionCheckStrategyTest.java @@ -0,0 +1,70 @@ +/* + * 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.status; + +import java.util.Set; +import org.apache.skywalking.apm.agent.core.boot.ServiceManager; +import org.apache.skywalking.apm.agent.core.conf.Config; +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.powermock.api.support.membermodification.MemberModifier; + +public class ExceptionCheckStrategyTest { + + @Before + public void prepare() { + Config.StatusCheck.IGNORED_EXCEPTIONS = "org.apache.skywalking.apm.agent.core.context.status.TestNamedMatchException"; + Config.StatusCheck.MAX_RECURSIVE_DEPTH = 1; + ServiceManager.INSTANCE.boot(); + } + + @After + public void after() throws IllegalAccessException { + ((Set) MemberModifier + .field(ExceptionCheckContext.class, "ignoredExceptions") + .get(ExceptionCheckContext.INSTANCE)).clear(); + ((Set) MemberModifier + .field(ExceptionCheckContext.class, "errorStatusExceptions") + .get(ExceptionCheckContext.INSTANCE)).clear(); + } + + @Test + public void checkOffExceptionCheckStrategy() { + OffExceptionCheckStrategy offExceptionCheckStrategy = new OffExceptionCheckStrategy(); + Assert.assertTrue(offExceptionCheckStrategy.isError(new TestHierarchyMatchException())); + } + + @Test + public void checkInheriteMatchExceptionCheckStrategy() { + HierarchyMatchExceptionCheckStrategy hierarchyMatchExceptionCheckStrategy = new HierarchyMatchExceptionCheckStrategy(); + Assert.assertFalse(hierarchyMatchExceptionCheckStrategy.isError(new TestNamedMatchException())); + Assert.assertFalse(hierarchyMatchExceptionCheckStrategy.isError(new TestHierarchyMatchException())); + Assert.assertTrue(hierarchyMatchExceptionCheckStrategy.isError(new TestAnnotationMatchException())); + } + + @Test + public void checkAnnotationMatchExceptionCheckStrategy() { + AnnotationMatchExceptionCheckStrategy annotationMatchExceptionCheckStrategy = new AnnotationMatchExceptionCheckStrategy(); + Assert.assertFalse(annotationMatchExceptionCheckStrategy.isError(new TestAnnotationMatchException())); + Assert.assertTrue(annotationMatchExceptionCheckStrategy.isError(new TestHierarchyMatchException())); + } + +} diff --git a/apm-sniffer/apm-agent-core/src/test/java/org/apache/skywalking/apm/agent/core/context/status/StatusCheckServiceCheckTest.java b/apm-sniffer/apm-agent-core/src/test/java/org/apache/skywalking/apm/agent/core/context/status/StatusCheckServiceCheckTest.java new file mode 100644 index 000000000..a1bb5a40c --- /dev/null +++ b/apm-sniffer/apm-agent-core/src/test/java/org/apache/skywalking/apm/agent/core/context/status/StatusCheckServiceCheckTest.java @@ -0,0 +1,83 @@ +/* + * 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.status; + +import java.util.Set; +import org.apache.skywalking.apm.agent.core.boot.ServiceManager; +import org.apache.skywalking.apm.agent.core.conf.Config; +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.powermock.api.support.membermodification.MemberModifier; + +public class StatusCheckServiceCheckTest { + + private Exception exception1; + private Exception exception2; + private Exception exception3; + + @Before + public void prepare() { + Config.StatusCheck.IGNORED_EXCEPTIONS = "org.apache.skywalking.apm.agent.core.context.status.TestNamedMatchException"; + Config.StatusCheck.MAX_RECURSIVE_DEPTH = 1; + ServiceManager.INSTANCE.boot(); + exception1 = new TestNamedMatchException(); + exception2 = new IllegalArgumentException(exception1); + exception3 = new IllegalArgumentException(exception2); + } + + @After + public void after() throws IllegalAccessException { + ((Set) MemberModifier + .field(ExceptionCheckContext.class, "ignoredExceptions") + .get(ExceptionCheckContext.INSTANCE)).clear(); + ((Set) MemberModifier + .field(ExceptionCheckContext.class, "errorStatusExceptions") + .get(ExceptionCheckContext.INSTANCE)).clear(); + } + + @Test + public void testDepth_1() { + Config.StatusCheck.MAX_RECURSIVE_DEPTH = 1; + StatusCheckService service = ServiceManager.INSTANCE.findService(StatusCheckService.class); + Assert.assertFalse(service.isError(exception1)); + Assert.assertTrue(service.isError(exception2)); + Assert.assertTrue(service.isError(exception3)); + } + + @Test + public void testDepth_2() { + Config.StatusCheck.MAX_RECURSIVE_DEPTH = 2; + StatusCheckService service = ServiceManager.INSTANCE.findService(StatusCheckService.class); + Assert.assertFalse(service.isError(exception1)); + Assert.assertFalse(service.isError(exception2)); + Assert.assertTrue(service.isError(exception3)); + } + + @Test + public void testDepth_3() { + Config.StatusCheck.MAX_RECURSIVE_DEPTH = 3; + StatusCheckService service = ServiceManager.INSTANCE.findService(StatusCheckService.class); + Assert.assertFalse(service.isError(exception1)); + Assert.assertFalse(service.isError(exception2)); + Assert.assertFalse(service.isError(exception3)); + } + +} diff --git a/apm-sniffer/apm-agent-core/src/test/java/org/apache/skywalking/apm/agent/core/context/status/StatusCheckerTest.java b/apm-sniffer/apm-agent-core/src/test/java/org/apache/skywalking/apm/agent/core/context/status/StatusCheckerTest.java new file mode 100644 index 000000000..dc936946b --- /dev/null +++ b/apm-sniffer/apm-agent-core/src/test/java/org/apache/skywalking/apm/agent/core/context/status/StatusCheckerTest.java @@ -0,0 +1,77 @@ +/* + * 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.status; + +import java.util.Set; +import org.apache.skywalking.apm.agent.core.boot.ServiceManager; +import org.apache.skywalking.apm.agent.core.conf.Config; +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.powermock.api.support.membermodification.MemberModifier; + +import static org.apache.skywalking.apm.agent.core.context.status.StatusChecker.HIERARCHY_MATCH; +import static org.apache.skywalking.apm.agent.core.context.status.StatusChecker.OFF; + +public class StatusCheckerTest { + + @Before + public void prepare() { + Config.StatusCheck.IGNORED_EXCEPTIONS = "org.apache.skywalking.apm.agent.core.context.status.TestNamedMatchException"; + Config.StatusCheck.MAX_RECURSIVE_DEPTH = 1; + ServiceManager.INSTANCE.boot(); + } + + @After + public void after() throws IllegalAccessException { + ((Set) MemberModifier + .field(ExceptionCheckContext.class, "ignoredExceptions") + .get(ExceptionCheckContext.INSTANCE)).clear(); + ((Set) MemberModifier + .field(ExceptionCheckContext.class, "errorStatusExceptions") + .get(ExceptionCheckContext.INSTANCE)).clear(); + } + + @Test + public void checkOffStatusChecker() { + Assert.assertTrue(OFF.checkStatus(new Throwable())); + Assert.assertTrue(OFF.checkStatus(new TestHierarchyMatchException())); + Assert.assertTrue(OFF.checkStatus(new TestNamedMatchException())); + Assert.assertTrue(OFF.checkStatus(new IllegalArgumentException())); + } + + @Test + public void checkInheritNamedAndAnnotationMatchStatusChecker() throws IllegalAccessException { + Assert.assertTrue(HIERARCHY_MATCH.checkStatus(new Throwable())); + Assert.assertTrue(HIERARCHY_MATCH.checkStatus(new IllegalArgumentException())); + Assert.assertFalse(HIERARCHY_MATCH.checkStatus(new TestNamedMatchException())); + Assert.assertFalse(HIERARCHY_MATCH.checkStatus(new TestHierarchyMatchException())); + Assert.assertFalse(HIERARCHY_MATCH.checkStatus(new TestAnnotationMatchException())); + Set ignoredExceptions = (Set) MemberModifier + .field(ExceptionCheckContext.class, "ignoredExceptions") + .get(ExceptionCheckContext.INSTANCE); + Set errorStatusExceptions = (Set) MemberModifier + .field(ExceptionCheckContext.class, "errorStatusExceptions") + .get(ExceptionCheckContext.INSTANCE); + Assert.assertTrue(ignoredExceptions.size() > 0); + Assert.assertTrue(errorStatusExceptions.size() > 0); + } + +} \ No newline at end of file diff --git a/apm-sniffer/apm-agent-core/src/test/java/org/apache/skywalking/apm/agent/core/context/status/TestAnnotationMatchException.java b/apm-sniffer/apm-agent-core/src/test/java/org/apache/skywalking/apm/agent/core/context/status/TestAnnotationMatchException.java new file mode 100644 index 000000000..904e32127 --- /dev/null +++ b/apm-sniffer/apm-agent-core/src/test/java/org/apache/skywalking/apm/agent/core/context/status/TestAnnotationMatchException.java @@ -0,0 +1,56 @@ +/* + * 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.status; + +import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance; + +public class TestAnnotationMatchException extends RuntimeException implements EnhancedInstance { + + public TestAnnotationMatchException() { + } + + public TestAnnotationMatchException(final String message) { + super(message); + } + + public TestAnnotationMatchException(final String message, final Throwable cause) { + super(message, cause); + } + + public TestAnnotationMatchException(final Throwable cause) { + super(cause); + } + + public TestAnnotationMatchException(final String message, + final Throwable cause, + final boolean enableSuppression, + final boolean writableStackTrace) { + super(message, cause, enableSuppression, writableStackTrace); + } + + @Override + public Object getSkyWalkingDynamicField() { + return AnnotationMatchExceptionCheckStrategy.class.getSimpleName(); + } + + @Override + public void setSkyWalkingDynamicField(final Object value) { + + } +} diff --git a/apm-sniffer/apm-agent-core/src/test/java/org/apache/skywalking/apm/agent/core/context/status/TestHierarchyMatchException.java b/apm-sniffer/apm-agent-core/src/test/java/org/apache/skywalking/apm/agent/core/context/status/TestHierarchyMatchException.java new file mode 100644 index 000000000..c1890386f --- /dev/null +++ b/apm-sniffer/apm-agent-core/src/test/java/org/apache/skywalking/apm/agent/core/context/status/TestHierarchyMatchException.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.status; + +public class TestHierarchyMatchException extends TestNamedMatchException { + + public TestHierarchyMatchException() { + } + + public TestHierarchyMatchException(final String message) { + super(message); + } + + public TestHierarchyMatchException(final String message, final Throwable cause) { + super(message, cause); + } + + public TestHierarchyMatchException(final Throwable cause) { + super(cause); + } + + public TestHierarchyMatchException(final String message, + final Throwable cause, + final boolean enableSuppression, + final boolean writableStackTrace) { + super(message, cause, enableSuppression, writableStackTrace); + } +} diff --git a/apm-sniffer/apm-agent-core/src/test/java/org/apache/skywalking/apm/agent/core/context/status/TestNamedMatchException.java b/apm-sniffer/apm-agent-core/src/test/java/org/apache/skywalking/apm/agent/core/context/status/TestNamedMatchException.java new file mode 100644 index 000000000..e86321da7 --- /dev/null +++ b/apm-sniffer/apm-agent-core/src/test/java/org/apache/skywalking/apm/agent/core/context/status/TestNamedMatchException.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.status; + +public class TestNamedMatchException extends RuntimeException { + + public TestNamedMatchException() { + } + + public TestNamedMatchException(final String message) { + super(message); + } + + public TestNamedMatchException(final String message, final Throwable cause) { + super(message, cause); + } + + public TestNamedMatchException(final Throwable cause) { + super(cause); + } + + public TestNamedMatchException(final String message, + final Throwable cause, + final boolean enableSuppression, + final boolean writableStackTrace) { + super(message, cause, enableSuppression, writableStackTrace); + } +} diff --git a/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/activemq/ActiveMQConsumerInterceptor.java b/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/activemq/ActiveMQConsumerInterceptor.java index 4818d0ec0..4ee916205 100644 --- a/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/activemq/ActiveMQConsumerInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/activemq/ActiveMQConsumerInterceptor.java @@ -88,6 +88,6 @@ public class ActiveMQConsumerInterceptor implements InstanceMethodsAroundInterce @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/activemq/ActiveMQProducerInterceptor.java b/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/activemq/ActiveMQProducerInterceptor.java index 73d7e8082..993d4a94b 100644 --- a/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/activemq/ActiveMQProducerInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/activemq/ActiveMQProducerInterceptor.java @@ -80,6 +80,6 @@ public class ActiveMQProducerInterceptor implements InstanceMethodsAroundInterce @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/armeria-0.84.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/armeria/Armeria084ClientInterceptor.java b/apm-sniffer/apm-sdk-plugin/armeria-0.84.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/armeria/Armeria084ClientInterceptor.java index 7df2bbbb6..25460470c 100644 --- a/apm-sniffer/apm-sdk-plugin/armeria-0.84.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/armeria/Armeria084ClientInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/armeria-0.84.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/armeria/Armeria084ClientInterceptor.java @@ -87,7 +87,7 @@ public class Armeria084ClientInterceptor implements InstanceMethodsAroundInterce public void handleMethodException(final EnhancedInstance objInst, final Method method, final Object[] allArguments, final Class[] argumentsTypes, final Throwable t) { if (ContextManager.isActive()) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } } diff --git a/apm-sniffer/apm-sdk-plugin/armeria-0.84.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/armeria/Armeria084ServerInterceptor.java b/apm-sniffer/apm-sdk-plugin/armeria-0.84.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/armeria/Armeria084ServerInterceptor.java index 5ca24e709..a796a28af 100644 --- a/apm-sniffer/apm-sdk-plugin/armeria-0.84.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/armeria/Armeria084ServerInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/armeria-0.84.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/armeria/Armeria084ServerInterceptor.java @@ -68,7 +68,7 @@ public class Armeria084ServerInterceptor implements InstanceMethodsAroundInterce public void handleMethodException(final EnhancedInstance objInst, final Method method, final Object[] allArguments, final Class[] argumentsTypes, final Throwable t) { if (ContextManager.isActive()) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } } diff --git a/apm-sniffer/apm-sdk-plugin/armeria-0.85.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/armeria/Armeria085ServerInterceptor.java b/apm-sniffer/apm-sdk-plugin/armeria-0.85.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/armeria/Armeria085ServerInterceptor.java index 6e7e48493..4f219503e 100644 --- a/apm-sniffer/apm-sdk-plugin/armeria-0.85.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/armeria/Armeria085ServerInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/armeria-0.85.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/armeria/Armeria085ServerInterceptor.java @@ -68,7 +68,7 @@ public class Armeria085ServerInterceptor implements InstanceMethodsAroundInterce public void handleMethodException(final EnhancedInstance objInst, final Method method, final Object[] allArguments, final Class[] argumentsTypes, final Throwable t) { if (ContextManager.isActive()) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } } diff --git a/apm-sniffer/apm-sdk-plugin/armeria-0.85.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/armeria/ArmeriaClientInterceptor.java b/apm-sniffer/apm-sdk-plugin/armeria-0.85.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/armeria/ArmeriaClientInterceptor.java index a62d5c71e..e39239b83 100644 --- a/apm-sniffer/apm-sdk-plugin/armeria-0.85.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/armeria/ArmeriaClientInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/armeria-0.85.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/armeria/ArmeriaClientInterceptor.java @@ -73,7 +73,7 @@ public abstract class ArmeriaClientInterceptor implements InstanceMethodsAroundI public void handleMethodException(final EnhancedInstance objInst, final Method method, final Object[] allArguments, final Class[] argumentsTypes, final Throwable t) { if (ContextManager.isActive()) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } } diff --git a/apm-sniffer/apm-sdk-plugin/avro-plugin/src/main/java/org/apache/skywalking/apm/plugin/avro/AbstractRequestInterceptor.java b/apm-sniffer/apm-sdk-plugin/avro-plugin/src/main/java/org/apache/skywalking/apm/plugin/avro/AbstractRequestInterceptor.java index 59f203625..d375c9172 100644 --- a/apm-sniffer/apm-sdk-plugin/avro-plugin/src/main/java/org/apache/skywalking/apm/plugin/avro/AbstractRequestInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/avro-plugin/src/main/java/org/apache/skywalking/apm/plugin/avro/AbstractRequestInterceptor.java @@ -64,7 +64,7 @@ public abstract class AbstractRequestInterceptor implements InstanceConstructorI public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { if (ContextManager.isActive()) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } } diff --git a/apm-sniffer/apm-sdk-plugin/avro-plugin/src/main/java/org/apache/skywalking/apm/plugin/avro/ResponderInterceptor.java b/apm-sniffer/apm-sdk-plugin/avro-plugin/src/main/java/org/apache/skywalking/apm/plugin/avro/ResponderInterceptor.java index 503ef28bc..0b3b773e9 100644 --- a/apm-sniffer/apm-sdk-plugin/avro-plugin/src/main/java/org/apache/skywalking/apm/plugin/avro/ResponderInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/avro-plugin/src/main/java/org/apache/skywalking/apm/plugin/avro/ResponderInterceptor.java @@ -56,7 +56,7 @@ public class ResponderInterceptor implements InstanceConstructorInterceptor, Ins public void handleMethodException(EnhancedInstance enhancedInstance, Method method, Object[] objects, Class[] classes, Throwable throwable) { if (ContextManager.isActive()) { - ContextManager.activeSpan().errorOccurred().log(throwable); + ContextManager.activeSpan().log(throwable); } } } diff --git a/apm-sniffer/apm-sdk-plugin/baidu-brpc-plugin/src/main/java/org/apache/skywalking/apm/plugin/baidu/brpc/ClientInterceptor.java b/apm-sniffer/apm-sdk-plugin/baidu-brpc-plugin/src/main/java/org/apache/skywalking/apm/plugin/baidu/brpc/ClientInterceptor.java index 3c53c2653..0a6fb64cf 100644 --- a/apm-sniffer/apm-sdk-plugin/baidu-brpc-plugin/src/main/java/org/apache/skywalking/apm/plugin/baidu/brpc/ClientInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/baidu-brpc-plugin/src/main/java/org/apache/skywalking/apm/plugin/baidu/brpc/ClientInterceptor.java @@ -74,7 +74,6 @@ public class ClientInterceptor implements InstanceMethodsAroundInterceptor { private void dealException(Throwable throwable) { AbstractSpan span = ContextManager.activeSpan(); - span.errorOccurred(); span.log(throwable); } diff --git a/apm-sniffer/apm-sdk-plugin/baidu-brpc-plugin/src/main/java/org/apache/skywalking/apm/plugin/baidu/brpc/ServerInterceptor.java b/apm-sniffer/apm-sdk-plugin/baidu-brpc-plugin/src/main/java/org/apache/skywalking/apm/plugin/baidu/brpc/ServerInterceptor.java index d6a204661..7f0e58970 100644 --- a/apm-sniffer/apm-sdk-plugin/baidu-brpc-plugin/src/main/java/org/apache/skywalking/apm/plugin/baidu/brpc/ServerInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/baidu-brpc-plugin/src/main/java/org/apache/skywalking/apm/plugin/baidu/brpc/ServerInterceptor.java @@ -60,7 +60,6 @@ public class ServerInterceptor implements InstanceMethodsAroundInterceptor { if (response != null && response.getException() != null) { AbstractSpan span = ContextManager.activeSpan(); span.log(response.getException()); - span.errorOccurred(); } ContextManager.stopSpan(); @@ -71,7 +70,6 @@ public class ServerInterceptor implements InstanceMethodsAroundInterceptor { public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { AbstractSpan activeSpan = ContextManager.activeSpan(); - activeSpan.errorOccurred(); activeSpan.log(t); } diff --git a/apm-sniffer/apm-sdk-plugin/canal-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/canal/CanalInterceptor.java b/apm-sniffer/apm-sdk-plugin/canal-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/canal/CanalInterceptor.java index de8173a80..fc2fed6df 100644 --- a/apm-sniffer/apm-sdk-plugin/canal-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/canal/CanalInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/canal-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/canal/CanalInterceptor.java @@ -78,6 +78,6 @@ public class CanalInterceptor implements InstanceMethodsAroundInterceptor { @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } \ No newline at end of file diff --git a/apm-sniffer/apm-sdk-plugin/cassandra-java-driver-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/cassandra/java/driver/v3/ClusterConnectInterceptor.java b/apm-sniffer/apm-sdk-plugin/cassandra-java-driver-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/cassandra/java/driver/v3/ClusterConnectInterceptor.java index 88eb6f182..1c75f6111 100644 --- a/apm-sniffer/apm-sdk-plugin/cassandra-java-driver-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/cassandra/java/driver/v3/ClusterConnectInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/cassandra-java-driver-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/cassandra/java/driver/v3/ClusterConnectInterceptor.java @@ -50,7 +50,6 @@ public class ClusterConnectInterceptor implements InstanceMethodsAroundIntercept Class[] argumentsTypes, Throwable t) { if (ContextManager.isActive()) { AbstractSpan span = ContextManager.activeSpan(); - span.errorOccurred(); span.log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/cassandra-java-driver-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/cassandra/java/driver/v3/DefaultResultSetFutureGetUninterruptiblyInterceptor.java b/apm-sniffer/apm-sdk-plugin/cassandra-java-driver-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/cassandra/java/driver/v3/DefaultResultSetFutureGetUninterruptiblyInterceptor.java index b5fdaf0a0..d453d10e0 100644 --- a/apm-sniffer/apm-sdk-plugin/cassandra-java-driver-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/cassandra/java/driver/v3/DefaultResultSetFutureGetUninterruptiblyInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/cassandra-java-driver-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/cassandra/java/driver/v3/DefaultResultSetFutureGetUninterruptiblyInterceptor.java @@ -53,7 +53,6 @@ public class DefaultResultSetFutureGetUninterruptiblyInterceptor implements Inst Class[] argumentsTypes, Throwable t) { if (ContextManager.isActive()) { AbstractSpan span = ContextManager.activeSpan(); - span.errorOccurred(); span.log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/cassandra-java-driver-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/cassandra/java/driver/v3/SessionManagerExecuteAndExecuteAsyncWithStatementArgInterceptor.java b/apm-sniffer/apm-sdk-plugin/cassandra-java-driver-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/cassandra/java/driver/v3/SessionManagerExecuteAndExecuteAsyncWithStatementArgInterceptor.java index 8af5fc44e..82a690a00 100644 --- a/apm-sniffer/apm-sdk-plugin/cassandra-java-driver-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/cassandra/java/driver/v3/SessionManagerExecuteAndExecuteAsyncWithStatementArgInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/cassandra-java-driver-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/cassandra/java/driver/v3/SessionManagerExecuteAndExecuteAsyncWithStatementArgInterceptor.java @@ -77,7 +77,6 @@ public class SessionManagerExecuteAndExecuteAsyncWithStatementArgInterceptor imp Class[] argumentsTypes, Throwable t) { if (ContextManager.isActive()) { AbstractSpan span = ContextManager.activeSpan(); - span.errorOccurred(); span.log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/dubbo-2.7.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/asf/dubbo/DubboInterceptor.java b/apm-sniffer/apm-sdk-plugin/dubbo-2.7.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/asf/dubbo/DubboInterceptor.java index 23fad057a..f032cb216 100644 --- a/apm-sniffer/apm-sdk-plugin/dubbo-2.7.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/asf/dubbo/DubboInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/dubbo-2.7.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/asf/dubbo/DubboInterceptor.java @@ -126,7 +126,6 @@ public class DubboInterceptor implements InstanceMethodsAroundInterceptor { */ private void dealException(Throwable throwable) { AbstractSpan span = ContextManager.activeSpan(); - span.errorOccurred(); span.log(throwable); } diff --git a/apm-sniffer/apm-sdk-plugin/dubbo-plugin/src/main/java/org/apache/skywalking/apm/plugin/dubbo/DubboInterceptor.java b/apm-sniffer/apm-sdk-plugin/dubbo-plugin/src/main/java/org/apache/skywalking/apm/plugin/dubbo/DubboInterceptor.java index 15480f106..8d3492b93 100644 --- a/apm-sniffer/apm-sdk-plugin/dubbo-plugin/src/main/java/org/apache/skywalking/apm/plugin/dubbo/DubboInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/dubbo-plugin/src/main/java/org/apache/skywalking/apm/plugin/dubbo/DubboInterceptor.java @@ -113,7 +113,6 @@ public class DubboInterceptor implements InstanceMethodsAroundInterceptor { */ private void dealException(Throwable throwable) { AbstractSpan span = ContextManager.activeSpan(); - span.errorOccurred(); span.log(throwable); } diff --git a/apm-sniffer/apm-sdk-plugin/ehcache-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/ehcache/v2/EhcacheLockInterceptor.java b/apm-sniffer/apm-sdk-plugin/ehcache-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/ehcache/v2/EhcacheLockInterceptor.java index ba36be7c9..c8f046da9 100644 --- a/apm-sniffer/apm-sdk-plugin/ehcache-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/ehcache/v2/EhcacheLockInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/ehcache-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/ehcache/v2/EhcacheLockInterceptor.java @@ -61,6 +61,6 @@ public class EhcacheLockInterceptor implements InstanceMethodsAroundInterceptor @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/ehcache-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/ehcache/v2/EhcacheOperateAllInterceptor.java b/apm-sniffer/apm-sdk-plugin/ehcache-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/ehcache/v2/EhcacheOperateAllInterceptor.java index 5dec441b4..066bca082 100644 --- a/apm-sniffer/apm-sdk-plugin/ehcache-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/ehcache/v2/EhcacheOperateAllInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/ehcache-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/ehcache/v2/EhcacheOperateAllInterceptor.java @@ -50,6 +50,6 @@ public class EhcacheOperateAllInterceptor implements InstanceMethodsAroundInterc @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/ehcache-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/ehcache/v2/EhcacheOperateElementInterceptor.java b/apm-sniffer/apm-sdk-plugin/ehcache-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/ehcache/v2/EhcacheOperateElementInterceptor.java index 94ff47228..46bcbdcd7 100644 --- a/apm-sniffer/apm-sdk-plugin/ehcache-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/ehcache/v2/EhcacheOperateElementInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/ehcache-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/ehcache/v2/EhcacheOperateElementInterceptor.java @@ -57,6 +57,6 @@ public class EhcacheOperateElementInterceptor implements InstanceMethodsAroundIn @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/ehcache-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/ehcache/v2/EhcacheOperateObjectInterceptor.java b/apm-sniffer/apm-sdk-plugin/ehcache-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/ehcache/v2/EhcacheOperateObjectInterceptor.java index 551ecb5ce..f94528fe1 100644 --- a/apm-sniffer/apm-sdk-plugin/ehcache-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/ehcache/v2/EhcacheOperateObjectInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/ehcache-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/ehcache/v2/EhcacheOperateObjectInterceptor.java @@ -56,6 +56,6 @@ public class EhcacheOperateObjectInterceptor implements InstanceMethodsAroundInt @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/elastic-job-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/esjob/JobExecutorInterceptor.java b/apm-sniffer/apm-sdk-plugin/elastic-job-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/esjob/JobExecutorInterceptor.java index 3a87b3777..5084ffe97 100644 --- a/apm-sniffer/apm-sdk-plugin/elastic-job-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/esjob/JobExecutorInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/elastic-job-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/esjob/JobExecutorInterceptor.java @@ -68,6 +68,6 @@ public class JobExecutorInterceptor implements InstanceMethodsAroundInterceptor @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/elastic-job-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticjob/ElasticJobExecutorInterceptor.java b/apm-sniffer/apm-sdk-plugin/elastic-job-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticjob/ElasticJobExecutorInterceptor.java index 95bbc7d1f..9c223ffb1 100644 --- a/apm-sniffer/apm-sdk-plugin/elastic-job-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticjob/ElasticJobExecutorInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/elastic-job-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticjob/ElasticJobExecutorInterceptor.java @@ -55,6 +55,6 @@ public class ElasticJobExecutorInterceptor implements InstanceMethodsAroundInter @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/elasticsearch-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v5/PlainListenableActionFutureInterceptor.java b/apm-sniffer/apm-sdk-plugin/elasticsearch-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v5/PlainListenableActionFutureInterceptor.java index 91debe8ac..1689118e1 100644 --- a/apm-sniffer/apm-sdk-plugin/elasticsearch-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v5/PlainListenableActionFutureInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/elasticsearch-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v5/PlainListenableActionFutureInterceptor.java @@ -66,6 +66,6 @@ public class PlainListenableActionFutureInterceptor implements InstanceMethodsAr @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/elasticsearch-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v5/TransportActionNodeProxyInterceptor.java b/apm-sniffer/apm-sdk-plugin/elasticsearch-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v5/TransportActionNodeProxyInterceptor.java index 9fbaa5f08..94c1dd281 100644 --- a/apm-sniffer/apm-sdk-plugin/elasticsearch-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v5/TransportActionNodeProxyInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/elasticsearch-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v5/TransportActionNodeProxyInterceptor.java @@ -71,7 +71,7 @@ public class TransportActionNodeProxyInterceptor implements InstanceConstructorI @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } @Override diff --git a/apm-sniffer/apm-sdk-plugin/elasticsearch-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v6/interceptor/AdapterActionFutureActionGetMethodsInterceptor.java b/apm-sniffer/apm-sdk-plugin/elasticsearch-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v6/interceptor/AdapterActionFutureActionGetMethodsInterceptor.java index 5ac49f270..381fb7939 100644 --- a/apm-sniffer/apm-sdk-plugin/elasticsearch-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v6/interceptor/AdapterActionFutureActionGetMethodsInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/elasticsearch-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v6/interceptor/AdapterActionFutureActionGetMethodsInterceptor.java @@ -71,7 +71,7 @@ public class AdapterActionFutureActionGetMethodsInterceptor implements InstanceM @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } private boolean isTrace(EnhancedInstance objInst) { diff --git a/apm-sniffer/apm-sdk-plugin/elasticsearch-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v6/interceptor/ClusterClientGetSettingsMethodsInterceptor.java b/apm-sniffer/apm-sdk-plugin/elasticsearch-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v6/interceptor/ClusterClientGetSettingsMethodsInterceptor.java index 41a5d59ab..544845841 100644 --- a/apm-sniffer/apm-sdk-plugin/elasticsearch-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v6/interceptor/ClusterClientGetSettingsMethodsInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/elasticsearch-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v6/interceptor/ClusterClientGetSettingsMethodsInterceptor.java @@ -18,8 +18,6 @@ package org.apache.skywalking.apm.plugin.elasticsearch.v6.interceptor; -import static org.apache.skywalking.apm.plugin.elasticsearch.v6.interceptor.Constants.DB_TYPE; - import java.lang.reflect.Method; import org.apache.skywalking.apm.agent.core.context.ContextManager; import org.apache.skywalking.apm.agent.core.context.tag.Tags; @@ -31,6 +29,8 @@ import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInt import org.apache.skywalking.apm.network.trace.component.ComponentsDefine; import org.apache.skywalking.apm.plugin.elasticsearch.v6.RestClientEnhanceInfo; +import static org.apache.skywalking.apm.plugin.elasticsearch.v6.interceptor.Constants.DB_TYPE; + public class ClusterClientGetSettingsMethodsInterceptor implements InstanceMethodsAroundInterceptor { @Override public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, @@ -62,7 +62,7 @@ public class ClusterClientGetSettingsMethodsInterceptor implements InstanceMetho Object[] allArguments, Class[] argumentsTypes, Throwable t) { RestClientEnhanceInfo restClientEnhanceInfo = (RestClientEnhanceInfo) (objInst.getSkyWalkingDynamicField()); if (restClientEnhanceInfo != null) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } } diff --git a/apm-sniffer/apm-sdk-plugin/elasticsearch-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v6/interceptor/ClusterClientHealthMethodsInterceptor.java b/apm-sniffer/apm-sdk-plugin/elasticsearch-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v6/interceptor/ClusterClientHealthMethodsInterceptor.java index fbcb72fe9..815631714 100644 --- a/apm-sniffer/apm-sdk-plugin/elasticsearch-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v6/interceptor/ClusterClientHealthMethodsInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/elasticsearch-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v6/interceptor/ClusterClientHealthMethodsInterceptor.java @@ -18,8 +18,6 @@ package org.apache.skywalking.apm.plugin.elasticsearch.v6.interceptor; -import static org.apache.skywalking.apm.plugin.elasticsearch.v6.interceptor.Constants.DB_TYPE; - import java.lang.reflect.Method; import org.apache.skywalking.apm.agent.core.context.ContextManager; import org.apache.skywalking.apm.agent.core.context.tag.Tags; @@ -31,6 +29,8 @@ import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInt import org.apache.skywalking.apm.network.trace.component.ComponentsDefine; import org.apache.skywalking.apm.plugin.elasticsearch.v6.RestClientEnhanceInfo; +import static org.apache.skywalking.apm.plugin.elasticsearch.v6.interceptor.Constants.DB_TYPE; + public class ClusterClientHealthMethodsInterceptor implements InstanceMethodsAroundInterceptor { @Override public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, @@ -61,7 +61,7 @@ public class ClusterClientHealthMethodsInterceptor implements InstanceMethodsAro Object[] allArguments, Class[] argumentsTypes, Throwable t) { RestClientEnhanceInfo restClientEnhanceInfo = (RestClientEnhanceInfo) (objInst.getSkyWalkingDynamicField()); if (restClientEnhanceInfo != null) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } } diff --git a/apm-sniffer/apm-sdk-plugin/elasticsearch-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v6/interceptor/ClusterClientPutSettingsMethodsInterceptor.java b/apm-sniffer/apm-sdk-plugin/elasticsearch-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v6/interceptor/ClusterClientPutSettingsMethodsInterceptor.java index bb4b77b9e..49de6a2a9 100644 --- a/apm-sniffer/apm-sdk-plugin/elasticsearch-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v6/interceptor/ClusterClientPutSettingsMethodsInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/elasticsearch-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v6/interceptor/ClusterClientPutSettingsMethodsInterceptor.java @@ -18,9 +18,6 @@ package org.apache.skywalking.apm.plugin.elasticsearch.v6.interceptor; -import static org.apache.skywalking.apm.plugin.elasticsearch.v6.ElasticsearchPluginConfig.Plugin.Elasticsearch.TRACE_DSL; -import static org.apache.skywalking.apm.plugin.elasticsearch.v6.interceptor.Constants.DB_TYPE; - import java.lang.reflect.Method; import org.apache.skywalking.apm.agent.core.context.ContextManager; import org.apache.skywalking.apm.agent.core.context.tag.Tags; @@ -34,6 +31,9 @@ import org.apache.skywalking.apm.plugin.elasticsearch.v6.RestClientEnhanceInfo; import org.elasticsearch.action.admin.cluster.settings.ClusterUpdateSettingsRequest; import org.elasticsearch.common.settings.Settings; +import static org.apache.skywalking.apm.plugin.elasticsearch.v6.ElasticsearchPluginConfig.Plugin.Elasticsearch.TRACE_DSL; +import static org.apache.skywalking.apm.plugin.elasticsearch.v6.interceptor.Constants.DB_TYPE; + public class ClusterClientPutSettingsMethodsInterceptor implements InstanceMethodsAroundInterceptor { @Override public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, @@ -80,7 +80,7 @@ public class ClusterClientPutSettingsMethodsInterceptor implements InstanceMetho Object[] allArguments, Class[] argumentsTypes, Throwable t) { RestClientEnhanceInfo restClientEnhanceInfo = (RestClientEnhanceInfo) (objInst.getSkyWalkingDynamicField()); if (restClientEnhanceInfo != null) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/elasticsearch-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v6/interceptor/IndicesClientCreateMethodsInterceptor.java b/apm-sniffer/apm-sdk-plugin/elasticsearch-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v6/interceptor/IndicesClientCreateMethodsInterceptor.java index 46145cf21..f3c419150 100644 --- a/apm-sniffer/apm-sdk-plugin/elasticsearch-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v6/interceptor/IndicesClientCreateMethodsInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/elasticsearch-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v6/interceptor/IndicesClientCreateMethodsInterceptor.java @@ -18,9 +18,6 @@ package org.apache.skywalking.apm.plugin.elasticsearch.v6.interceptor; -import static org.apache.skywalking.apm.plugin.elasticsearch.v6.ElasticsearchPluginConfig.Plugin.Elasticsearch.TRACE_DSL; -import static org.apache.skywalking.apm.plugin.elasticsearch.v6.interceptor.Constants.DB_TYPE; - import java.lang.reflect.Method; import org.apache.skywalking.apm.agent.core.context.ContextManager; import org.apache.skywalking.apm.agent.core.context.tag.Tags; @@ -33,6 +30,9 @@ import org.apache.skywalking.apm.network.trace.component.ComponentsDefine; import org.apache.skywalking.apm.plugin.elasticsearch.v6.RestClientEnhanceInfo; import org.elasticsearch.client.indices.CreateIndexRequest; +import static org.apache.skywalking.apm.plugin.elasticsearch.v6.ElasticsearchPluginConfig.Plugin.Elasticsearch.TRACE_DSL; +import static org.apache.skywalking.apm.plugin.elasticsearch.v6.interceptor.Constants.DB_TYPE; + public class IndicesClientCreateMethodsInterceptor implements InstanceMethodsAroundInterceptor { @Override @@ -70,7 +70,7 @@ public class IndicesClientCreateMethodsInterceptor implements InstanceMethodsAro Class[] argumentsTypes, Throwable t) { RestClientEnhanceInfo restClientEnhanceInfo = (RestClientEnhanceInfo) (objInst.getSkyWalkingDynamicField()); if (restClientEnhanceInfo != null) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } } diff --git a/apm-sniffer/apm-sdk-plugin/elasticsearch-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v6/interceptor/IndicesClientDeleteMethodsInterceptor.java b/apm-sniffer/apm-sdk-plugin/elasticsearch-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v6/interceptor/IndicesClientDeleteMethodsInterceptor.java index 6708ea661..1d2cbecd1 100644 --- a/apm-sniffer/apm-sdk-plugin/elasticsearch-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v6/interceptor/IndicesClientDeleteMethodsInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/elasticsearch-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v6/interceptor/IndicesClientDeleteMethodsInterceptor.java @@ -18,8 +18,6 @@ package org.apache.skywalking.apm.plugin.elasticsearch.v6.interceptor; -import static org.apache.skywalking.apm.plugin.elasticsearch.v6.interceptor.Constants.DB_TYPE; - import java.lang.reflect.Method; import java.util.Arrays; import org.apache.skywalking.apm.agent.core.context.ContextManager; @@ -33,6 +31,8 @@ import org.apache.skywalking.apm.network.trace.component.ComponentsDefine; import org.apache.skywalking.apm.plugin.elasticsearch.v6.RestClientEnhanceInfo; import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest; +import static org.apache.skywalking.apm.plugin.elasticsearch.v6.interceptor.Constants.DB_TYPE; + public class IndicesClientDeleteMethodsInterceptor implements InstanceMethodsAroundInterceptor { @Override @@ -66,7 +66,7 @@ public class IndicesClientDeleteMethodsInterceptor implements InstanceMethodsAro Class[] argumentsTypes, Throwable t) { RestClientEnhanceInfo restClientEnhanceInfo = (RestClientEnhanceInfo) (objInst.getSkyWalkingDynamicField()); if (restClientEnhanceInfo != null) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } } diff --git a/apm-sniffer/apm-sdk-plugin/elasticsearch-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v6/interceptor/RestHighLevelClientGetMethodsInterceptor.java b/apm-sniffer/apm-sdk-plugin/elasticsearch-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v6/interceptor/RestHighLevelClientGetMethodsInterceptor.java index b181aac66..37168887b 100644 --- a/apm-sniffer/apm-sdk-plugin/elasticsearch-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v6/interceptor/RestHighLevelClientGetMethodsInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/elasticsearch-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v6/interceptor/RestHighLevelClientGetMethodsInterceptor.java @@ -18,9 +18,6 @@ package org.apache.skywalking.apm.plugin.elasticsearch.v6.interceptor; -import static org.apache.skywalking.apm.plugin.elasticsearch.v6.ElasticsearchPluginConfig.Plugin.Elasticsearch.TRACE_DSL; -import static org.apache.skywalking.apm.plugin.elasticsearch.v6.interceptor.Constants.DB_TYPE; - import java.lang.reflect.Method; import org.apache.skywalking.apm.agent.core.context.ContextManager; import org.apache.skywalking.apm.agent.core.context.tag.Tags; @@ -33,6 +30,9 @@ import org.apache.skywalking.apm.network.trace.component.ComponentsDefine; import org.apache.skywalking.apm.plugin.elasticsearch.v6.RestClientEnhanceInfo; import org.elasticsearch.action.get.GetRequest; +import static org.apache.skywalking.apm.plugin.elasticsearch.v6.ElasticsearchPluginConfig.Plugin.Elasticsearch.TRACE_DSL; +import static org.apache.skywalking.apm.plugin.elasticsearch.v6.interceptor.Constants.DB_TYPE; + public class RestHighLevelClientGetMethodsInterceptor implements InstanceMethodsAroundInterceptor { @Override @@ -63,6 +63,6 @@ public class RestHighLevelClientGetMethodsInterceptor implements InstanceMethods @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/elasticsearch-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v6/interceptor/RestHighLevelClientIndexMethodsInterceptor.java b/apm-sniffer/apm-sdk-plugin/elasticsearch-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v6/interceptor/RestHighLevelClientIndexMethodsInterceptor.java index f7c497636..c5c536ee8 100644 --- a/apm-sniffer/apm-sdk-plugin/elasticsearch-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v6/interceptor/RestHighLevelClientIndexMethodsInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/elasticsearch-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v6/interceptor/RestHighLevelClientIndexMethodsInterceptor.java @@ -18,9 +18,6 @@ package org.apache.skywalking.apm.plugin.elasticsearch.v6.interceptor; -import static org.apache.skywalking.apm.plugin.elasticsearch.v6.ElasticsearchPluginConfig.Plugin.Elasticsearch.TRACE_DSL; -import static org.apache.skywalking.apm.plugin.elasticsearch.v6.interceptor.Constants.DB_TYPE; - import java.lang.reflect.Method; import org.apache.skywalking.apm.agent.core.context.ContextManager; import org.apache.skywalking.apm.agent.core.context.tag.Tags; @@ -33,6 +30,9 @@ import org.apache.skywalking.apm.network.trace.component.ComponentsDefine; import org.apache.skywalking.apm.plugin.elasticsearch.v6.RestClientEnhanceInfo; import org.elasticsearch.action.index.IndexRequest; +import static org.apache.skywalking.apm.plugin.elasticsearch.v6.ElasticsearchPluginConfig.Plugin.Elasticsearch.TRACE_DSL; +import static org.apache.skywalking.apm.plugin.elasticsearch.v6.interceptor.Constants.DB_TYPE; + public class RestHighLevelClientIndexMethodsInterceptor implements InstanceMethodsAroundInterceptor { @Override @@ -63,6 +63,6 @@ public class RestHighLevelClientIndexMethodsInterceptor implements InstanceMetho @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/elasticsearch-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v6/interceptor/RestHighLevelClientSearchMethodsInterceptor.java b/apm-sniffer/apm-sdk-plugin/elasticsearch-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v6/interceptor/RestHighLevelClientSearchMethodsInterceptor.java index 3439f3b19..c41b54142 100644 --- a/apm-sniffer/apm-sdk-plugin/elasticsearch-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v6/interceptor/RestHighLevelClientSearchMethodsInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/elasticsearch-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v6/interceptor/RestHighLevelClientSearchMethodsInterceptor.java @@ -18,9 +18,6 @@ package org.apache.skywalking.apm.plugin.elasticsearch.v6.interceptor; -import static org.apache.skywalking.apm.plugin.elasticsearch.v6.ElasticsearchPluginConfig.Plugin.Elasticsearch.TRACE_DSL; -import static org.apache.skywalking.apm.plugin.elasticsearch.v6.interceptor.Constants.DB_TYPE; - import java.lang.reflect.Method; import java.util.Arrays; import org.apache.skywalking.apm.agent.core.context.ContextManager; @@ -34,6 +31,9 @@ import org.apache.skywalking.apm.network.trace.component.ComponentsDefine; import org.apache.skywalking.apm.plugin.elasticsearch.v6.RestClientEnhanceInfo; import org.elasticsearch.action.search.SearchRequest; +import static org.apache.skywalking.apm.plugin.elasticsearch.v6.ElasticsearchPluginConfig.Plugin.Elasticsearch.TRACE_DSL; +import static org.apache.skywalking.apm.plugin.elasticsearch.v6.interceptor.Constants.DB_TYPE; + public class RestHighLevelClientSearchMethodsInterceptor implements InstanceMethodsAroundInterceptor { @Override @@ -64,6 +64,6 @@ public class RestHighLevelClientSearchMethodsInterceptor implements InstanceMeth @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/elasticsearch-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v6/interceptor/RestHighLevelClientUpdateMethodsInterceptor.java b/apm-sniffer/apm-sdk-plugin/elasticsearch-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v6/interceptor/RestHighLevelClientUpdateMethodsInterceptor.java index 491b5a16f..23b3f48b0 100644 --- a/apm-sniffer/apm-sdk-plugin/elasticsearch-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v6/interceptor/RestHighLevelClientUpdateMethodsInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/elasticsearch-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v6/interceptor/RestHighLevelClientUpdateMethodsInterceptor.java @@ -18,9 +18,6 @@ package org.apache.skywalking.apm.plugin.elasticsearch.v6.interceptor; -import static org.apache.skywalking.apm.plugin.elasticsearch.v6.ElasticsearchPluginConfig.Plugin.Elasticsearch.TRACE_DSL; -import static org.apache.skywalking.apm.plugin.elasticsearch.v6.interceptor.Constants.DB_TYPE; - import java.lang.reflect.Method; import org.apache.skywalking.apm.agent.core.context.ContextManager; import org.apache.skywalking.apm.agent.core.context.tag.Tags; @@ -33,6 +30,9 @@ import org.apache.skywalking.apm.network.trace.component.ComponentsDefine; import org.apache.skywalking.apm.plugin.elasticsearch.v6.RestClientEnhanceInfo; import org.elasticsearch.action.update.UpdateRequest; +import static org.apache.skywalking.apm.plugin.elasticsearch.v6.ElasticsearchPluginConfig.Plugin.Elasticsearch.TRACE_DSL; +import static org.apache.skywalking.apm.plugin.elasticsearch.v6.interceptor.Constants.DB_TYPE; + public class RestHighLevelClientUpdateMethodsInterceptor implements InstanceMethodsAroundInterceptor { @Override @@ -63,6 +63,6 @@ public class RestHighLevelClientUpdateMethodsInterceptor implements InstanceMeth @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/elasticsearch-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v6/interceptor/TransportActionNodeProxyExecuteMethodsInterceptor.java b/apm-sniffer/apm-sdk-plugin/elasticsearch-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v6/interceptor/TransportActionNodeProxyExecuteMethodsInterceptor.java index ad0f25219..5e926513c 100644 --- a/apm-sniffer/apm-sdk-plugin/elasticsearch-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v6/interceptor/TransportActionNodeProxyExecuteMethodsInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/elasticsearch-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v6/interceptor/TransportActionNodeProxyExecuteMethodsInterceptor.java @@ -71,7 +71,7 @@ public class TransportActionNodeProxyExecuteMethodsInterceptor implements Instan @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } @Override 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 6bd87acf8..81b4d3bcd 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 @@ -165,6 +165,5 @@ public class DefaultHttpClientInterceptor implements InstanceMethodsAroundInterc Class[] argumentsTypes, Throwable t) { AbstractSpan activeSpan = ContextManager.activeSpan(); activeSpan.log(t); - activeSpan.errorOccurred(); } } diff --git a/apm-sniffer/apm-sdk-plugin/finagle-6.25.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/finagle/ClientDestTracingFilterInterceptor.java b/apm-sniffer/apm-sdk-plugin/finagle-6.25.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/finagle/ClientDestTracingFilterInterceptor.java index 78c069290..a343343ef 100644 --- a/apm-sniffer/apm-sdk-plugin/finagle-6.25.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/finagle/ClientDestTracingFilterInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/finagle-6.25.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/finagle/ClientDestTracingFilterInterceptor.java @@ -63,7 +63,7 @@ public class ClientDestTracingFilterInterceptor extends AbstractInterceptor { * there is an active span */ if (ContextManager.isActive()) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/finagle-6.25.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/finagle/ClientTracingFilterInterceptor.java b/apm-sniffer/apm-sdk-plugin/finagle-6.25.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/finagle/ClientTracingFilterInterceptor.java index b15ae66c7..00b5c9333 100644 --- a/apm-sniffer/apm-sdk-plugin/finagle-6.25.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/finagle/ClientTracingFilterInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/finagle-6.25.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/finagle/ClientTracingFilterInterceptor.java @@ -83,7 +83,6 @@ public class ClientTracingFilterInterceptor extends AbstractInterceptor { @Override public void onFailure(Throwable cause) { - finagleSpan.errorOccurred(); finagleSpan.log(cause); finagleSpan.asyncFinish(); } @@ -94,6 +93,6 @@ public class ClientTracingFilterInterceptor extends AbstractInterceptor { @Override public void handleMethodExceptionImpl(EnhancedInstance enhancedInstance, Method method, Object[] objects, Class[] classes, Throwable throwable) { - ContextManager.activeSpan().errorOccurred().log(throwable); + ContextManager.activeSpan().log(throwable); } } diff --git a/apm-sniffer/apm-sdk-plugin/finagle-6.25.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/finagle/ServerTracingFilterInterceptor.java b/apm-sniffer/apm-sdk-plugin/finagle-6.25.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/finagle/ServerTracingFilterInterceptor.java index c5d62e37f..45e12b602 100644 --- a/apm-sniffer/apm-sdk-plugin/finagle-6.25.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/finagle/ServerTracingFilterInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/finagle-6.25.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/finagle/ServerTracingFilterInterceptor.java @@ -78,7 +78,6 @@ public class ServerTracingFilterInterceptor extends AbstractInterceptor { @Override public void onFailure(Throwable cause) { - finagleSpan.errorOccurred(); finagleSpan.log(cause); finagleSpan.asyncFinish(); } @@ -90,6 +89,6 @@ public class ServerTracingFilterInterceptor extends AbstractInterceptor { @Override public void handleMethodExceptionImpl(EnhancedInstance enhancedInstance, Method method, Object[] objects, Class[] classes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/graphql-plugin/graphql-12.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/graphql/v12/GraphqlInterceptor.java b/apm-sniffer/apm-sdk-plugin/graphql-plugin/graphql-12.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/graphql/v12/GraphqlInterceptor.java index 219db910e..013aa5dfb 100644 --- a/apm-sniffer/apm-sdk-plugin/graphql-plugin/graphql-12.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/graphql/v12/GraphqlInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/graphql-plugin/graphql-12.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/graphql/v12/GraphqlInterceptor.java @@ -64,7 +64,6 @@ public class GraphqlInterceptor implements InstanceMethodsAroundInterceptor { private void dealException(Throwable throwable) { AbstractSpan span = ContextManager.activeSpan(); - span.errorOccurred(); span.log(throwable); } } diff --git a/apm-sniffer/apm-sdk-plugin/graphql-plugin/graphql-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/graphql/v8/GraphqlInterceptor.java b/apm-sniffer/apm-sdk-plugin/graphql-plugin/graphql-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/graphql/v8/GraphqlInterceptor.java index 3a7607918..b6c9ea203 100644 --- a/apm-sniffer/apm-sdk-plugin/graphql-plugin/graphql-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/graphql/v8/GraphqlInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/graphql-plugin/graphql-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/graphql/v8/GraphqlInterceptor.java @@ -95,7 +95,6 @@ public class GraphqlInterceptor implements InstanceMethodsAroundInterceptor { private void dealException(Throwable throwable) { AbstractSpan span = ContextManager.activeSpan(); - span.errorOccurred(); span.log(throwable); } } diff --git a/apm-sniffer/apm-sdk-plugin/graphql-plugin/graphql-9.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/graphql/v9/GraphqlInterceptor.java b/apm-sniffer/apm-sdk-plugin/graphql-plugin/graphql-9.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/graphql/v9/GraphqlInterceptor.java index 5a6ce5f40..7ddca7504 100644 --- a/apm-sniffer/apm-sdk-plugin/graphql-plugin/graphql-9.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/graphql/v9/GraphqlInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/graphql-plugin/graphql-9.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/graphql/v9/GraphqlInterceptor.java @@ -64,7 +64,6 @@ public class GraphqlInterceptor implements InstanceMethodsAroundInterceptor { private void dealException(Throwable throwable) { AbstractSpan span = ContextManager.activeSpan(); - span.errorOccurred(); span.log(throwable); } } diff --git a/apm-sniffer/apm-sdk-plugin/grpc-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/grpc/v1/client/BlockingCallInterceptor.java b/apm-sniffer/apm-sdk-plugin/grpc-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/grpc/v1/client/BlockingCallInterceptor.java index a55d9f33a..67607de0a 100644 --- a/apm-sniffer/apm-sdk-plugin/grpc-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/grpc/v1/client/BlockingCallInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/grpc-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/grpc/v1/client/BlockingCallInterceptor.java @@ -55,6 +55,6 @@ public class BlockingCallInterceptor implements StaticMethodsAroundInterceptor { @Override public void handleMethodException(Class clazz, Method method, Object[] allArguments, Class[] parameterTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } 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 908a58514..fc3a58534 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 @@ -93,7 +93,7 @@ class TracingClientCall extends ForwardingClientCall.SimpleFo try { delegate().start(new TracingClientCallListener(responseListener, snapshot), headers); } catch (Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); throw t; } finally { if (blockingSpan == null) { @@ -117,7 +117,7 @@ class TracingClientCall extends ForwardingClientCall.SimpleFo try { super.sendMessage(message); } catch (Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); throw t; } finally { ContextManager.stopSpan(); @@ -134,7 +134,7 @@ class TracingClientCall extends ForwardingClientCall.SimpleFo try { super.halfClose(); } catch (Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); throw t; } finally { ContextManager.stopSpan(); @@ -155,7 +155,7 @@ class TracingClientCall extends ForwardingClientCall.SimpleFo try { super.cancel(message, cause); } catch (Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); throw t; } finally { ContextManager.stopSpan(); @@ -185,7 +185,7 @@ class TracingClientCall extends ForwardingClientCall.SimpleFo try { delegate().onMessage(message); } catch (Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } finally { ContextManager.stopSpan(); } @@ -198,14 +198,14 @@ class TracingClientCall extends ForwardingClientCall.SimpleFo span.setLayer(SpanLayer.RPC_FRAMEWORK); ContextManager.continued(contextSnapshot); if (!status.isOk()) { - span.errorOccurred().log(status.asRuntimeException()); + span.log(status.asRuntimeException()); Tags.STATUS_CODE.set(span, status.getCode().name()); } try { delegate().onClose(status, trailers); } catch (Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } finally { ContextManager.stopSpan(); } 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 946705cdf..195535eca 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 @@ -57,7 +57,7 @@ public class TracingServerCall extends ForwardingServerCall.S try { super.sendMessage(message); } catch (Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); throw t; } finally { ContextManager.stopSpan(); @@ -82,9 +82,9 @@ public class TracingServerCall extends ForwardingServerCall.S case UNKNOWN: case INTERNAL: if (status.getCause() == null) { - span.errorOccurred().log(status.asRuntimeException()); + span.log(status.asRuntimeException()); } else { - span.errorOccurred().log(status.getCause()); + span.log(status.getCause()); } break; // Other status code means some predictable error occurred in server. @@ -93,7 +93,7 @@ public class TracingServerCall extends ForwardingServerCall.S default: // But if the status still has cause exception, we will log it too. if (status.getCause() != null) { - span.errorOccurred().log(status.getCause()); + span.log(status.getCause()); } break; } @@ -102,7 +102,7 @@ public class TracingServerCall extends ForwardingServerCall.S try { super.close(status, trailers); } catch (Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); throw t; } finally { ContextManager.stopSpan(); diff --git a/apm-sniffer/apm-sdk-plugin/grpc-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/grpc/v1/server/TracingServerCallListener.java b/apm-sniffer/apm-sdk-plugin/grpc-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/grpc/v1/server/TracingServerCallListener.java index 114b776bf..231bdd4cf 100644 --- a/apm-sniffer/apm-sdk-plugin/grpc-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/grpc/v1/server/TracingServerCallListener.java +++ b/apm-sniffer/apm-sdk-plugin/grpc-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/grpc/v1/server/TracingServerCallListener.java @@ -58,7 +58,7 @@ public class TracingServerCallListener extends ForwardingServerCallList try { super.onMessage(message); } catch (Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); throw t; } finally { ContextManager.stopSpan(); @@ -78,7 +78,7 @@ public class TracingServerCallListener extends ForwardingServerCallList try { super.onCancel(); } catch (Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); throw t; } finally { ContextManager.stopSpan(); @@ -95,7 +95,7 @@ public class TracingServerCallListener extends ForwardingServerCallList try { super.onHalfClose(); } catch (Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); throw t; } finally { ContextManager.stopSpan(); diff --git a/apm-sniffer/apm-sdk-plugin/hbase-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/hbase/HTableInterceptor.java b/apm-sniffer/apm-sdk-plugin/hbase-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/hbase/HTableInterceptor.java index 363caa410..cf3fdbe1b 100644 --- a/apm-sniffer/apm-sdk-plugin/hbase-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/hbase/HTableInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/hbase-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/hbase/HTableInterceptor.java @@ -102,7 +102,6 @@ public class HTableInterceptor implements InstanceMethodsAroundInterceptor, Inst public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { AbstractSpan span = ContextManager.activeSpan(); - span.errorOccurred(); span.log(t); } 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 a30781737..d84f86266 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 @@ -96,7 +96,6 @@ public class HttpClientExecuteInterceptor implements InstanceMethodsAroundInterc public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { AbstractSpan activeSpan = ContextManager.activeSpan(); - activeSpan.errorOccurred(); activeSpan.log(t); } diff --git a/apm-sniffer/apm-sdk-plugin/httpasyncclient-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/httpasyncclient/v4/wrapper/FutureCallbackWrapper.java b/apm-sniffer/apm-sdk-plugin/httpasyncclient-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/httpasyncclient/v4/wrapper/FutureCallbackWrapper.java index 597980d8f..28f4eccb8 100644 --- a/apm-sniffer/apm-sdk-plugin/httpasyncclient-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/httpasyncclient/v4/wrapper/FutureCallbackWrapper.java +++ b/apm-sniffer/apm-sdk-plugin/httpasyncclient-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/httpasyncclient/v4/wrapper/FutureCallbackWrapper.java @@ -49,7 +49,7 @@ public class FutureCallbackWrapper implements FutureCallback { public void failed(Exception e) { CONTEXT_LOCAL.remove(); if (ContextManager.isActive()) { - ContextManager.activeSpan().errorOccurred().log(e); + ContextManager.activeSpan().log(e); ContextManager.stopSpan(); } if (callback != null) { 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 c957b261e..4cbe2f6a1 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 @@ -70,7 +70,7 @@ public class HttpAsyncResponseConsumerWrapper implements HttpAsyncResponseCon public void failed(Exception ex) { CONTEXT_LOCAL.remove(); if (ContextManager.isActive()) { - ContextManager.activeSpan().errorOccurred().log(ex); + ContextManager.activeSpan().log(ex); ContextManager.stopSpan(); } consumer.failed(ex); 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 1144dd37a..a2a4312ef 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 @@ -89,7 +89,7 @@ public class HttpClientExecuteInterceptor implements InstanceMethodsAroundInterc @Override public void handleMethodException(final EnhancedInstance objInst, final Method method, final Object[] allArguments, final Class[] argumentsTypes, final Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } private String getRequestURI(URI uri) throws URIException { diff --git a/apm-sniffer/apm-sdk-plugin/hystrix-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/hystrix/v1/HystrixCommandGetFallbackInterceptor.java b/apm-sniffer/apm-sdk-plugin/hystrix-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/hystrix/v1/HystrixCommandGetFallbackInterceptor.java index 7225f2a70..f2717b987 100644 --- a/apm-sniffer/apm-sdk-plugin/hystrix-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/hystrix/v1/HystrixCommandGetFallbackInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/hystrix-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/hystrix/v1/HystrixCommandGetFallbackInterceptor.java @@ -51,6 +51,6 @@ public class HystrixCommandGetFallbackInterceptor implements InstanceMethodsArou @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/hystrix-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/hystrix/v1/HystrixCommandRunInterceptor.java b/apm-sniffer/apm-sdk-plugin/hystrix-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/hystrix/v1/HystrixCommandRunInterceptor.java index 2c5f32422..978d34cf9 100644 --- a/apm-sniffer/apm-sdk-plugin/hystrix-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/hystrix/v1/HystrixCommandRunInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/hystrix-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/hystrix/v1/HystrixCommandRunInterceptor.java @@ -55,6 +55,6 @@ public class HystrixCommandRunInterceptor implements InstanceMethodsAroundInterc @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/influxdb-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/influxdb/interceptor/InfluxDBMethodInterceptor.java b/apm-sniffer/apm-sdk-plugin/influxdb-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/influxdb/interceptor/InfluxDBMethodInterceptor.java index 4cd35cea7..6d12f9faf 100644 --- a/apm-sniffer/apm-sdk-plugin/influxdb-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/influxdb/interceptor/InfluxDBMethodInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/influxdb-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/influxdb/interceptor/InfluxDBMethodInterceptor.java @@ -92,6 +92,6 @@ public class InfluxDBMethodInterceptor implements InstanceMethodsAroundIntercept @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/jdbc-commons/src/main/java/org/apache/skywalking/apm/plugin/jdbc/ConnectionServiceMethodInterceptor.java b/apm-sniffer/apm-sdk-plugin/jdbc-commons/src/main/java/org/apache/skywalking/apm/plugin/jdbc/ConnectionServiceMethodInterceptor.java index d5b93ccf0..3c5984e3c 100644 --- a/apm-sniffer/apm-sdk-plugin/jdbc-commons/src/main/java/org/apache/skywalking/apm/plugin/jdbc/ConnectionServiceMethodInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/jdbc-commons/src/main/java/org/apache/skywalking/apm/plugin/jdbc/ConnectionServiceMethodInterceptor.java @@ -62,7 +62,7 @@ public class ConnectionServiceMethodInterceptor implements InstanceMethodsAround @Override public final void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/jdbc-commons/src/main/java/org/apache/skywalking/apm/plugin/jdbc/trace/CallableStatementTracing.java b/apm-sniffer/apm-sdk-plugin/jdbc-commons/src/main/java/org/apache/skywalking/apm/plugin/jdbc/trace/CallableStatementTracing.java index fc68f7d24..3aabf95c4 100644 --- a/apm-sniffer/apm-sdk-plugin/jdbc-commons/src/main/java/org/apache/skywalking/apm/plugin/jdbc/trace/CallableStatementTracing.java +++ b/apm-sniffer/apm-sdk-plugin/jdbc-commons/src/main/java/org/apache/skywalking/apm/plugin/jdbc/trace/CallableStatementTracing.java @@ -42,7 +42,6 @@ public class CallableStatementTracing { span.setComponent(connectInfo.getComponent()); return exec.exe(realStatement, sql); } catch (SQLException e) { - span.errorOccurred(); span.log(e); throw e; } finally { diff --git a/apm-sniffer/apm-sdk-plugin/jdbc-commons/src/main/java/org/apache/skywalking/apm/plugin/jdbc/trace/PreparedStatementTracing.java b/apm-sniffer/apm-sdk-plugin/jdbc-commons/src/main/java/org/apache/skywalking/apm/plugin/jdbc/trace/PreparedStatementTracing.java index 51bdf7ceb..f9a144e0b 100644 --- a/apm-sniffer/apm-sdk-plugin/jdbc-commons/src/main/java/org/apache/skywalking/apm/plugin/jdbc/trace/PreparedStatementTracing.java +++ b/apm-sniffer/apm-sdk-plugin/jdbc-commons/src/main/java/org/apache/skywalking/apm/plugin/jdbc/trace/PreparedStatementTracing.java @@ -43,7 +43,6 @@ public class PreparedStatementTracing { SpanLayer.asDB(span); return exec.exe(realStatement, sql); } catch (SQLException e) { - span.errorOccurred(); span.log(e); throw e; } finally { diff --git a/apm-sniffer/apm-sdk-plugin/jdbc-commons/src/main/java/org/apache/skywalking/apm/plugin/jdbc/trace/StatementTracing.java b/apm-sniffer/apm-sdk-plugin/jdbc-commons/src/main/java/org/apache/skywalking/apm/plugin/jdbc/trace/StatementTracing.java index e0ca48fd7..c750e2484 100644 --- a/apm-sniffer/apm-sdk-plugin/jdbc-commons/src/main/java/org/apache/skywalking/apm/plugin/jdbc/trace/StatementTracing.java +++ b/apm-sniffer/apm-sdk-plugin/jdbc-commons/src/main/java/org/apache/skywalking/apm/plugin/jdbc/trace/StatementTracing.java @@ -42,7 +42,6 @@ public class StatementTracing { return exec.exe(realStatement, sql); } catch (SQLException e) { AbstractSpan span = ContextManager.activeSpan(); - span.errorOccurred(); span.log(e); throw e; } finally { diff --git a/apm-sniffer/apm-sdk-plugin/jdbc-commons/src/test/java/org/apache/skywalking/apm/plugin/jdbc/ConnectionTracing.java b/apm-sniffer/apm-sdk-plugin/jdbc-commons/src/test/java/org/apache/skywalking/apm/plugin/jdbc/ConnectionTracing.java index bac9888c8..a8d591d3f 100755 --- a/apm-sniffer/apm-sdk-plugin/jdbc-commons/src/test/java/org/apache/skywalking/apm/plugin/jdbc/ConnectionTracing.java +++ b/apm-sniffer/apm-sdk-plugin/jdbc-commons/src/test/java/org/apache/skywalking/apm/plugin/jdbc/ConnectionTracing.java @@ -39,7 +39,6 @@ public class ConnectionTracing { SpanLayer.asDB(span); return exec.exe(realConnection, sql); } catch (SQLException e) { - span.errorOccurred(); span.log(e); throw e; } finally { diff --git a/apm-sniffer/apm-sdk-plugin/jedis-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jedis/v2/JedisMethodInterceptor.java b/apm-sniffer/apm-sdk-plugin/jedis-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jedis/v2/JedisMethodInterceptor.java index 6152127bf..88381fbd0 100644 --- a/apm-sniffer/apm-sdk-plugin/jedis-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jedis/v2/JedisMethodInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/jedis-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jedis/v2/JedisMethodInterceptor.java @@ -58,7 +58,6 @@ public class JedisMethodInterceptor implements InstanceMethodsAroundInterceptor public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { AbstractSpan span = ContextManager.activeSpan(); - span.errorOccurred(); span.log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/jetty-plugin/jetty-client-9.0-plugin/src/main/java/org/apache/skywalking/apm/plugin/jetty/v90/client/SyncHttpRequestSendInterceptor.java b/apm-sniffer/apm-sdk-plugin/jetty-plugin/jetty-client-9.0-plugin/src/main/java/org/apache/skywalking/apm/plugin/jetty/v90/client/SyncHttpRequestSendInterceptor.java index 049e13262..59c6eb28f 100644 --- a/apm-sniffer/apm-sdk-plugin/jetty-plugin/jetty-client-9.0-plugin/src/main/java/org/apache/skywalking/apm/plugin/jetty/v90/client/SyncHttpRequestSendInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/jetty-plugin/jetty-client-9.0-plugin/src/main/java/org/apache/skywalking/apm/plugin/jetty/v90/client/SyncHttpRequestSendInterceptor.java @@ -67,7 +67,7 @@ public class SyncHttpRequestSendInterceptor implements InstanceMethodsAroundInte @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } public String getHttpMethod(HttpRequest request) { diff --git a/apm-sniffer/apm-sdk-plugin/jetty-plugin/jetty-client-9.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jetty/v9/client/SyncHttpRequestSendInterceptor.java b/apm-sniffer/apm-sdk-plugin/jetty-plugin/jetty-client-9.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jetty/v9/client/SyncHttpRequestSendInterceptor.java index 0e0f86a63..c58f90c3f 100644 --- a/apm-sniffer/apm-sdk-plugin/jetty-plugin/jetty-client-9.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jetty/v9/client/SyncHttpRequestSendInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/jetty-plugin/jetty-client-9.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jetty/v9/client/SyncHttpRequestSendInterceptor.java @@ -66,7 +66,7 @@ public class SyncHttpRequestSendInterceptor implements InstanceMethodsAroundInte @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } public String getHttpMethod(HttpRequest request) { 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 cc5d2c054..d872fdc6f 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 @@ -83,6 +83,6 @@ public class HandleInterceptor implements InstanceMethodsAroundInterceptor { @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/kafka-commons/src/main/java/org/apache/skywalking/apm/plugin/kafka/define/InterceptorMethod.java b/apm-sniffer/apm-sdk-plugin/kafka-commons/src/main/java/org/apache/skywalking/apm/plugin/kafka/define/InterceptorMethod.java index a5d019a5f..e9805d43b 100644 --- a/apm-sniffer/apm-sdk-plugin/kafka-commons/src/main/java/org/apache/skywalking/apm/plugin/kafka/define/InterceptorMethod.java +++ b/apm-sniffer/apm-sdk-plugin/kafka-commons/src/main/java/org/apache/skywalking/apm/plugin/kafka/define/InterceptorMethod.java @@ -42,7 +42,7 @@ public class InterceptorMethod { public static void handleMethodException(Throwable t) { KafkaContext context = (KafkaContext) ContextManager.getRuntimeContext().get(Constants.KAFKA_FLAG); if (context != null && context.isNeedStop()) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } } diff --git a/apm-sniffer/apm-sdk-plugin/kafka-plugin/src/main/java/org/apache/skywalking/apm/plugin/kafka/CallbackAdapterInterceptor.java b/apm-sniffer/apm-sdk-plugin/kafka-plugin/src/main/java/org/apache/skywalking/apm/plugin/kafka/CallbackAdapterInterceptor.java index df3d4abfd..1717e12e3 100644 --- a/apm-sniffer/apm-sdk-plugin/kafka-plugin/src/main/java/org/apache/skywalking/apm/plugin/kafka/CallbackAdapterInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/kafka-plugin/src/main/java/org/apache/skywalking/apm/plugin/kafka/CallbackAdapterInterceptor.java @@ -55,11 +55,11 @@ public class CallbackAdapterInterceptor implements Callback { try { callbackCache.getCallback().onCompletion(metadata, exception); } catch (Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); throw t; } finally { if (exception != null) { - ContextManager.activeSpan().errorOccurred().log(exception); + ContextManager.activeSpan().log(exception); } ContextManager.stopSpan(); } diff --git a/apm-sniffer/apm-sdk-plugin/kafka-plugin/src/main/java/org/apache/skywalking/apm/plugin/kafka/CallbackInterceptor.java b/apm-sniffer/apm-sdk-plugin/kafka-plugin/src/main/java/org/apache/skywalking/apm/plugin/kafka/CallbackInterceptor.java index 8cba7644f..888c330a6 100644 --- a/apm-sniffer/apm-sdk-plugin/kafka-plugin/src/main/java/org/apache/skywalking/apm/plugin/kafka/CallbackInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/kafka-plugin/src/main/java/org/apache/skywalking/apm/plugin/kafka/CallbackInterceptor.java @@ -63,7 +63,7 @@ public class CallbackInterceptor implements InstanceMethodsAroundInterceptor { if (null != snapshot) { Exception exceptions = (Exception) allArguments[1]; if (exceptions != null) { - ContextManager.activeSpan().errorOccurred().log(exceptions); + ContextManager.activeSpan().log(exceptions); } ContextManager.stopSpan(); } @@ -74,7 +74,7 @@ public class CallbackInterceptor implements InstanceMethodsAroundInterceptor { @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } private ContextSnapshot getSnapshot(CallbackCache cache) { diff --git a/apm-sniffer/apm-sdk-plugin/kafka-plugin/src/main/java/org/apache/skywalking/apm/plugin/kafka/KafkaConsumerInterceptor.java b/apm-sniffer/apm-sdk-plugin/kafka-plugin/src/main/java/org/apache/skywalking/apm/plugin/kafka/KafkaConsumerInterceptor.java index aa849d027..4c70c0061 100644 --- a/apm-sniffer/apm-sdk-plugin/kafka-plugin/src/main/java/org/apache/skywalking/apm/plugin/kafka/KafkaConsumerInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/kafka-plugin/src/main/java/org/apache/skywalking/apm/plugin/kafka/KafkaConsumerInterceptor.java @@ -107,7 +107,7 @@ public class KafkaConsumerInterceptor implements InstanceMethodsAroundIntercepto * {@link #afterMethod}, before the creation of entry span, we can not ensure there is an active span */ if (ContextManager.isActive()) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } } diff --git a/apm-sniffer/apm-sdk-plugin/kafka-plugin/src/main/java/org/apache/skywalking/apm/plugin/kafka/SubscribeMethodInterceptor.java b/apm-sniffer/apm-sdk-plugin/kafka-plugin/src/main/java/org/apache/skywalking/apm/plugin/kafka/SubscribeMethodInterceptor.java index 039509c4c..1bb3461b9 100644 --- a/apm-sniffer/apm-sdk-plugin/kafka-plugin/src/main/java/org/apache/skywalking/apm/plugin/kafka/SubscribeMethodInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/kafka-plugin/src/main/java/org/apache/skywalking/apm/plugin/kafka/SubscribeMethodInterceptor.java @@ -52,6 +52,6 @@ public class SubscribeMethodInterceptor implements InstanceMethodsAroundIntercep @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/lettuce-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/lettuce/v5/AsyncCommandMethodInterceptor.java b/apm-sniffer/apm-sdk-plugin/lettuce-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/lettuce/v5/AsyncCommandMethodInterceptor.java index 951ec85d1..8bae48ad2 100644 --- a/apm-sniffer/apm-sdk-plugin/lettuce-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/lettuce/v5/AsyncCommandMethodInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/lettuce-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/lettuce/v5/AsyncCommandMethodInterceptor.java @@ -61,6 +61,6 @@ public class AsyncCommandMethodInterceptor implements InstanceMethodsAroundInter @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/lettuce-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/lettuce/v5/RedisChannelWriterInterceptor.java b/apm-sniffer/apm-sdk-plugin/lettuce-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/lettuce/v5/RedisChannelWriterInterceptor.java index 46215bd4b..0037c563e 100644 --- a/apm-sniffer/apm-sdk-plugin/lettuce-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/lettuce/v5/RedisChannelWriterInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/lettuce-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/lettuce/v5/RedisChannelWriterInterceptor.java @@ -73,7 +73,6 @@ public class RedisChannelWriterInterceptor implements InstanceMethodsAroundInter public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { AbstractSpan span = ContextManager.activeSpan(); - span.errorOccurred(); span.log(t); } diff --git a/apm-sniffer/apm-sdk-plugin/lettuce-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/lettuce/v5/SWBiConsumer.java b/apm-sniffer/apm-sdk-plugin/lettuce-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/lettuce/v5/SWBiConsumer.java index 680c3b13f..26aacbd94 100644 --- a/apm-sniffer/apm-sdk-plugin/lettuce-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/lettuce/v5/SWBiConsumer.java +++ b/apm-sniffer/apm-sdk-plugin/lettuce-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/lettuce/v5/SWBiConsumer.java @@ -49,7 +49,7 @@ public class SWBiConsumer implements BiConsumer { ContextManager.continued(snapshot); biConsumer.accept(t, u); } catch (Throwable th) { - ContextManager.activeSpan().errorOccurred().log(th); + ContextManager.activeSpan().log(th); } finally { ContextManager.stopSpan(); } diff --git a/apm-sniffer/apm-sdk-plugin/lettuce-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/lettuce/v5/SWConsumer.java b/apm-sniffer/apm-sdk-plugin/lettuce-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/lettuce/v5/SWConsumer.java index 5a3392cfd..4454f1dab 100644 --- a/apm-sniffer/apm-sdk-plugin/lettuce-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/lettuce/v5/SWConsumer.java +++ b/apm-sniffer/apm-sdk-plugin/lettuce-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/lettuce/v5/SWConsumer.java @@ -49,7 +49,7 @@ public class SWConsumer implements Consumer { ContextManager.continued(snapshot); consumer.accept(t); } catch (Throwable th) { - ContextManager.activeSpan().errorOccurred().log(th); + ContextManager.activeSpan().log(th); } finally { 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 8cd7a4650..09a035cf3 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 @@ -117,7 +117,7 @@ public class HandleRequestInterceptor implements InstanceMethodsAroundIntercepto @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } private boolean isBusinessHandler(EnhancedInstance objInst) { diff --git a/apm-sniffer/apm-sdk-plugin/mariadb-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/mariadb/v2/PreparedStatementExecuteMethodsInterceptor.java b/apm-sniffer/apm-sdk-plugin/mariadb-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/mariadb/v2/PreparedStatementExecuteMethodsInterceptor.java index 9d7c219c9..195dca04f 100644 --- a/apm-sniffer/apm-sdk-plugin/mariadb-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/mariadb/v2/PreparedStatementExecuteMethodsInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/mariadb-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/mariadb/v2/PreparedStatementExecuteMethodsInterceptor.java @@ -76,7 +76,7 @@ public class PreparedStatementExecuteMethodsInterceptor implements InstanceMetho Class[] argumentsTypes, Throwable t) { StatementEnhanceInfos cacheObject = (StatementEnhanceInfos) objInst.getSkyWalkingDynamicField(); if (cacheObject.getConnectionInfo() != null) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/mariadb-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/mariadb/v2/StatementExecuteMethodsInterceptor.java b/apm-sniffer/apm-sdk-plugin/mariadb-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/mariadb/v2/StatementExecuteMethodsInterceptor.java index 8f636ce82..87d55dd10 100644 --- a/apm-sniffer/apm-sdk-plugin/mariadb-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/mariadb/v2/StatementExecuteMethodsInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/mariadb-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/mariadb/v2/StatementExecuteMethodsInterceptor.java @@ -63,7 +63,7 @@ public class StatementExecuteMethodsInterceptor implements InstanceMethodsAround Class[] argumentsTypes, Throwable t) { StatementEnhanceInfos cacheObject = (StatementEnhanceInfos) objInst.getSkyWalkingDynamicField(); if (cacheObject.getConnectionInfo() != null) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/mongodb-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/mongodb/v2/MongoDBCollectionMethodInterceptor.java b/apm-sniffer/apm-sdk-plugin/mongodb-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/mongodb/v2/MongoDBCollectionMethodInterceptor.java index a13a43f1c..3cf99880f 100644 --- a/apm-sniffer/apm-sdk-plugin/mongodb-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/mongodb/v2/MongoDBCollectionMethodInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/mongodb-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/mongodb/v2/MongoDBCollectionMethodInterceptor.java @@ -78,7 +78,6 @@ public class MongoDBCollectionMethodInterceptor implements InstanceMethodsAround public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { AbstractSpan activeSpan = ContextManager.activeSpan(); - activeSpan.errorOccurred(); activeSpan.log(t); } diff --git a/apm-sniffer/apm-sdk-plugin/mongodb-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/mongodb/v3/interceptor/v30/MongoDBInterceptor.java b/apm-sniffer/apm-sdk-plugin/mongodb-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/mongodb/v3/interceptor/v30/MongoDBInterceptor.java index 7ac199a8d..2d3196d64 100644 --- a/apm-sniffer/apm-sdk-plugin/mongodb-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/mongodb/v3/interceptor/v30/MongoDBInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/mongodb-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/mongodb/v3/interceptor/v30/MongoDBInterceptor.java @@ -75,7 +75,6 @@ public class MongoDBInterceptor implements InstanceMethodsAroundInterceptor, Ins public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { AbstractSpan activeSpan = ContextManager.activeSpan(); - activeSpan.errorOccurred(); activeSpan.log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/mongodb-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/mongodb/v3/interceptor/v37/MongoDBOperationExecutorInterceptor.java b/apm-sniffer/apm-sdk-plugin/mongodb-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/mongodb/v3/interceptor/v37/MongoDBOperationExecutorInterceptor.java index fb4da5d7f..b49c23eac 100644 --- a/apm-sniffer/apm-sdk-plugin/mongodb-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/mongodb/v3/interceptor/v37/MongoDBOperationExecutorInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/mongodb-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/mongodb/v3/interceptor/v37/MongoDBOperationExecutorInterceptor.java @@ -58,7 +58,6 @@ public class MongoDBOperationExecutorInterceptor implements InstanceMethodsAroun public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { AbstractSpan activeSpan = ContextManager.activeSpan(); - activeSpan.errorOccurred(); activeSpan.log(t); } diff --git a/apm-sniffer/apm-sdk-plugin/motan-plugin/src/main/java/org/apache/skywalking/apm/plugin/motan/MotanConsumerInterceptor.java b/apm-sniffer/apm-sdk-plugin/motan-plugin/src/main/java/org/apache/skywalking/apm/plugin/motan/MotanConsumerInterceptor.java index b0ba10fc7..22e8638bb 100644 --- a/apm-sniffer/apm-sdk-plugin/motan-plugin/src/main/java/org/apache/skywalking/apm/plugin/motan/MotanConsumerInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/motan-plugin/src/main/java/org/apache/skywalking/apm/plugin/motan/MotanConsumerInterceptor.java @@ -71,7 +71,6 @@ public class MotanConsumerInterceptor implements InstanceConstructorInterceptor, Response response = (Response) ret; if (response != null && response.getException() != null) { AbstractSpan span = ContextManager.activeSpan(); - span.errorOccurred(); span.log(response.getException()); } ContextManager.stopSpan(); @@ -82,7 +81,6 @@ public class MotanConsumerInterceptor implements InstanceConstructorInterceptor, public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { AbstractSpan span = ContextManager.activeSpan(); - span.errorOccurred(); span.log(t); } diff --git a/apm-sniffer/apm-sdk-plugin/motan-plugin/src/main/java/org/apache/skywalking/apm/plugin/motan/MotanProviderInterceptor.java b/apm-sniffer/apm-sdk-plugin/motan-plugin/src/main/java/org/apache/skywalking/apm/plugin/motan/MotanProviderInterceptor.java index 7b99d3794..d799dfdeb 100644 --- a/apm-sniffer/apm-sdk-plugin/motan-plugin/src/main/java/org/apache/skywalking/apm/plugin/motan/MotanProviderInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/motan-plugin/src/main/java/org/apache/skywalking/apm/plugin/motan/MotanProviderInterceptor.java @@ -63,7 +63,6 @@ public class MotanProviderInterceptor implements InstanceMethodsAroundIntercepto if (response != null && response.getException() != null) { AbstractSpan span = ContextManager.activeSpan(); span.log(response.getException()); - span.errorOccurred(); } ContextManager.stopSpan(); @@ -74,7 +73,6 @@ public class MotanProviderInterceptor implements InstanceMethodsAroundIntercepto public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { AbstractSpan activeSpan = ContextManager.activeSpan(); - activeSpan.errorOccurred(); activeSpan.log(t); } diff --git a/apm-sniffer/apm-sdk-plugin/mysql-common/src/main/java/org/apache/skywalking/apm/plugin/jdbc/mysql/PreparedStatementExecuteMethodsInterceptor.java b/apm-sniffer/apm-sdk-plugin/mysql-common/src/main/java/org/apache/skywalking/apm/plugin/jdbc/mysql/PreparedStatementExecuteMethodsInterceptor.java index 2ae7b0577..26c243a76 100644 --- a/apm-sniffer/apm-sdk-plugin/mysql-common/src/main/java/org/apache/skywalking/apm/plugin/jdbc/mysql/PreparedStatementExecuteMethodsInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/mysql-common/src/main/java/org/apache/skywalking/apm/plugin/jdbc/mysql/PreparedStatementExecuteMethodsInterceptor.java @@ -84,7 +84,7 @@ public class PreparedStatementExecuteMethodsInterceptor implements InstanceMetho Class[] argumentsTypes, Throwable t) { StatementEnhanceInfos cacheObject = (StatementEnhanceInfos) objInst.getSkyWalkingDynamicField(); if (cacheObject != null && cacheObject.getConnectionInfo() != null) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/mysql-common/src/main/java/org/apache/skywalking/apm/plugin/jdbc/mysql/StatementExecuteMethodsInterceptor.java b/apm-sniffer/apm-sdk-plugin/mysql-common/src/main/java/org/apache/skywalking/apm/plugin/jdbc/mysql/StatementExecuteMethodsInterceptor.java index cd642e041..57052d13f 100644 --- a/apm-sniffer/apm-sdk-plugin/mysql-common/src/main/java/org/apache/skywalking/apm/plugin/jdbc/mysql/StatementExecuteMethodsInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/mysql-common/src/main/java/org/apache/skywalking/apm/plugin/jdbc/mysql/StatementExecuteMethodsInterceptor.java @@ -81,7 +81,7 @@ public class StatementExecuteMethodsInterceptor implements InstanceMethodsAround Class[] argumentsTypes, Throwable t) { StatementEnhanceInfos cacheObject = (StatementEnhanceInfos) objInst.getSkyWalkingDynamicField(); if (cacheObject.getConnectionInfo() != null) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/netty-socketio-plugin/src/main/java/org/apache/skywalking/apm/plugin/netty/socketio/NettySocketIOConnectionInterceptor.java b/apm-sniffer/apm-sdk-plugin/netty-socketio-plugin/src/main/java/org/apache/skywalking/apm/plugin/netty/socketio/NettySocketIOConnectionInterceptor.java index f97c4d432..680810ae3 100644 --- a/apm-sniffer/apm-sdk-plugin/netty-socketio-plugin/src/main/java/org/apache/skywalking/apm/plugin/netty/socketio/NettySocketIOConnectionInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/netty-socketio-plugin/src/main/java/org/apache/skywalking/apm/plugin/netty/socketio/NettySocketIOConnectionInterceptor.java @@ -60,7 +60,7 @@ public class NettySocketIOConnectionInterceptor implements InstanceMethodsAround public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { if (ContextManager.isActive()) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } } diff --git a/apm-sniffer/apm-sdk-plugin/netty-socketio-plugin/src/main/java/org/apache/skywalking/apm/plugin/netty/socketio/NettySocketIOOnEventInterceptor.java b/apm-sniffer/apm-sdk-plugin/netty-socketio-plugin/src/main/java/org/apache/skywalking/apm/plugin/netty/socketio/NettySocketIOOnEventInterceptor.java index ca85984ce..e0bfdef93 100644 --- a/apm-sniffer/apm-sdk-plugin/netty-socketio-plugin/src/main/java/org/apache/skywalking/apm/plugin/netty/socketio/NettySocketIOOnEventInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/netty-socketio-plugin/src/main/java/org/apache/skywalking/apm/plugin/netty/socketio/NettySocketIOOnEventInterceptor.java @@ -54,7 +54,7 @@ public class NettySocketIOOnEventInterceptor implements InstanceMethodsAroundInt public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { if (ContextManager.isActive()) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/netty-socketio-plugin/src/main/java/org/apache/skywalking/apm/plugin/netty/socketio/NettySocketIORoomInterceptor.java b/apm-sniffer/apm-sdk-plugin/netty-socketio-plugin/src/main/java/org/apache/skywalking/apm/plugin/netty/socketio/NettySocketIORoomInterceptor.java index e05e39ba4..75d6f35fe 100644 --- a/apm-sniffer/apm-sdk-plugin/netty-socketio-plugin/src/main/java/org/apache/skywalking/apm/plugin/netty/socketio/NettySocketIORoomInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/netty-socketio-plugin/src/main/java/org/apache/skywalking/apm/plugin/netty/socketio/NettySocketIORoomInterceptor.java @@ -50,7 +50,7 @@ public class NettySocketIORoomInterceptor implements InstanceMethodsAroundInterc public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { if (ContextManager.isActive()) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } } 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 d9201d7ce..af6fae60f 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 @@ -76,6 +76,6 @@ public class SenderSendInterceptor implements InstanceMethodsAroundInterceptor { @Override public void handleMethodException(final EnhancedInstance objInst, final Method method, final Object[] allArguments, final Class[] argumentsTypes, final Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } 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 37695c13e..143f39e98 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 @@ -85,6 +85,6 @@ public class ActionMethodInterceptor implements InstanceMethodsAroundInterceptor @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/okhttp-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/okhttp/v3/EnqueueInterceptor.java b/apm-sniffer/apm-sdk-plugin/okhttp-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/okhttp/v3/EnqueueInterceptor.java index 7f12e625d..e4612a97d 100644 --- a/apm-sniffer/apm-sdk-plugin/okhttp-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/okhttp/v3/EnqueueInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/okhttp-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/okhttp/v3/EnqueueInterceptor.java @@ -62,7 +62,7 @@ public class EnqueueInterceptor implements InstanceMethodsAroundInterceptor, Ins @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } @Override diff --git a/apm-sniffer/apm-sdk-plugin/okhttp-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/okhttp/v3/OnFailureInterceptor.java b/apm-sniffer/apm-sdk-plugin/okhttp-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/okhttp/v3/OnFailureInterceptor.java index 0463fa77f..be4b82df1 100644 --- a/apm-sniffer/apm-sdk-plugin/okhttp-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/okhttp/v3/OnFailureInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/okhttp-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/okhttp/v3/OnFailureInterceptor.java @@ -28,7 +28,7 @@ public class OnFailureInterceptor implements InstanceMethodsAroundInterceptor { @Override public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, MethodInterceptResult result) throws Throwable { - ContextManager.activeSpan().errorOccurred().log((Throwable) allArguments[1]); + ContextManager.activeSpan().log((Throwable) allArguments[1]); } @Override @@ -40,6 +40,6 @@ public class OnFailureInterceptor implements InstanceMethodsAroundInterceptor { @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/okhttp-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/okhttp/v3/OnResponseInterceptor.java b/apm-sniffer/apm-sdk-plugin/okhttp-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/okhttp/v3/OnResponseInterceptor.java index abf91fa6c..4649d016b 100644 --- a/apm-sniffer/apm-sdk-plugin/okhttp-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/okhttp/v3/OnResponseInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/okhttp-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/okhttp/v3/OnResponseInterceptor.java @@ -49,6 +49,6 @@ public class OnResponseInterceptor implements InstanceMethodsAroundInterceptor { @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/okhttp-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/okhttp/v3/RealCallInterceptor.java b/apm-sniffer/apm-sdk-plugin/okhttp-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/okhttp/v3/RealCallInterceptor.java index 07113a31e..56f99a448 100644 --- a/apm-sniffer/apm-sdk-plugin/okhttp-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/okhttp/v3/RealCallInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/okhttp-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/okhttp/v3/RealCallInterceptor.java @@ -112,7 +112,6 @@ public class RealCallInterceptor implements InstanceMethodsAroundInterceptor, In public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { AbstractSpan abstractSpan = ContextManager.activeSpan(); - abstractSpan.errorOccurred(); abstractSpan.log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/play-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/play/v2x/HttpFiltersInterceptor.java b/apm-sniffer/apm-sdk-plugin/play-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/play/v2x/HttpFiltersInterceptor.java index 3739004cb..41071de25 100644 --- a/apm-sniffer/apm-sdk-plugin/play-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/play/v2x/HttpFiltersInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/play-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/play/v2x/HttpFiltersInterceptor.java @@ -55,7 +55,7 @@ public class HttpFiltersInterceptor implements InstanceMethodsAroundInterceptor, @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } @Override 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 0bd29ce1b..32914b31f 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 @@ -85,7 +85,7 @@ public class TracingFilter extends Filter { try { span.asyncFinish(); } catch (Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } return result; }); diff --git a/apm-sniffer/apm-sdk-plugin/postgresql-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/postgresql/PreparedStatementExecuteMethodsInterceptor.java b/apm-sniffer/apm-sdk-plugin/postgresql-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/postgresql/PreparedStatementExecuteMethodsInterceptor.java index d359976f9..9045ad6ad 100755 --- a/apm-sniffer/apm-sdk-plugin/postgresql-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/postgresql/PreparedStatementExecuteMethodsInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/postgresql-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/postgresql/PreparedStatementExecuteMethodsInterceptor.java @@ -80,7 +80,7 @@ public class PreparedStatementExecuteMethodsInterceptor implements InstanceMetho Class[] argumentsTypes, Throwable t) { StatementEnhanceInfos cacheObject = (StatementEnhanceInfos) objInst.getSkyWalkingDynamicField(); if (cacheObject.getConnectionInfo() != null) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/postgresql-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/postgresql/StatementExecuteMethodsInterceptor.java b/apm-sniffer/apm-sdk-plugin/postgresql-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/postgresql/StatementExecuteMethodsInterceptor.java index 7572315ce..c1a76ac25 100755 --- a/apm-sniffer/apm-sdk-plugin/postgresql-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/postgresql/StatementExecuteMethodsInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/postgresql-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/postgresql/StatementExecuteMethodsInterceptor.java @@ -63,7 +63,7 @@ public class StatementExecuteMethodsInterceptor implements InstanceMethodsAround Class[] argumentsTypes, Throwable t) { StatementEnhanceInfos cacheObject = (StatementEnhanceInfos) objInst.getSkyWalkingDynamicField(); if (cacheObject.getConnectionInfo() != null) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/pulsar-plugin/src/main/java/org/apache/skywalking/apm/plugin/pulsar/PulsarConsumerInterceptor.java b/apm-sniffer/apm-sdk-plugin/pulsar-plugin/src/main/java/org/apache/skywalking/apm/plugin/pulsar/PulsarConsumerInterceptor.java index d76cce8a0..414296fdd 100644 --- a/apm-sniffer/apm-sdk-plugin/pulsar-plugin/src/main/java/org/apache/skywalking/apm/plugin/pulsar/PulsarConsumerInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/pulsar-plugin/src/main/java/org/apache/skywalking/apm/plugin/pulsar/PulsarConsumerInterceptor.java @@ -83,7 +83,7 @@ public class PulsarConsumerInterceptor implements InstanceMethodsAroundIntercept public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { if (allArguments[0] != null) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } } diff --git a/apm-sniffer/apm-sdk-plugin/pulsar-plugin/src/main/java/org/apache/skywalking/apm/plugin/pulsar/PulsarProducerInterceptor.java b/apm-sniffer/apm-sdk-plugin/pulsar-plugin/src/main/java/org/apache/skywalking/apm/plugin/pulsar/PulsarProducerInterceptor.java index 75f2a6d39..0161225a8 100644 --- a/apm-sniffer/apm-sdk-plugin/pulsar-plugin/src/main/java/org/apache/skywalking/apm/plugin/pulsar/PulsarProducerInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/pulsar-plugin/src/main/java/org/apache/skywalking/apm/plugin/pulsar/PulsarProducerInterceptor.java @@ -104,7 +104,7 @@ public class PulsarProducerInterceptor implements InstanceMethodsAroundIntercept public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { if (allArguments[0] != null) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } } diff --git a/apm-sniffer/apm-sdk-plugin/pulsar-plugin/src/main/java/org/apache/skywalking/apm/plugin/pulsar/SendCallbackInterceptor.java b/apm-sniffer/apm-sdk-plugin/pulsar-plugin/src/main/java/org/apache/skywalking/apm/plugin/pulsar/SendCallbackInterceptor.java index c4e1c060a..0209edf28 100644 --- a/apm-sniffer/apm-sdk-plugin/pulsar-plugin/src/main/java/org/apache/skywalking/apm/plugin/pulsar/SendCallbackInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/pulsar-plugin/src/main/java/org/apache/skywalking/apm/plugin/pulsar/SendCallbackInterceptor.java @@ -64,7 +64,7 @@ public class SendCallbackInterceptor implements InstanceMethodsAroundInterceptor if (null != requiredInfo.getContextSnapshot()) { Exception exceptions = (Exception) allArguments[0]; if (exceptions != null) { - ContextManager.activeSpan().errorOccurred().log(exceptions); + ContextManager.activeSpan().log(exceptions); } ContextManager.stopSpan(); } @@ -76,7 +76,7 @@ public class SendCallbackInterceptor implements InstanceMethodsAroundInterceptor Class[] argumentsTypes, Throwable t) { SendCallbackEnhanceRequiredInfo requiredInfo = (SendCallbackEnhanceRequiredInfo) objInst.getSkyWalkingDynamicField(); if (null != requiredInfo.getContextSnapshot()) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } } diff --git a/apm-sniffer/apm-sdk-plugin/quasar-plugin/src/main/java/org/apache/skywalking/apm/plugin/quasar/FiberInterceptor.java b/apm-sniffer/apm-sdk-plugin/quasar-plugin/src/main/java/org/apache/skywalking/apm/plugin/quasar/FiberInterceptor.java index 744dd4db4..d4df41401 100644 --- a/apm-sniffer/apm-sdk-plugin/quasar-plugin/src/main/java/org/apache/skywalking/apm/plugin/quasar/FiberInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/quasar-plugin/src/main/java/org/apache/skywalking/apm/plugin/quasar/FiberInterceptor.java @@ -55,7 +55,6 @@ public class FiberInterceptor implements InstanceMethodsAroundInterceptor, Insta public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { AbstractSpan span = ContextManager.activeSpan(); - span.errorOccurred(); span.log(t); } diff --git a/apm-sniffer/apm-sdk-plugin/rabbitmq-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/rabbitmq/RabbitMQConsumerInterceptor.java b/apm-sniffer/apm-sdk-plugin/rabbitmq-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/rabbitmq/RabbitMQConsumerInterceptor.java index e5e687c8c..8c74a8057 100644 --- a/apm-sniffer/apm-sdk-plugin/rabbitmq-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/rabbitmq/RabbitMQConsumerInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/rabbitmq-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/rabbitmq/RabbitMQConsumerInterceptor.java @@ -73,6 +73,6 @@ public class RabbitMQConsumerInterceptor implements InstanceMethodsAroundInterce @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/rabbitmq-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/rabbitmq/RabbitMQProducerInterceptor.java b/apm-sniffer/apm-sdk-plugin/rabbitmq-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/rabbitmq/RabbitMQProducerInterceptor.java index 5ee7e71c5..a43028319 100644 --- a/apm-sniffer/apm-sdk-plugin/rabbitmq-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/rabbitmq/RabbitMQProducerInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/rabbitmq-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/rabbitmq/RabbitMQProducerInterceptor.java @@ -99,6 +99,6 @@ public class RabbitMQProducerInterceptor implements InstanceMethodsAroundInterce @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/redisson-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/redisson/v3/RedisConnectionMethodInterceptor.java b/apm-sniffer/apm-sdk-plugin/redisson-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/redisson/v3/RedisConnectionMethodInterceptor.java index f87b7bfd6..8f96cd0b6 100644 --- a/apm-sniffer/apm-sdk-plugin/redisson-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/redisson/v3/RedisConnectionMethodInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/redisson-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/redisson/v3/RedisConnectionMethodInterceptor.java @@ -99,7 +99,6 @@ public class RedisConnectionMethodInterceptor implements InstanceMethodsAroundIn public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { AbstractSpan span = ContextManager.activeSpan(); - span.errorOccurred(); span.log(t); } 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/SynchronousDispatcherExceptionInterceptor.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/SynchronousDispatcherExceptionInterceptor.java index 9234a95eb..a33523826 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/SynchronousDispatcherExceptionInterceptor.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/SynchronousDispatcherExceptionInterceptor.java @@ -32,7 +32,7 @@ public class SynchronousDispatcherExceptionInterceptor implements InstanceMethod public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, MethodInterceptResult result) throws Throwable { if (ContextManager.isActive() && !((HttpRequest) allArguments[0]).getAsyncContext().isSuspended()) { - ContextManager.activeSpan().errorOccurred().log((Throwable) allArguments[2]); + ContextManager.activeSpan().log((Throwable) allArguments[2]); } } @@ -45,6 +45,6 @@ public class SynchronousDispatcherExceptionInterceptor implements InstanceMethod @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } 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 d028a04f2..78aff12ab 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 @@ -70,7 +70,7 @@ public class SynchronousDispatcherInterceptor implements InstanceMethodsAroundIn @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } private static String toPath(String uri) { diff --git a/apm-sniffer/apm-sdk-plugin/rocketMQ-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/rocketMQ/v3/AbstractMessageConsumeInterceptor.java b/apm-sniffer/apm-sdk-plugin/rocketMQ-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/rocketMQ/v3/AbstractMessageConsumeInterceptor.java index 3bb27dfbb..72dfd0c8a 100644 --- a/apm-sniffer/apm-sdk-plugin/rocketMQ-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/rocketMQ/v3/AbstractMessageConsumeInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/rocketMQ-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/rocketMQ/v3/AbstractMessageConsumeInterceptor.java @@ -60,7 +60,7 @@ public abstract class AbstractMessageConsumeInterceptor implements InstanceMetho @Override public final void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } private ContextCarrier getContextCarrierFromMessage(MessageExt message) { diff --git a/apm-sniffer/apm-sdk-plugin/rocketMQ-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/rocketMQ/v3/MessageSendInterceptor.java b/apm-sniffer/apm-sdk-plugin/rocketMQ-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/rocketMQ/v3/MessageSendInterceptor.java index 86a4bed67..747b009fe 100644 --- a/apm-sniffer/apm-sdk-plugin/rocketMQ-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/rocketMQ/v3/MessageSendInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/rocketMQ-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/rocketMQ/v3/MessageSendInterceptor.java @@ -91,7 +91,7 @@ public class MessageSendInterceptor implements InstanceMethodsAroundInterceptor @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } private String buildOperationName(String topicName) { diff --git a/apm-sniffer/apm-sdk-plugin/rocketMQ-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/rocketMQ/v3/OnExceptionInterceptor.java b/apm-sniffer/apm-sdk-plugin/rocketMQ-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/rocketMQ/v3/OnExceptionInterceptor.java index 374d56918..b4ce32007 100644 --- a/apm-sniffer/apm-sdk-plugin/rocketMQ-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/rocketMQ/v3/OnExceptionInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/rocketMQ-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/rocketMQ/v3/OnExceptionInterceptor.java @@ -41,7 +41,7 @@ public class OnExceptionInterceptor implements InstanceMethodsAroundInterceptor SendCallBackEnhanceInfo enhanceInfo = (SendCallBackEnhanceInfo) objInst.getSkyWalkingDynamicField(); AbstractSpan activeSpan = ContextManager.createLocalSpan(CALLBACK_OPERATION_NAME_PREFIX + enhanceInfo.getTopicId() + "/Producer/Callback"); activeSpan.setComponent(ComponentsDefine.ROCKET_MQ_PRODUCER); - activeSpan.errorOccurred().log((Throwable) allArguments[0]); + activeSpan.log((Throwable) allArguments[0]); ContextManager.continued(enhanceInfo.getContextSnapshot()); } diff --git a/apm-sniffer/apm-sdk-plugin/rocketMQ-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/rocketMQ/v3/OnSuccessInterceptor.java b/apm-sniffer/apm-sdk-plugin/rocketMQ-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/rocketMQ/v3/OnSuccessInterceptor.java index baabd2681..968955177 100644 --- a/apm-sniffer/apm-sdk-plugin/rocketMQ-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/rocketMQ/v3/OnSuccessInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/rocketMQ-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/rocketMQ/v3/OnSuccessInterceptor.java @@ -62,6 +62,6 @@ public class OnSuccessInterceptor implements InstanceMethodsAroundInterceptor { @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/rocketMQ-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/rocketMQ/v4/AbstractMessageConsumeInterceptor.java b/apm-sniffer/apm-sdk-plugin/rocketMQ-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/rocketMQ/v4/AbstractMessageConsumeInterceptor.java index 23f2b005a..61b35544b 100644 --- a/apm-sniffer/apm-sdk-plugin/rocketMQ-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/rocketMQ/v4/AbstractMessageConsumeInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/rocketMQ-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/rocketMQ/v4/AbstractMessageConsumeInterceptor.java @@ -60,7 +60,7 @@ public abstract class AbstractMessageConsumeInterceptor implements InstanceMetho @Override public final void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } private ContextCarrier getContextCarrierFromMessage(MessageExt message) { diff --git a/apm-sniffer/apm-sdk-plugin/rocketMQ-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/rocketMQ/v4/MessageSendInterceptor.java b/apm-sniffer/apm-sdk-plugin/rocketMQ-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/rocketMQ/v4/MessageSendInterceptor.java index 493965833..8bd2e3504 100644 --- a/apm-sniffer/apm-sdk-plugin/rocketMQ-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/rocketMQ/v4/MessageSendInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/rocketMQ-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/rocketMQ/v4/MessageSendInterceptor.java @@ -91,7 +91,7 @@ public class MessageSendInterceptor implements InstanceMethodsAroundInterceptor @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } private String buildOperationName(String topicName) { diff --git a/apm-sniffer/apm-sdk-plugin/rocketMQ-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/rocketMQ/v4/OnExceptionInterceptor.java b/apm-sniffer/apm-sdk-plugin/rocketMQ-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/rocketMQ/v4/OnExceptionInterceptor.java index 4687f8c8f..cd6b12eea 100644 --- a/apm-sniffer/apm-sdk-plugin/rocketMQ-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/rocketMQ/v4/OnExceptionInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/rocketMQ-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/rocketMQ/v4/OnExceptionInterceptor.java @@ -48,7 +48,7 @@ public class OnExceptionInterceptor implements InstanceMethodsAroundInterceptor } AbstractSpan activeSpan = ContextManager.createLocalSpan(CALLBACK_OPERATION_NAME_PREFIX + topicId + "/Producer/Callback"); activeSpan.setComponent(ComponentsDefine.ROCKET_MQ_PRODUCER); - activeSpan.errorOccurred().log((Throwable) allArguments[0]); + activeSpan.log((Throwable) allArguments[0]); if (enhanceInfo != null && enhanceInfo.getContextSnapshot() != null) { ContextManager.continued(enhanceInfo.getContextSnapshot()); } diff --git a/apm-sniffer/apm-sdk-plugin/rocketMQ-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/rocketMQ/v4/OnSuccessInterceptor.java b/apm-sniffer/apm-sdk-plugin/rocketMQ-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/rocketMQ/v4/OnSuccessInterceptor.java index e71d7244a..1fc80c44c 100644 --- a/apm-sniffer/apm-sdk-plugin/rocketMQ-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/rocketMQ/v4/OnSuccessInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/rocketMQ-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/rocketMQ/v4/OnSuccessInterceptor.java @@ -62,6 +62,6 @@ public class OnSuccessInterceptor implements InstanceMethodsAroundInterceptor { @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } 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 a7ce3104b..9f3e8543b 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 @@ -69,7 +69,6 @@ public class ProducerOperationHandlerInterceptor implements InstanceMethodsAroun public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { AbstractSpan span = ContextManager.activeSpan(); - span.errorOccurred(); span.log(t); } 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 e69e8696c..17ee3f851 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 @@ -82,7 +82,6 @@ public class TransportClientHandlerInterceptor implements InstanceMethodsAroundI return; } AbstractSpan span = ContextManager.activeSpan(); - span.errorOccurred(); span.log(t); } 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 29116289f..80150c739 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 @@ -69,7 +69,6 @@ public class ProducerOperationHandlerInterceptor implements InstanceMethodsAroun public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { AbstractSpan span = ContextManager.activeSpan(); - span.errorOccurred(); span.log(t); } 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 fbd93d045..9686b5c4c 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 @@ -82,7 +82,6 @@ public class TransportClientHandlerInterceptor implements InstanceMethodsAroundI return; } AbstractSpan span = ContextManager.activeSpan(); - span.errorOccurred(); span.log(t); } diff --git a/apm-sniffer/apm-sdk-plugin/sharding-jdbc-1.5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/sjdbc/define/ExecuteInterceptor.java b/apm-sniffer/apm-sdk-plugin/sharding-jdbc-1.5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/sjdbc/define/ExecuteInterceptor.java index cdd8e663c..f1d2f822b 100644 --- a/apm-sniffer/apm-sdk-plugin/sharding-jdbc-1.5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/sjdbc/define/ExecuteInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/sharding-jdbc-1.5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/sjdbc/define/ExecuteInterceptor.java @@ -51,6 +51,6 @@ public class ExecuteInterceptor implements InstanceMethodsAroundInterceptor { @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/sharding-sphere-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/ExecuteInterceptor.java b/apm-sniffer/apm-sdk-plugin/sharding-sphere-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/ExecuteInterceptor.java index 8f6308ec6..5504d48a2 100644 --- a/apm-sniffer/apm-sdk-plugin/sharding-sphere-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/ExecuteInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/sharding-sphere-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/ExecuteInterceptor.java @@ -59,6 +59,6 @@ public class ExecuteInterceptor implements InstanceMethodsAroundInterceptor { @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/sharding-sphere-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/JDBCRootInvokeInterceptor.java b/apm-sniffer/apm-sdk-plugin/sharding-sphere-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/JDBCRootInvokeInterceptor.java index ce7d52810..6b2cc2d72 100644 --- a/apm-sniffer/apm-sdk-plugin/sharding-sphere-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/JDBCRootInvokeInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/sharding-sphere-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/JDBCRootInvokeInterceptor.java @@ -51,6 +51,6 @@ public class JDBCRootInvokeInterceptor implements InstanceMethodsAroundIntercept @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/sharding-sphere-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/ParseInterceptor.java b/apm-sniffer/apm-sdk-plugin/sharding-sphere-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/ParseInterceptor.java index 93c9cde95..fefe5cd2f 100644 --- a/apm-sniffer/apm-sdk-plugin/sharding-sphere-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/ParseInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/sharding-sphere-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/ParseInterceptor.java @@ -52,6 +52,6 @@ public class ParseInterceptor implements InstanceMethodsAroundInterceptor { @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/sharding-sphere-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/ProxyRootInvokeInterceptor.java b/apm-sniffer/apm-sdk-plugin/sharding-sphere-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/ProxyRootInvokeInterceptor.java index c1ba48dc6..18649ee8a 100644 --- a/apm-sniffer/apm-sdk-plugin/sharding-sphere-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/ProxyRootInvokeInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/sharding-sphere-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/ProxyRootInvokeInterceptor.java @@ -51,6 +51,6 @@ public class ProxyRootInvokeInterceptor implements InstanceMethodsAroundIntercep @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.0.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v40/ExecuteInterceptor.java b/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.0.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v40/ExecuteInterceptor.java index 45281832c..38aba47a8 100644 --- a/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.0.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v40/ExecuteInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.0.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v40/ExecuteInterceptor.java @@ -59,6 +59,6 @@ public class ExecuteInterceptor implements InstanceMethodsAroundInterceptor { @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.0.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v40/JDBCRootInvokeInterceptor.java b/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.0.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v40/JDBCRootInvokeInterceptor.java index fad49e377..183709f7d 100644 --- a/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.0.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v40/JDBCRootInvokeInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.0.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v40/JDBCRootInvokeInterceptor.java @@ -51,6 +51,6 @@ public class JDBCRootInvokeInterceptor implements InstanceMethodsAroundIntercept @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.0.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v40/ParseInterceptor.java b/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.0.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v40/ParseInterceptor.java index 9859f50da..dea43961e 100644 --- a/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.0.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v40/ParseInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.0.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v40/ParseInterceptor.java @@ -52,6 +52,6 @@ public class ParseInterceptor implements InstanceMethodsAroundInterceptor { @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.0.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v40/ProxyRootInvokeInterceptor.java b/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.0.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v40/ProxyRootInvokeInterceptor.java index 4f416f6fb..d8bab910a 100644 --- a/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.0.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v40/ProxyRootInvokeInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.0.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v40/ProxyRootInvokeInterceptor.java @@ -51,6 +51,6 @@ public class ProxyRootInvokeInterceptor implements InstanceMethodsAroundIntercep @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.1.0-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v41/ExecuteInterceptor.java b/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.1.0-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v41/ExecuteInterceptor.java index 72fa54b58..97f437796 100644 --- a/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.1.0-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v41/ExecuteInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.1.0-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v41/ExecuteInterceptor.java @@ -59,6 +59,6 @@ public class ExecuteInterceptor implements InstanceMethodsAroundInterceptor { @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.1.0-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v41/JDBCRootInvokeInterceptor.java b/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.1.0-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v41/JDBCRootInvokeInterceptor.java index d468d976f..d9b74b104 100644 --- a/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.1.0-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v41/JDBCRootInvokeInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.1.0-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v41/JDBCRootInvokeInterceptor.java @@ -51,6 +51,6 @@ public class JDBCRootInvokeInterceptor implements InstanceMethodsAroundIntercept @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.1.0-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v41/ParseInterceptor.java b/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.1.0-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v41/ParseInterceptor.java index 875f6bbaf..13d9aa706 100644 --- a/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.1.0-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v41/ParseInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.1.0-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v41/ParseInterceptor.java @@ -51,6 +51,6 @@ public class ParseInterceptor implements InstanceMethodsAroundInterceptor { @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.1.0-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v41/ProxyRootInvokeInterceptor.java b/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.1.0-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v41/ProxyRootInvokeInterceptor.java index 35e30e8ab..7d5f7fee8 100644 --- a/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.1.0-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v41/ProxyRootInvokeInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.1.0-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v41/ProxyRootInvokeInterceptor.java @@ -51,6 +51,6 @@ public class ProxyRootInvokeInterceptor implements InstanceMethodsAroundIntercep @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.x-RC3-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v4rc3/ExecuteInterceptor.java b/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.x-RC3-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v4rc3/ExecuteInterceptor.java index b4baeaa7f..1666611fa 100644 --- a/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.x-RC3-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v4rc3/ExecuteInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.x-RC3-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v4rc3/ExecuteInterceptor.java @@ -59,6 +59,6 @@ public class ExecuteInterceptor implements InstanceMethodsAroundInterceptor { @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.x-RC3-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v4rc3/JDBCRootInvokeInterceptor.java b/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.x-RC3-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v4rc3/JDBCRootInvokeInterceptor.java index 1364a04b2..999d4e039 100644 --- a/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.x-RC3-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v4rc3/JDBCRootInvokeInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.x-RC3-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v4rc3/JDBCRootInvokeInterceptor.java @@ -51,6 +51,6 @@ public class JDBCRootInvokeInterceptor implements InstanceMethodsAroundIntercept @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.x-RC3-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v4rc3/ParseInterceptor.java b/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.x-RC3-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v4rc3/ParseInterceptor.java index 66d410e2e..c2c36fc79 100644 --- a/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.x-RC3-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v4rc3/ParseInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.x-RC3-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v4rc3/ParseInterceptor.java @@ -52,6 +52,6 @@ public class ParseInterceptor implements InstanceMethodsAroundInterceptor { @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.x-RC3-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v4rc3/ProxyRootInvokeInterceptor.java b/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.x-RC3-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v4rc3/ProxyRootInvokeInterceptor.java index c45e17c79..692c2b69e 100644 --- a/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.x-RC3-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v4rc3/ProxyRootInvokeInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.x-RC3-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v4rc3/ProxyRootInvokeInterceptor.java @@ -51,6 +51,6 @@ public class ProxyRootInvokeInterceptor implements InstanceMethodsAroundIntercep @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v4/ExecuteInterceptor.java b/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v4/ExecuteInterceptor.java index c67a74cd5..7ebd16808 100644 --- a/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v4/ExecuteInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v4/ExecuteInterceptor.java @@ -59,6 +59,6 @@ public class ExecuteInterceptor implements InstanceMethodsAroundInterceptor { @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v4/JDBCRootInvokeInterceptor.java b/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v4/JDBCRootInvokeInterceptor.java index 9e684abba..36258950d 100644 --- a/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v4/JDBCRootInvokeInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v4/JDBCRootInvokeInterceptor.java @@ -51,6 +51,6 @@ public class JDBCRootInvokeInterceptor implements InstanceMethodsAroundIntercept @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v4/ParseInterceptor.java b/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v4/ParseInterceptor.java index 12a120cf4..aa72170ce 100644 --- a/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v4/ParseInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v4/ParseInterceptor.java @@ -52,6 +52,6 @@ public class ParseInterceptor implements InstanceMethodsAroundInterceptor { @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v4/ProxyRootInvokeInterceptor.java b/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v4/ProxyRootInvokeInterceptor.java index 2142bd1cc..1f2771a50 100644 --- a/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v4/ProxyRootInvokeInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/sharding-sphere-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v4/ProxyRootInvokeInterceptor.java @@ -51,6 +51,6 @@ public class ProxyRootInvokeInterceptor implements InstanceMethodsAroundIntercep @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/sofarpc-plugin/src/main/java/org/apache/skywalking/apm/plugin/sofarpc/SofaRpcConsumerInterceptor.java b/apm-sniffer/apm-sdk-plugin/sofarpc-plugin/src/main/java/org/apache/skywalking/apm/plugin/sofarpc/SofaRpcConsumerInterceptor.java index abbf99edb..57585860a 100644 --- a/apm-sniffer/apm-sdk-plugin/sofarpc-plugin/src/main/java/org/apache/skywalking/apm/plugin/sofarpc/SofaRpcConsumerInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/sofarpc-plugin/src/main/java/org/apache/skywalking/apm/plugin/sofarpc/SofaRpcConsumerInterceptor.java @@ -90,7 +90,6 @@ public class SofaRpcConsumerInterceptor implements InstanceMethodsAroundIntercep */ private void dealException(Throwable throwable) { AbstractSpan span = ContextManager.activeSpan(); - span.errorOccurred(); span.log(throwable); } diff --git a/apm-sniffer/apm-sdk-plugin/sofarpc-plugin/src/main/java/org/apache/skywalking/apm/plugin/sofarpc/SofaRpcProviderInterceptor.java b/apm-sniffer/apm-sdk-plugin/sofarpc-plugin/src/main/java/org/apache/skywalking/apm/plugin/sofarpc/SofaRpcProviderInterceptor.java index 39f3e2280..98397019f 100644 --- a/apm-sniffer/apm-sdk-plugin/sofarpc-plugin/src/main/java/org/apache/skywalking/apm/plugin/sofarpc/SofaRpcProviderInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/sofarpc-plugin/src/main/java/org/apache/skywalking/apm/plugin/sofarpc/SofaRpcProviderInterceptor.java @@ -84,7 +84,6 @@ public class SofaRpcProviderInterceptor implements InstanceMethodsAroundIntercep */ private void dealException(Throwable throwable) { AbstractSpan span = ContextManager.activeSpan(); - span.errorOccurred(); span.log(throwable); } diff --git a/apm-sniffer/apm-sdk-plugin/solrj-7.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/solrj/SolrClientInterceptor.java b/apm-sniffer/apm-sdk-plugin/solrj-7.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/solrj/SolrClientInterceptor.java index ab55f91ce..720545b23 100644 --- a/apm-sniffer/apm-sdk-plugin/solrj-7.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/solrj/SolrClientInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/solrj-7.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/solrj/SolrClientInterceptor.java @@ -182,7 +182,7 @@ public class SolrClientInterceptor implements InstanceMethodsAroundInterceptor, code = ((SolrException) t).code(); } span.tag(SolrjTags.TAG_STATUS, String.valueOf(code)); - span.errorOccurred().log(t); + span.log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/solrj-7.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/solrj/SolrConnectorInterceptor.java b/apm-sniffer/apm-sdk-plugin/solrj-7.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/solrj/SolrConnectorInterceptor.java index 1e43d0836..43e787553 100644 --- a/apm-sniffer/apm-sdk-plugin/solrj-7.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/solrj/SolrConnectorInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/solrj-7.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/solrj/SolrConnectorInterceptor.java @@ -57,7 +57,7 @@ public class SolrConnectorInterceptor implements InstanceMethodsAroundIntercepto public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { if (ContextManager.isActive()) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } } diff --git a/apm-sniffer/apm-sdk-plugin/spring-plugins/async-annotation-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/async/SWCallable.java b/apm-sniffer/apm-sdk-plugin/spring-plugins/async-annotation-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/async/SWCallable.java index f8f10a145..e8676d3cc 100644 --- a/apm-sniffer/apm-sdk-plugin/spring-plugins/async-annotation-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/async/SWCallable.java +++ b/apm-sniffer/apm-sdk-plugin/spring-plugins/async-annotation-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/async/SWCallable.java @@ -46,7 +46,7 @@ public class SWCallable implements Callable { ContextManager.continued(snapshot); return callable.call(); } catch (Exception e) { - ContextManager.activeSpan().errorOccurred().log(e); + ContextManager.activeSpan().log(e); throw e; } finally { ContextManager.stopSpan(); diff --git a/apm-sniffer/apm-sdk-plugin/spring-plugins/concurrent-util-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/concurrent/FailureCallbackInterceptor.java b/apm-sniffer/apm-sdk-plugin/spring-plugins/concurrent-util-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/concurrent/FailureCallbackInterceptor.java index d4c9e7fc6..c62ee17d8 100644 --- a/apm-sniffer/apm-sdk-plugin/spring-plugins/concurrent-util-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/concurrent/FailureCallbackInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/spring-plugins/concurrent-util-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/concurrent/FailureCallbackInterceptor.java @@ -37,8 +37,7 @@ public class FailureCallbackInterceptor implements InstanceMethodsAroundIntercep } AbstractSpan span = ContextManager.createLocalSpan("future/failureCallback:" + cacheValues.getOperationName()); - span.errorOccurred() - .log((Throwable) allArguments[0]) + span.log((Throwable) allArguments[0]) .setComponent(cacheValues.getComponent()) .setLayer(cacheValues.getSpanLayer()); ContextManager.continued(cacheValues.getContextSnapshot()); @@ -62,6 +61,6 @@ public class FailureCallbackInterceptor implements InstanceMethodsAroundIntercep if (cacheValues == null) { return; } - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/spring-plugins/concurrent-util-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/concurrent/SuccessCallbackInterceptor.java b/apm-sniffer/apm-sdk-plugin/spring-plugins/concurrent-util-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/concurrent/SuccessCallbackInterceptor.java index 605721224..4055cbc5e 100644 --- a/apm-sniffer/apm-sdk-plugin/spring-plugins/concurrent-util-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/concurrent/SuccessCallbackInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/spring-plugins/concurrent-util-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/concurrent/SuccessCallbackInterceptor.java @@ -59,6 +59,6 @@ public class SuccessCallbackInterceptor implements InstanceMethodsAroundIntercep if (cacheValues == null) { return; } - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } 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 9015ef8fe..5dda2449e 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 @@ -205,7 +205,7 @@ public abstract class AbstractMethodInterceptor implements InstanceMethodsAround @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } private void collectHttpParam(RequestHolder request, AbstractSpan span) { diff --git a/apm-sniffer/apm-sdk-plugin/spring-plugins/resttemplate-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/resttemplate/async/FutureGetInterceptor.java b/apm-sniffer/apm-sdk-plugin/spring-plugins/resttemplate-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/resttemplate/async/FutureGetInterceptor.java index e9bea414d..03975d451 100644 --- a/apm-sniffer/apm-sdk-plugin/spring-plugins/resttemplate-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/resttemplate/async/FutureGetInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/spring-plugins/resttemplate-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/resttemplate/async/FutureGetInterceptor.java @@ -46,6 +46,6 @@ public class FutureGetInterceptor implements InstanceMethodsAroundInterceptor { public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { AbstractSpan activeSpan = ContextManager.activeSpan(); - activeSpan.errorOccurred().log(t); + activeSpan.log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/spring-plugins/resttemplate-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/resttemplate/async/RestExecuteInterceptor.java b/apm-sniffer/apm-sdk-plugin/spring-plugins/resttemplate-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/resttemplate/async/RestExecuteInterceptor.java index a46650c37..2b87d9e6f 100644 --- a/apm-sniffer/apm-sdk-plugin/spring-plugins/resttemplate-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/resttemplate/async/RestExecuteInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/spring-plugins/resttemplate-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/resttemplate/async/RestExecuteInterceptor.java @@ -74,6 +74,6 @@ public class RestExecuteInterceptor implements InstanceMethodsAroundInterceptor @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } 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/RestExecuteInterceptor.java b/apm-sniffer/apm-sdk-plugin/spring-plugins/resttemplate-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/resttemplate/sync/RestExecuteInterceptor.java index 0941d9028..294e9f01d 100644 --- a/apm-sniffer/apm-sdk-plugin/spring-plugins/resttemplate-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/resttemplate/sync/RestExecuteInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/spring-plugins/resttemplate-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/resttemplate/sync/RestExecuteInterceptor.java @@ -63,6 +63,6 @@ public class RestExecuteInterceptor implements InstanceMethodsAroundInterceptor @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } 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 041b7a090..bc2b35e20 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 @@ -52,6 +52,6 @@ public class RestResponseInterceptor implements InstanceMethodsAroundInterceptor @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/spring-plugins/scheduled-annotation-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/scheduled/ScheduledMethodInterceptor.java b/apm-sniffer/apm-sdk-plugin/spring-plugins/scheduled-annotation-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/scheduled/ScheduledMethodInterceptor.java index d6def65b4..77b371e52 100644 --- a/apm-sniffer/apm-sdk-plugin/spring-plugins/scheduled-annotation-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/scheduled/ScheduledMethodInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/spring-plugins/scheduled-annotation-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/scheduled/ScheduledMethodInterceptor.java @@ -52,6 +52,6 @@ public class ScheduledMethodInterceptor implements InstanceMethodsAroundIntercep @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/spymemcached-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spymemcached/v2/MemcachedMethodInterceptor.java b/apm-sniffer/apm-sdk-plugin/spymemcached-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spymemcached/v2/MemcachedMethodInterceptor.java index 6cf1af0a6..af1d2f546 100644 --- a/apm-sniffer/apm-sdk-plugin/spymemcached-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spymemcached/v2/MemcachedMethodInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/spymemcached-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spymemcached/v2/MemcachedMethodInterceptor.java @@ -62,7 +62,6 @@ public class MemcachedMethodInterceptor implements InstanceMethodsAroundIntercep public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { AbstractSpan span = ContextManager.activeSpan(); - span.errorOccurred(); span.log(t); } } 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 4f5fa1aec..1fc63b0a9 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 @@ -80,6 +80,6 @@ public class Struts2Interceptor implements InstanceMethodsAroundInterceptor { @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/tomcat-7.x-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/tomcat78x/TomcatExceptionInterceptor.java b/apm-sniffer/apm-sdk-plugin/tomcat-7.x-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/tomcat78x/TomcatExceptionInterceptor.java index de71eff73..28c8a9a20 100644 --- a/apm-sniffer/apm-sdk-plugin/tomcat-7.x-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/tomcat78x/TomcatExceptionInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/tomcat-7.x-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/tomcat78x/TomcatExceptionInterceptor.java @@ -28,7 +28,7 @@ public class TomcatExceptionInterceptor implements InstanceMethodsAroundIntercep @Override public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, MethodInterceptResult result) throws Throwable { - ContextManager.activeSpan().errorOccurred().log((Throwable) allArguments[2]); + ContextManager.activeSpan().log((Throwable) allArguments[2]); } @Override 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 7c897fdca..851dd4124 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 @@ -111,7 +111,6 @@ public class TomcatInvokeInterceptor implements InstanceMethodsAroundInterceptor Class[] argumentsTypes, Throwable t) { AbstractSpan span = ContextManager.activeSpan(); span.log(t); - span.errorOccurred(); } private void collectHttpParam(Request request, AbstractSpan span) { diff --git a/apm-sniffer/apm-sdk-plugin/undertow-plugins/undertow-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/undertow/v2x/ListenerConfigInterceptor.java b/apm-sniffer/apm-sdk-plugin/undertow-plugins/undertow-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/undertow/v2x/ListenerConfigInterceptor.java index 0d30e680f..174467258 100644 --- a/apm-sniffer/apm-sdk-plugin/undertow-plugins/undertow-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/undertow/v2x/ListenerConfigInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/undertow-plugins/undertow-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/undertow/v2x/ListenerConfigInterceptor.java @@ -53,7 +53,7 @@ public class ListenerConfigInterceptor implements InstanceMethodsAroundIntercept @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/undertow-plugins/undertow-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/undertow/v2x/RootHandlerInterceptor.java b/apm-sniffer/apm-sdk-plugin/undertow-plugins/undertow-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/undertow/v2x/RootHandlerInterceptor.java index bde36823c..f90570f07 100644 --- a/apm-sniffer/apm-sdk-plugin/undertow-plugins/undertow-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/undertow/v2x/RootHandlerInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/undertow-plugins/undertow-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/undertow/v2x/RootHandlerInterceptor.java @@ -48,7 +48,7 @@ public class RootHandlerInterceptor implements InstanceMethodsAroundInterceptor @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/undertow-plugins/undertow-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/undertow/v2x/RoutingHandlerInterceptor.java b/apm-sniffer/apm-sdk-plugin/undertow-plugins/undertow-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/undertow/v2x/RoutingHandlerInterceptor.java index 51217bffa..734daf141 100644 --- a/apm-sniffer/apm-sdk-plugin/undertow-plugins/undertow-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/undertow/v2x/RoutingHandlerInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/undertow-plugins/undertow-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/undertow/v2x/RoutingHandlerInterceptor.java @@ -47,7 +47,7 @@ public class RoutingHandlerInterceptor implements InstanceMethodsAroundIntercept @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } 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 e3bd641fd..8bf79f55a 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 @@ -83,7 +83,7 @@ public class TracingHandler implements HttpHandler { try { next.handleRequest(exchange); } catch (Throwable e) { - span.errorOccurred().log(e); + span.log(e); } finally { ContextManager.stopSpan(span); ContextManager.getRuntimeContext().remove(Constants.FORWARD_REQUEST_FLAG); diff --git a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/ClusteredEventBusSendRemoteInterceptor.java b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/ClusteredEventBusSendRemoteInterceptor.java index 47e0a2017..0aa11f63d 100644 --- a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/ClusteredEventBusSendRemoteInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/ClusteredEventBusSendRemoteInterceptor.java @@ -78,6 +78,6 @@ public class ClusteredEventBusSendRemoteInterceptor implements InstanceMethodsAr @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/EventBusImplDeliverToHandlerInterceptor.java b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/EventBusImplDeliverToHandlerInterceptor.java index 8e32945c5..eac736156 100644 --- a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/EventBusImplDeliverToHandlerInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/EventBusImplDeliverToHandlerInterceptor.java @@ -76,6 +76,6 @@ public class EventBusImplDeliverToHandlerInterceptor implements InstanceMethodsA @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HandlerRegistrationInterceptor.java b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HandlerRegistrationInterceptor.java index ff8db51b4..55a14341f 100644 --- a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HandlerRegistrationInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HandlerRegistrationInterceptor.java @@ -90,6 +90,6 @@ public class HandlerRegistrationInterceptor implements InstanceMethodsAroundInte @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpClientRequestImplHandleExceptionInterceptor.java b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpClientRequestImplHandleExceptionInterceptor.java index ef58d44c8..1e94feeb6 100644 --- a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpClientRequestImplHandleExceptionInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpClientRequestImplHandleExceptionInterceptor.java @@ -31,7 +31,7 @@ public class HttpClientRequestImplHandleExceptionInterceptor implements Instance public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, MethodInterceptResult result) throws Throwable { VertxContext context = (VertxContext) objInst.getSkyWalkingDynamicField(); - context.getSpan().errorOccurred().log((Throwable) allArguments[0]); + context.getSpan().log((Throwable) allArguments[0]); } @Override @@ -43,6 +43,6 @@ public class HttpClientRequestImplHandleExceptionInterceptor implements Instance @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } 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 de6bfb7b4..d1ed6fab0 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 @@ -66,6 +66,6 @@ public class HttpClientRequestImplHandleResponseInterceptor implements InstanceM @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpClientRequestImplInterceptor.java b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpClientRequestImplInterceptor.java index 08cf2ab55..d28c9f1a3 100644 --- a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpClientRequestImplInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpClientRequestImplInterceptor.java @@ -110,7 +110,7 @@ public class HttpClientRequestImplInterceptor implements InstanceMethodsAroundIn @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } private static String toPath(String uri) { 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 7b9f3a95e..3629a0cb6 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 @@ -61,6 +61,6 @@ public class HttpContextHandleDispatchResponseInterceptor implements InstanceMet @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpContextSendRequestInterceptor.java b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpContextSendRequestInterceptor.java index a90dd4357..399962dd3 100644 --- a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpContextSendRequestInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpContextSendRequestInterceptor.java @@ -45,6 +45,6 @@ public class HttpContextSendRequestInterceptor implements InstanceMethodsAroundI @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpServerResponseImplHandleExceptionInterceptor.java b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpServerResponseImplHandleExceptionInterceptor.java index fd4561533..766a0341c 100644 --- a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpServerResponseImplHandleExceptionInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/HttpServerResponseImplHandleExceptionInterceptor.java @@ -31,7 +31,7 @@ public class HttpServerResponseImplHandleExceptionInterceptor implements Instanc public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, MethodInterceptResult result) throws Throwable { VertxContext context = (VertxContext) objInst.getSkyWalkingDynamicField(); - context.getSpan().errorOccurred().log((Throwable) allArguments[0]); + context.getSpan().log((Throwable) allArguments[0]); } @Override @@ -43,6 +43,6 @@ public class HttpServerResponseImplHandleExceptionInterceptor implements Instanc @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } 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 83bb68910..c68ead8fd 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 @@ -57,6 +57,6 @@ public class HttpServerResponseImplInterceptor implements InstanceMethodsAroundI @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/RouteImplHandlerInterceptor.java b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/RouteImplHandlerInterceptor.java index e2ceb79f3..1df2e7543 100644 --- a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/RouteImplHandlerInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/RouteImplHandlerInterceptor.java @@ -45,6 +45,6 @@ public class RouteImplHandlerInterceptor implements InstanceMethodsAroundInterce @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/RouteStateInterceptor.java b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/RouteStateInterceptor.java index 159d61472..1a1387957 100644 --- a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/RouteStateInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/RouteStateInterceptor.java @@ -112,6 +112,6 @@ public class RouteStateInterceptor implements InstanceMethodsAroundInterceptor, @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/ServerConnectionHandleMessageInterceptor.java b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/ServerConnectionHandleMessageInterceptor.java index 1afbb4e8c..8e3095142 100644 --- a/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/ServerConnectionHandleMessageInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/vertx-plugins/vertx-core-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/vertx3/ServerConnectionHandleMessageInterceptor.java @@ -69,7 +69,7 @@ public class ServerConnectionHandleMessageInterceptor implements InstanceMethods @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } private static String toPath(String uri) { diff --git a/apm-sniffer/apm-sdk-plugin/xmemcached-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/xmemcached/v2/XMemcachedMethodInterceptor.java b/apm-sniffer/apm-sdk-plugin/xmemcached-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/xmemcached/v2/XMemcachedMethodInterceptor.java index da7ea3a70..daf2915cb 100644 --- a/apm-sniffer/apm-sdk-plugin/xmemcached-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/xmemcached/v2/XMemcachedMethodInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/xmemcached-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/xmemcached/v2/XMemcachedMethodInterceptor.java @@ -59,7 +59,6 @@ public class XMemcachedMethodInterceptor implements InstanceMethodsAroundInterce public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { AbstractSpan span = ContextManager.activeSpan(); - span.errorOccurred(); span.log(t); } } diff --git a/apm-sniffer/apm-toolkit-activation/apm-toolkit-trace-activation/src/main/java/org/apache/skywalking/apm/toolkit/activation/trace/ActiveSpanErrorThrowableInteceptor.java b/apm-sniffer/apm-toolkit-activation/apm-toolkit-trace-activation/src/main/java/org/apache/skywalking/apm/toolkit/activation/trace/ActiveSpanErrorThrowableInteceptor.java index 709dba6dd..48dcde7f7 100644 --- a/apm-sniffer/apm-toolkit-activation/apm-toolkit-trace-activation/src/main/java/org/apache/skywalking/apm/toolkit/activation/trace/ActiveSpanErrorThrowableInteceptor.java +++ b/apm-sniffer/apm-toolkit-activation/apm-toolkit-trace-activation/src/main/java/org/apache/skywalking/apm/toolkit/activation/trace/ActiveSpanErrorThrowableInteceptor.java @@ -32,7 +32,6 @@ public class ActiveSpanErrorThrowableInteceptor implements StaticMethodsAroundIn AbstractSpan activeSpan = null; try { activeSpan = ContextManager.activeSpan(); - activeSpan.errorOccurred(); activeSpan.log((Throwable) allArguments[0]); } catch (NullPointerException e) { } diff --git a/apm-sniffer/apm-toolkit-activation/apm-toolkit-trace-activation/src/main/java/org/apache/skywalking/apm/toolkit/activation/trace/CallableOrRunnableInvokeInterceptor.java b/apm-sniffer/apm-toolkit-activation/apm-toolkit-trace-activation/src/main/java/org/apache/skywalking/apm/toolkit/activation/trace/CallableOrRunnableInvokeInterceptor.java index b4f66d860..7d3a6feea 100644 --- a/apm-sniffer/apm-toolkit-activation/apm-toolkit-trace-activation/src/main/java/org/apache/skywalking/apm/toolkit/activation/trace/CallableOrRunnableInvokeInterceptor.java +++ b/apm-sniffer/apm-toolkit-activation/apm-toolkit-trace-activation/src/main/java/org/apache/skywalking/apm/toolkit/activation/trace/CallableOrRunnableInvokeInterceptor.java @@ -48,6 +48,6 @@ public class CallableOrRunnableInvokeInterceptor implements InstanceMethodsAroun @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-toolkit-activation/apm-toolkit-trace-activation/src/main/java/org/apache/skywalking/apm/toolkit/activation/trace/IgnoredExceptionAnnotationActivation.java b/apm-sniffer/apm-toolkit-activation/apm-toolkit-trace-activation/src/main/java/org/apache/skywalking/apm/toolkit/activation/trace/IgnoredExceptionAnnotationActivation.java new file mode 100644 index 000000000..a505d7c98 --- /dev/null +++ b/apm-sniffer/apm-toolkit-activation/apm-toolkit-trace-activation/src/main/java/org/apache/skywalking/apm/toolkit/activation/trace/IgnoredExceptionAnnotationActivation.java @@ -0,0 +1,65 @@ +/* + * 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.toolkit.activation.trace; + +import net.bytebuddy.description.method.MethodDescription; +import net.bytebuddy.matcher.ElementMatcher; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine; +import org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch; + +import static net.bytebuddy.matcher.ElementMatchers.any; +import static org.apache.skywalking.apm.agent.core.plugin.match.ClassAnnotationMatch.byClassAnnotationMatch; + +/** + * Intercepts all exception annotated with {@link org.apache.skywalking.apm.toolkit.trace.IgnoredException} + */ +public class IgnoredExceptionAnnotationActivation extends ClassInstanceMethodsEnhancePluginDefine { + + public static final String ANNOTATION_NAME = "org.apache.skywalking.apm.toolkit.trace.IgnoredException"; + private static final String INIT_METHOD_INTERCEPTOR = "org.apache.skywalking.apm.toolkit.activation.trace.IgnoredExceptionConstructInterceptor"; + + @Override + public ConstructorInterceptPoint[] getConstructorsInterceptPoints() { + return new ConstructorInterceptPoint[] { + new ConstructorInterceptPoint() { + @Override + public ElementMatcher getConstructorMatcher() { + return any(); + } + + @Override + public String getConstructorInterceptor() { + return INIT_METHOD_INTERCEPTOR; + } + } + }; + } + + @Override + public InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints() { + return null; + } + + @Override + protected ClassMatch enhanceClass() { + return byClassAnnotationMatch(new String[] {ANNOTATION_NAME}); + } +} diff --git a/apm-sniffer/apm-toolkit-activation/apm-toolkit-trace-activation/src/main/java/org/apache/skywalking/apm/toolkit/activation/trace/IgnoredExceptionConstructInterceptor.java b/apm-sniffer/apm-toolkit-activation/apm-toolkit-trace-activation/src/main/java/org/apache/skywalking/apm/toolkit/activation/trace/IgnoredExceptionConstructInterceptor.java new file mode 100644 index 000000000..37dbbf57f --- /dev/null +++ b/apm-sniffer/apm-toolkit-activation/apm-toolkit-trace-activation/src/main/java/org/apache/skywalking/apm/toolkit/activation/trace/IgnoredExceptionConstructInterceptor.java @@ -0,0 +1,36 @@ +/* + * 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.toolkit.activation.trace; + +import org.apache.skywalking.apm.agent.core.context.ContextManager; +import org.apache.skywalking.apm.agent.core.context.status.AnnotationMatchExceptionCheckStrategy; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceConstructorInterceptor; + +public class IgnoredExceptionConstructInterceptor implements InstanceConstructorInterceptor { + + /** + * Inject a tag field to mark the exception should be not thought error status. + */ + @Override + public void onConstruct(EnhancedInstance objInst, Object[] allArguments) { + if (ContextManager.isActive()) { + objInst.setSkyWalkingDynamicField(AnnotationMatchExceptionCheckStrategy.class.getSimpleName()); + } + } +} diff --git a/apm-sniffer/apm-toolkit-activation/apm-toolkit-trace-activation/src/main/java/org/apache/skywalking/apm/toolkit/activation/trace/TagAnnotationMethodInterceptor.java b/apm-sniffer/apm-toolkit-activation/apm-toolkit-trace-activation/src/main/java/org/apache/skywalking/apm/toolkit/activation/trace/TagAnnotationMethodInterceptor.java index fcb701ce4..50ef2197b 100644 --- a/apm-sniffer/apm-toolkit-activation/apm-toolkit-trace-activation/src/main/java/org/apache/skywalking/apm/toolkit/activation/trace/TagAnnotationMethodInterceptor.java +++ b/apm-sniffer/apm-toolkit-activation/apm-toolkit-trace-activation/src/main/java/org/apache/skywalking/apm/toolkit/activation/trace/TagAnnotationMethodInterceptor.java @@ -89,7 +89,7 @@ public class TagAnnotationMethodInterceptor implements InstanceMethodsAroundInte public void handleMethodException(final EnhancedInstance objInst, final Method method, final Object[] allArguments, final Class[] argumentsTypes, final Throwable t) { if (ContextManager.isActive()) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } } diff --git a/apm-sniffer/apm-toolkit-activation/apm-toolkit-trace-activation/src/main/java/org/apache/skywalking/apm/toolkit/activation/trace/TraceAnnotationMethodInterceptor.java b/apm-sniffer/apm-toolkit-activation/apm-toolkit-trace-activation/src/main/java/org/apache/skywalking/apm/toolkit/activation/trace/TraceAnnotationMethodInterceptor.java index eaf8b9038..e11a1f72c 100644 --- a/apm-sniffer/apm-toolkit-activation/apm-toolkit-trace-activation/src/main/java/org/apache/skywalking/apm/toolkit/activation/trace/TraceAnnotationMethodInterceptor.java +++ b/apm-sniffer/apm-toolkit-activation/apm-toolkit-trace-activation/src/main/java/org/apache/skywalking/apm/toolkit/activation/trace/TraceAnnotationMethodInterceptor.java @@ -96,6 +96,6 @@ public class TraceAnnotationMethodInterceptor implements InstanceMethodsAroundIn @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/apm-toolkit-activation/apm-toolkit-trace-activation/src/main/resources/skywalking-plugin.def b/apm-sniffer/apm-toolkit-activation/apm-toolkit-trace-activation/src/main/resources/skywalking-plugin.def index 0f70650fa..002b9a6fd 100644 --- a/apm-sniffer/apm-toolkit-activation/apm-toolkit-trace-activation/src/main/resources/skywalking-plugin.def +++ b/apm-sniffer/apm-toolkit-activation/apm-toolkit-trace-activation/src/main/resources/skywalking-plugin.def @@ -18,4 +18,5 @@ toolkit-trace=org.apache.skywalking.apm.toolkit.activation.trace.ActiveSpanActiv toolkit-trace=org.apache.skywalking.apm.toolkit.activation.trace.TraceAnnotationActivation toolkit-trace=org.apache.skywalking.apm.toolkit.activation.trace.TraceContextActivation toolkit-trace=org.apache.skywalking.apm.toolkit.activation.trace.CallableOrRunnableActivation -toolkit-tag=org.apache.skywalking.apm.toolkit.activation.trace.TagAnnotationActivation \ No newline at end of file +toolkit-tag=org.apache.skywalking.apm.toolkit.activation.trace.TagAnnotationActivation +toolkit-exception=org.apache.skywalking.apm.toolkit.activation.trace.IgnoredExceptionAnnotationActivation \ No newline at end of file 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 b2f2d3c83..a409ad284 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 @@ -56,7 +56,7 @@ public class HttpClientParseHttpInterceptor implements InstanceMethodsAroundInte public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { AbstractSpan span = ContextManager.activeSpan(); - span.errorOccurred().log(t); + span.log(t); } /** diff --git a/apm-sniffer/bootstrap-plugins/jdk-http-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdk/http/HttpClientWriteRequestInterceptor.java b/apm-sniffer/bootstrap-plugins/jdk-http-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdk/http/HttpClientWriteRequestInterceptor.java index c041a470b..37d66776d 100644 --- a/apm-sniffer/bootstrap-plugins/jdk-http-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdk/http/HttpClientWriteRequestInterceptor.java +++ b/apm-sniffer/bootstrap-plugins/jdk-http-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdk/http/HttpClientWriteRequestInterceptor.java @@ -66,7 +66,7 @@ public class HttpClientWriteRequestInterceptor implements InstanceMethodsAroundI public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { AbstractSpan span = ContextManager.activeSpan(); - span.errorOccurred().log(t); + span.log(t); } private String getPeer(URL url) { diff --git a/apm-sniffer/bootstrap-plugins/jdk-threading-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdk/threading/ThreadingMethodInterceptor.java b/apm-sniffer/bootstrap-plugins/jdk-threading-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdk/threading/ThreadingMethodInterceptor.java index 587b1058b..6cf0107e7 100644 --- a/apm-sniffer/bootstrap-plugins/jdk-threading-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdk/threading/ThreadingMethodInterceptor.java +++ b/apm-sniffer/bootstrap-plugins/jdk-threading-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdk/threading/ThreadingMethodInterceptor.java @@ -62,7 +62,7 @@ public class ThreadingMethodInterceptor implements InstanceMethodsAroundIntercep final Class[] argumentsTypes, final Throwable t) { if (ContextManager.isActive()) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/config/agent.config b/apm-sniffer/config/agent.config index d6fdf8557..fdf4699eb 100644 --- a/apm-sniffer/config/agent.config +++ b/apm-sniffer/config/agent.config @@ -85,6 +85,13 @@ logging.level=${SW_LOGGING_LEVEL:INFO} # then the oldest file will be delete. Negative or zero means off, by default. # logging.max_history_files=${SW_LOGGING_MAX_HISTORY_FILES:-1} +# Listed exceptions would not be treated as an error. Because in some codes, the exception is being used as a way of controlling business flow. +# Besides, the annotation named IgnoredException in the trace toolkit is another way to configure ignored exceptions. +# statuscheck.ignored_exceptions=${SW_STATUSCHECK_IGNORED_EXCEPTIONS:} + +# The max recursive depth when checking the exception traced by the agent. Typically, we don't recommend setting this more than 10, which could cause a performance issue. Negative value and 0 would be ignored, which means all exceptions would make the span tagged in error status. +# statuscheck.max_recursive_depth=${SW_STATUSCHECK_MAX_RECURSIVE_DEPTH:1} + # mysql plugin configuration # plugin.mysql.trace_sql_parameters=${SW_MYSQL_TRACE_SQL_PARAMETERS:false} diff --git a/apm-sniffer/optional-plugins/customize-enhance-plugin/src/main/java/org/apache/skywalking/apm/plugin/customize/interceptor/BaseInterceptorMethods.java b/apm-sniffer/optional-plugins/customize-enhance-plugin/src/main/java/org/apache/skywalking/apm/plugin/customize/interceptor/BaseInterceptorMethods.java index e7fb2362f..e8edcbe6a 100644 --- a/apm-sniffer/optional-plugins/customize-enhance-plugin/src/main/java/org/apache/skywalking/apm/plugin/customize/interceptor/BaseInterceptorMethods.java +++ b/apm-sniffer/optional-plugins/customize-enhance-plugin/src/main/java/org/apache/skywalking/apm/plugin/customize/interceptor/BaseInterceptorMethods.java @@ -90,7 +90,7 @@ class BaseInterceptorMethods { void handleMethodException(Throwable t) { if (ContextManager.isActive()) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/optional-plugins/gson-2.8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/gson/GsonFromJsonInterceptor.java b/apm-sniffer/optional-plugins/gson-2.8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/gson/GsonFromJsonInterceptor.java index 311287833..4ab53c541 100644 --- a/apm-sniffer/optional-plugins/gson-2.8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/gson/GsonFromJsonInterceptor.java +++ b/apm-sniffer/optional-plugins/gson-2.8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/gson/GsonFromJsonInterceptor.java @@ -51,6 +51,6 @@ public class GsonFromJsonInterceptor implements InstanceMethodsAroundInterceptor @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } \ No newline at end of file diff --git a/apm-sniffer/optional-plugins/gson-2.8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/gson/GsonToJsonInterceptor.java b/apm-sniffer/optional-plugins/gson-2.8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/gson/GsonToJsonInterceptor.java index da4fabb25..d7e2cc840 100644 --- a/apm-sniffer/optional-plugins/gson-2.8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/gson/GsonToJsonInterceptor.java +++ b/apm-sniffer/optional-plugins/gson-2.8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/gson/GsonToJsonInterceptor.java @@ -51,6 +51,6 @@ public class GsonToJsonInterceptor implements InstanceMethodsAroundInterceptor { @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } 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 c63a3fae1..8509eb687 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 @@ -87,7 +87,7 @@ public class HttpClientRequestInterceptor implements InstanceMethodsAroundInterc AbstractSpan abstractSpan = enhanceCacheObject.getSendSpan(); if (abstractSpan != null) { if (throwable != null) { - abstractSpan.errorOccurred().log(throwable); + abstractSpan.log(throwable); } else if (httpClientResponse.status().code() > 400) { abstractSpan.errorOccurred(); } 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/NettyRoutingFilterInterceptor.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/NettyRoutingFilterInterceptor.java index 776723bae..27d0375f1 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/NettyRoutingFilterInterceptor.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/NettyRoutingFilterInterceptor.java @@ -66,6 +66,6 @@ public class NettyRoutingFilterInterceptor implements InstanceMethodsAroundInter @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } 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/NettyRoutingFilterInterceptor.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/NettyRoutingFilterInterceptor.java index a9035d60a..616a23b95 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/NettyRoutingFilterInterceptor.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/NettyRoutingFilterInterceptor.java @@ -64,6 +64,6 @@ public class NettyRoutingFilterInterceptor implements InstanceMethodsAroundInter @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/optional-plugins/optional-spring-plugins/spring-annotation-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/annotations/SpringAnnotationInterceptor.java b/apm-sniffer/optional-plugins/optional-spring-plugins/spring-annotation-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/annotations/SpringAnnotationInterceptor.java index 60c5702bd..51cd35192 100644 --- a/apm-sniffer/optional-plugins/optional-spring-plugins/spring-annotation-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/annotations/SpringAnnotationInterceptor.java +++ b/apm-sniffer/optional-plugins/optional-spring-plugins/spring-annotation-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/annotations/SpringAnnotationInterceptor.java @@ -45,6 +45,6 @@ public class SpringAnnotationInterceptor implements InstanceMethodsAroundInterce @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/optional-plugins/optional-spring-plugins/spring-tx-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/transaction/EndTransactionMethodInterceptor.java b/apm-sniffer/optional-plugins/optional-spring-plugins/spring-tx-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/transaction/EndTransactionMethodInterceptor.java index 6bd470054..e4aefeecc 100644 --- a/apm-sniffer/optional-plugins/optional-spring-plugins/spring-tx-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/transaction/EndTransactionMethodInterceptor.java +++ b/apm-sniffer/optional-plugins/optional-spring-plugins/spring-tx-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/transaction/EndTransactionMethodInterceptor.java @@ -52,6 +52,6 @@ public class EndTransactionMethodInterceptor implements InstanceMethodsAroundInt @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/apm-sniffer/optional-plugins/optional-spring-plugins/spring-tx-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/transaction/GetTransactionMethodInterceptor.java b/apm-sniffer/optional-plugins/optional-spring-plugins/spring-tx-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/transaction/GetTransactionMethodInterceptor.java index bb9cfa1b6..b4cf3d74b 100644 --- a/apm-sniffer/optional-plugins/optional-spring-plugins/spring-tx-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/transaction/GetTransactionMethodInterceptor.java +++ b/apm-sniffer/optional-plugins/optional-spring-plugins/spring-tx-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/transaction/GetTransactionMethodInterceptor.java @@ -59,7 +59,7 @@ public class GetTransactionMethodInterceptor implements InstanceMethodsAroundInt @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } private String buildOperationName(String transactionDefinitionName) { diff --git a/apm-sniffer/optional-plugins/quartz-scheduler-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/quartz/JobRunShellMethodInterceptor.java b/apm-sniffer/optional-plugins/quartz-scheduler-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/quartz/JobRunShellMethodInterceptor.java index dba50706b..465a7fe63 100644 --- a/apm-sniffer/optional-plugins/quartz-scheduler-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/quartz/JobRunShellMethodInterceptor.java +++ b/apm-sniffer/optional-plugins/quartz-scheduler-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/quartz/JobRunShellMethodInterceptor.java @@ -67,7 +67,7 @@ public class JobRunShellMethodInterceptor implements InstanceMethodsAroundInterc @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } private static String getJobDataMapString(JobDetail jobDetail) { diff --git a/apm-sniffer/optional-plugins/zookeeper-3.4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/zookeeper/ClientCnxnInterceptor.java b/apm-sniffer/optional-plugins/zookeeper-3.4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/zookeeper/ClientCnxnInterceptor.java index 0da36cf45..9e0ac2503 100644 --- a/apm-sniffer/optional-plugins/zookeeper-3.4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/zookeeper/ClientCnxnInterceptor.java +++ b/apm-sniffer/optional-plugins/zookeeper-3.4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/zookeeper/ClientCnxnInterceptor.java @@ -68,7 +68,6 @@ public class ClientCnxnInterceptor implements InstanceMethodsAroundInterceptor, public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { AbstractSpan span = ContextManager.activeSpan(); - span.errorOccurred(); span.log(t); } diff --git a/apm-sniffer/optional-plugins/zookeeper-3.4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/zookeeper/EventThreadMethodInterceptor.java b/apm-sniffer/optional-plugins/zookeeper-3.4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/zookeeper/EventThreadMethodInterceptor.java index c9ce30c9a..089562741 100644 --- a/apm-sniffer/optional-plugins/zookeeper-3.4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/zookeeper/EventThreadMethodInterceptor.java +++ b/apm-sniffer/optional-plugins/zookeeper-3.4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/zookeeper/EventThreadMethodInterceptor.java @@ -60,7 +60,7 @@ public class EventThreadMethodInterceptor implements InstanceMethodsAroundInterc public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { if (isWatchedEvent(allArguments[0])) { - ContextManager.activeSpan().errorOccurred().log(t); + ContextManager.activeSpan().log(t); } } diff --git a/docs/en/setup/service-agent/java-agent/How-to-tolerate-exceptions.md b/docs/en/setup/service-agent/java-agent/How-to-tolerate-exceptions.md new file mode 100644 index 000000000..e80f73c3d --- /dev/null +++ b/docs/en/setup/service-agent/java-agent/How-to-tolerate-exceptions.md @@ -0,0 +1,114 @@ +# How to tolerate custom exceptions +*In some codes, the exception is being used as a way of controlling business flow. Skywalking provides 2 ways to tolerate an exception which is traced in a span.* +1. Set the names of exception classes in the agent config +2. Use our annotation in the codes. + +## Set the names of exception classes in the agent config +The property named "statuscheck.ignored_exceptions" is used to set up class names in the agent configuration file. if the exception listed here are detected in the agent, the agent core would flag the related span as the error status. + +### Demo +1. A custom exception. + + - TestNamedMatchException + ```java + package org.apache.skywalking.apm.agent.core.context.status; + + public class TestNamedMatchException extends RuntimeException { + public TestNamedMatchException() { + } + public TestNamedMatchException(final String message) { + super(message); + } + ... + } + ``` + - TestHierarchyMatchException + ```java + package org.apache.skywalking.apm.agent.core.context.status; + + public class TestHierarchyMatchException extends TestNamedMatchException { + public TestHierarchyMatchException() { + } + public TestHierarchyMatchException(final String message) { + super(message); + } + ... + } + ``` +2. When the above exceptions traced in some spans, the status is like the following. + + The traced exception | Final span status | + ----------- | ---------- | + `org.apache.skywalking.apm.agent.core.context.status.TestNamedMatchException` | true | + `org.apache.skywalking.apm.agent.core.context.status.TestHierarchyMatchException` | true | +3. After set these class names through "statuscheck.ignored_exceptions", the status of spans would be changed. + + ``` + statuscheck.ignored_exceptions=org.apache.skywalking.apm.agent.core.context.status.TestNamedMatchException + ``` + + The traced exception | Final span status | + ----------- | ---------- | + `org.apache.skywalking.apm.agent.core.context.status.TestNamedMatchException` | false | + `org.apache.skywalking.apm.agent.core.context.status.TestHierarchyMatchException` | false | + +## Use our annotation in the codes. +If an exception has the `@IgnoredException` annotation, the exception wouldn't be marked as error status when tracing. Because the annotation supports inheritance, also affects the subclasses. + +### Dependency +* Dependency the toolkit, such as using maven or gradle. Since 8.2.0. +```xml + + org.apache.skywalking + apm-toolkit-log4j-1.x + {project.release.version} + +``` +### Demo + 1. A custom exception. + + ```java + package org.apache.skywalking.apm.agent.core.context.status; + + public class TestAnnotatedException extends RuntimeException { + public TestAnnotatedException() { + } + public TestAnnotatedException(final String message) { + super(message); + } + ... + } + ``` + 2. When the above exception traced in some spans, the status is like the following. + + The traced exception | Final span status | + ----------- | ---------- | + `org.apache.skywalking.apm.agent.core.context.status.TestAnnotatedException` | true | + + 3. However, when the exception annotated with the annotation, the status would be changed. + + ```java + package org.apache.skywalking.apm.agent.core.context.status; + + @IgnoredException + public class TestAnnotatedException extends RuntimeException { + + public TestAnnotatedException() { + } + public TestAnnotatedException(final String message) { + super(message); + } + ... + } + ``` + + The traced exception | Final span status | + ----------- | ---------- | + `org.apache.skywalking.apm.agent.core.context.status.TestAnnotatedException` | false | + +## Recursive check +Due to the wrapper nature of Java exceptions, sometimes users need recursive checking. Skywalking also supports it. Typically, we don't recommend setting this more than 10, which could cause a performance issue. Negative value and 0 would be ignored, which means all exceptions would make the span tagged in error status. + +``` + statuscheck.max_recursive_depth=${SW_STATUSCHECK_MAX_RECURSIVE_DEPTH:1} +``` diff --git a/docs/en/setup/service-agent/java-agent/Plugin-list.md b/docs/en/setup/service-agent/java-agent/Plugin-list.md index d20ef384f..8a1289485 100644 --- a/docs/en/setup/service-agent/java-agent/Plugin-list.md +++ b/docs/en/setup/service-agent/java-agent/Plugin-list.md @@ -99,6 +99,7 @@ - toolkit-opentracing - toolkit-tag - toolkit-trace +- toolkit-exception - undertow-2.x-plugin - vertx-core-3.x - zookeeper-3.4.x \ No newline at end of file diff --git a/docs/en/setup/service-agent/java-agent/README.md b/docs/en/setup/service-agent/java-agent/README.md index c5c04475b..ab09956d1 100755 --- a/docs/en/setup/service-agent/java-agent/README.md +++ b/docs/en/setup/service-agent/java-agent/README.md @@ -100,6 +100,8 @@ property key | Description | Default | `logging.pattern `|Logging format. There are all conversion specifiers:
  * `%level` means log level.
  * `%timestamp` means now of time with format `yyyy-MM-dd HH:mm:ss:SSS`.
  * `%thread` means name of current thread.
  * `%msg` means some message which user logged.
  * `%class` means SimpleName of TargetClass.
  * `%throwable` means a throwable which user called.
  * `%agent_name` means `agent.service_name`. Only apply to the `PatternLogger`. |`%level %timestamp %thread %class : %msg %throwable`| `logging.max_file_size`|The max size of log file. If the size is bigger than this, archive the current file, and write into a new file.|`300 * 1024 * 1024`| `logging.max_history_files`|The max history log files. When rollover happened, if log files exceed this number,then the oldest file will be delete. Negative or zero means off, by default.|`-1`| +`statuscheck.ignored_exceptions`|Listed exceptions would not be treated as an error. Because in some codes, the exception is being used as a way of controlling business flow.|`""`| +`statuscheck.max_recursive_depth`|The max recursive depth when checking the exception traced by the agent. Typically, we don't recommend setting this more than 10, which could cause a performance issue. Negative value and 0 would be ignored, which means all exceptions would make the span tagged in error status.|`1`| `jvm.buffer_size`|The buffer size of collected JVM info.|`60 * 10`| `buffer.channel_size`|The buffer channel size.|`5`| `buffer.buffer_size`|The buffer size.|`300`| @@ -155,7 +157,6 @@ property key | Description | Default | `plugin.kafka.topic_management` | Specify which Kafka topic name for the register or heartbeat data of Service Instance to report to. | `skywalking_managements` | `plugin.springannotation.classname_match_regex` | Match spring beans with regular expression for the class name. Multiple expressions could be separated by a comma. This only works when `Spring annotation plugin` has been activated. | `All the spring beans tagged with @Bean,@Service,@Dao, or @Repository.` | - ## Optional Plugins Java agent plugins are all pluggable. Optional plugins could be provided in `optional-plugins` folder under agent or 3rd party repositories. For using these plugins, you need to put the target plugin jar file into `/plugins`. @@ -194,6 +195,7 @@ Now, we have the following known bootstrap plugins. * If you want to continue traces across thread manually, use [across thread solution APIs](Application-toolkit-trace-cross-thread.md). * If you want to forward MicroMeter/Spring Sleuth metrics to Meter System, use [SkyWalking MicroMeter Register](Application-toolkit-micrometer.md). * If you want to use OpenTracing Java APIs, try [SkyWalking OpenTracing compatible tracer](Opentracing.md). More details you could find at http://opentracing.io + * If you want to tolerate some exceptions, read [tolerate custom exception doc](How-to-tolerate-exceptions.md). * If you want to specify the path of your agent.config file. Read [set config file through system properties](Specified-agent-config.md) ## Advanced Reporters diff --git a/test/plugin/scenarios/exception-checker-spring-scenario/bin/startup.sh b/test/plugin/scenarios/exception-checker-spring-scenario/bin/startup.sh new file mode 100644 index 000000000..660475a32 --- /dev/null +++ b/test/plugin/scenarios/exception-checker-spring-scenario/bin/startup.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# +# 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. + +home="$(cd "$(dirname $0)"; pwd)" + +java -jar ${agent_opts} -Dskywalking.statuscheck.max_recursive_depth=2 -Dskywalking.statuscheck.ignored_exceptions=test.org.apache.skywalking.apm.testcase.exceptionchecker.exception.TestListedException ${home}/../libs/exception-checker-spring-scenario.jar & \ No newline at end of file diff --git a/test/plugin/scenarios/exception-checker-spring-scenario/config/expectedData.yaml b/test/plugin/scenarios/exception-checker-spring-scenario/config/expectedData.yaml new file mode 100644 index 000000000..c2fccb3d7 --- /dev/null +++ b/test/plugin/scenarios/exception-checker-spring-scenario/config/expectedData.yaml @@ -0,0 +1,148 @@ +# 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. +segmentItems: + - serviceName: exception-checker-spring-scenario + segmentSize: 2 + segments: + - segmentId: not null + spans: + - operationName: /case/healthCheck + operationId: 0 + parentSpanId: -1 + spanId: 0 + spanLayer: Http + startTime: nq 0 + endTime: nq 0 + componentId: 14 + isError: false + spanType: Entry + peer: '' + skipAnalysis: false + tags: + - {key: url, value: 'http://localhost:8080/exception-checker-spring/case/healthCheck'} + - {key: http.method, value: HEAD} + - segmentId: not null + spans: + - operationName: test.org.apache.skywalking.apm.testcase.exceptionchecker.service.TestService.testAnnotatedException + operationId: 0 + parentSpanId: 0 + spanId: 1 + spanLayer: Unknown + startTime: nq 0 + endTime: nq 0 + componentId: 93 + isError: false + spanType: Local + peer: '' + skipAnalysis: false + logs: + - logEvent: + - {key: event, value: error} + - {key: error.kind, value: test.org.apache.skywalking.apm.testcase.exceptionchecker.exception.TestAnnotatedException} + - {key: message, value: ''} + - key: stack + value: not null + - operationName: test.org.apache.skywalking.apm.testcase.exceptionchecker.service.TestService.testListedException + operationId: 0 + parentSpanId: 0 + spanId: 2 + spanLayer: Unknown + startTime: nq 0 + endTime: nq 0 + componentId: 93 + isError: false + spanType: Local + peer: '' + skipAnalysis: false + logs: + - logEvent: + - {key: event, value: error} + - {key: error.kind, value: test.org.apache.skywalking.apm.testcase.exceptionchecker.exception.TestListedException} + - {key: message, value: ''} + - key: stack + value: not null + - operationName: test.org.apache.skywalking.apm.testcase.exceptionchecker.service.TestService.testHierarchyListedException + operationId: 0 + parentSpanId: 0 + spanId: 3 + spanLayer: Unknown + startTime: nq 0 + endTime: nq 0 + componentId: 93 + isError: false + spanType: Local + peer: '' + skipAnalysis: false + logs: + - logEvent: + - {key: event, value: error} + - {key: error.kind, value: test.org.apache.skywalking.apm.testcase.exceptionchecker.exception.TestHierarchyListedException} + - {key: message, value: ''} + - key: stack + value: not null + - operationName: test.org.apache.skywalking.apm.testcase.exceptionchecker.service.TestService.testException + operationId: 0 + parentSpanId: 0 + spanId: 4 + spanLayer: Unknown + startTime: nq 0 + endTime: nq 0 + componentId: 93 + isError: true + spanType: Local + peer: '' + skipAnalysis: false + logs: + - logEvent: + - {key: event, value: error} + - {key: error.kind, value: test.org.apache.skywalking.apm.testcase.exceptionchecker.exception.TestException} + - {key: message, value: ''} + - key: stack + value: not null + - operationName: test.org.apache.skywalking.apm.testcase.exceptionchecker.service.TestService.testRecursiveException + operationId: 0 + parentSpanId: 0 + spanId: 5 + spanLayer: Unknown + startTime: nq 0 + endTime: nq 0 + componentId: 93 + isError: false + spanType: Local + peer: '' + skipAnalysis: false + logs: + - logEvent: + - {key: event, value: error} + - {key: error.kind, value: test.org.apache.skywalking.apm.testcase.exceptionchecker.exception.TestException} + - {key: message, value: test.org.apache.skywalking.apm.testcase.exceptionchecker.exception.TestListedException} + - key: stack + value: not null + - operationName: /case/exceptionchecker + operationId: 0 + parentSpanId: -1 + spanId: 0 + spanLayer: Http + startTime: nq 0 + endTime: nq 0 + componentId: 14 + isError: false + spanType: Entry + peer: '' + skipAnalysis: false + tags: + - {key: url, value: 'http://localhost:8080/exception-checker-spring/case/exceptionchecker'} + - {key: http.method, value: GET} diff --git a/test/plugin/scenarios/exception-checker-spring-scenario/configuration.yml b/test/plugin/scenarios/exception-checker-spring-scenario/configuration.yml new file mode 100644 index 000000000..9d95f9ea2 --- /dev/null +++ b/test/plugin/scenarios/exception-checker-spring-scenario/configuration.yml @@ -0,0 +1,22 @@ +# 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. + +type: jvm +entryService: http://localhost:8080/exception-checker-spring/case/exceptionchecker +healthCheck: http://localhost:8080/exception-checker-spring/case/healthCheck +startScript: ./bin/startup.sh +runningMode: with_optional +withPlugins: apm-spring-annotation-plugin-*.jar \ No newline at end of file diff --git a/test/plugin/scenarios/exception-checker-spring-scenario/pom.xml b/test/plugin/scenarios/exception-checker-spring-scenario/pom.xml new file mode 100644 index 000000000..47fb833a5 --- /dev/null +++ b/test/plugin/scenarios/exception-checker-spring-scenario/pom.xml @@ -0,0 +1,118 @@ + + + + + org.apache.skywalking.apm.testcase + exception-checker-spring-scenario + 1.0.0 + jar + + 4.0.0 + + + UTF-8 + 1.8 + YOUR VERSION + 2.1.6.RELEASE + 1.18.10 + + + skywalking-exception-checker-spring + + + + + org.springframework.boot + spring-boot-dependencies + ${spring-boot-version} + pom + import + + + + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-logging + + + + + org.springframework.boot + spring-boot-starter-log4j2 + + + org.projectlombok + lombok + ${lombok.version} + provided + + + + + exception-checker-spring-scenario + + + org.springframework.boot + spring-boot-maven-plugin + + + + repackage + + + + + + maven-compiler-plugin + + ${compiler.version} + ${compiler.version} + ${project.build.sourceEncoding} + + + + org.apache.maven.plugins + maven-assembly-plugin + + + assemble + package + + single + + + + src/main/assembly/assembly.xml + + ./target/ + + + + + + + \ No newline at end of file diff --git a/test/plugin/scenarios/exception-checker-spring-scenario/src/main/assembly/assembly.xml b/test/plugin/scenarios/exception-checker-spring-scenario/src/main/assembly/assembly.xml new file mode 100644 index 000000000..e863f2ad4 --- /dev/null +++ b/test/plugin/scenarios/exception-checker-spring-scenario/src/main/assembly/assembly.xml @@ -0,0 +1,41 @@ + + + + + zip + + + + + ./bin + 0775 + + + + + + ${project.build.directory}/exception-checker-spring-scenario.jar + ./libs + 0775 + + + diff --git a/test/plugin/scenarios/exception-checker-spring-scenario/src/main/java/org/apache/skywalking/apm/toolkit/trace/IgnoredException.java b/test/plugin/scenarios/exception-checker-spring-scenario/src/main/java/org/apache/skywalking/apm/toolkit/trace/IgnoredException.java new file mode 100644 index 000000000..372c25010 --- /dev/null +++ b/test/plugin/scenarios/exception-checker-spring-scenario/src/main/java/org/apache/skywalking/apm/toolkit/trace/IgnoredException.java @@ -0,0 +1,35 @@ +/* + * 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.toolkit.trace; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * After the exception status checker activated in the agent, the span wouldn't be marked as error status if the + * exception has this annotation. + */ +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +@Inherited +public @interface IgnoredException { +} diff --git a/test/plugin/scenarios/exception-checker-spring-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/exceptionchecker/Application.java b/test/plugin/scenarios/exception-checker-spring-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/exceptionchecker/Application.java new file mode 100644 index 000000000..a9fec4514 --- /dev/null +++ b/test/plugin/scenarios/exception-checker-spring-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/exceptionchecker/Application.java @@ -0,0 +1,34 @@ +/* + * 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 test.org.apache.skywalking.apm.testcase.exceptionchecker; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class Application { + + public static void main(String[] args) { + try { + SpringApplication.run(Application.class, args); + } catch (Exception e) { + // Never do this + } + } +} diff --git a/test/plugin/scenarios/exception-checker-spring-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/exceptionchecker/controller/CaseController.java b/test/plugin/scenarios/exception-checker-spring-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/exceptionchecker/controller/CaseController.java new file mode 100644 index 000000000..cb6f3afec --- /dev/null +++ b/test/plugin/scenarios/exception-checker-spring-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/exceptionchecker/controller/CaseController.java @@ -0,0 +1,79 @@ +/* + * 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 test.org.apache.skywalking.apm.testcase.exceptionchecker.controller; + +import lombok.extern.log4j.Log4j2; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestController; +import test.org.apache.skywalking.apm.testcase.exceptionchecker.service.TestService; + +@RestController +@RequestMapping("/case") +@Log4j2 +public class CaseController { + + private final TestService service; + + private static final String SUCCESS = "Success"; + + @Autowired + public CaseController(final TestService service) { + this.service = service; + } + + @RequestMapping("/exceptionchecker") + @ResponseBody + public String testcase() { + try { + service.testAnnotatedException(); + } catch (Exception ignore) { + } + + try { + service.testListedException(); + } catch (Exception ignore) { + } + + try { + service.testHierarchyListedException(); + } catch (Exception ignore) { + } + + try { + service.testException(); + } catch (Exception ignore) { + } + + try { + service.testRecursiveException(); + } catch (Exception ignore) { + } + return SUCCESS; + } + + @RequestMapping("/healthCheck") + @ResponseBody + public String healthCheck() { + // your codes + return SUCCESS; + } + +} diff --git a/test/plugin/scenarios/exception-checker-spring-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/exceptionchecker/exception/TestAnnotatedException.java b/test/plugin/scenarios/exception-checker-spring-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/exceptionchecker/exception/TestAnnotatedException.java new file mode 100644 index 000000000..70def468a --- /dev/null +++ b/test/plugin/scenarios/exception-checker-spring-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/exceptionchecker/exception/TestAnnotatedException.java @@ -0,0 +1,47 @@ +/* + * 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 test.org.apache.skywalking.apm.testcase.exceptionchecker.exception; + +import org.apache.skywalking.apm.toolkit.trace.IgnoredException; + +@IgnoredException +public class TestAnnotatedException extends RuntimeException { + + public TestAnnotatedException() { + } + + public TestAnnotatedException(final String message) { + super(message); + } + + public TestAnnotatedException(final String message, final Throwable cause) { + super(message, cause); + } + + public TestAnnotatedException(final Throwable cause) { + super(cause); + } + + public TestAnnotatedException(final String message, + final Throwable cause, + final boolean enableSuppression, + final boolean writableStackTrace) { + super(message, cause, enableSuppression, writableStackTrace); + } +} diff --git a/test/plugin/scenarios/exception-checker-spring-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/exceptionchecker/exception/TestException.java b/test/plugin/scenarios/exception-checker-spring-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/exceptionchecker/exception/TestException.java new file mode 100644 index 000000000..4118da259 --- /dev/null +++ b/test/plugin/scenarios/exception-checker-spring-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/exceptionchecker/exception/TestException.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 test.org.apache.skywalking.apm.testcase.exceptionchecker.exception; + +public class TestException extends RuntimeException { + + public TestException() { + } + + public TestException(final String message) { + super(message); + } + + public TestException(final String message, final Throwable cause) { + super(message, cause); + } + + public TestException(final Throwable cause) { + super(cause); + } + + public TestException(final String message, + final Throwable cause, + final boolean enableSuppression, + final boolean writableStackTrace) { + super(message, cause, enableSuppression, writableStackTrace); + } +} diff --git a/test/plugin/scenarios/exception-checker-spring-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/exceptionchecker/exception/TestHierarchyListedException.java b/test/plugin/scenarios/exception-checker-spring-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/exceptionchecker/exception/TestHierarchyListedException.java new file mode 100644 index 000000000..6f6b55c58 --- /dev/null +++ b/test/plugin/scenarios/exception-checker-spring-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/exceptionchecker/exception/TestHierarchyListedException.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 test.org.apache.skywalking.apm.testcase.exceptionchecker.exception; + +public class TestHierarchyListedException extends TestListedException { + + public TestHierarchyListedException() { + } + + public TestHierarchyListedException(final String message) { + super(message); + } + + public TestHierarchyListedException(final String message, final Throwable cause) { + super(message, cause); + } + + public TestHierarchyListedException(final Throwable cause) { + super(cause); + } + + public TestHierarchyListedException(final String message, + final Throwable cause, + final boolean enableSuppression, + final boolean writableStackTrace) { + super(message, cause, enableSuppression, writableStackTrace); + } +} diff --git a/test/plugin/scenarios/exception-checker-spring-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/exceptionchecker/exception/TestListedException.java b/test/plugin/scenarios/exception-checker-spring-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/exceptionchecker/exception/TestListedException.java new file mode 100644 index 000000000..909597052 --- /dev/null +++ b/test/plugin/scenarios/exception-checker-spring-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/exceptionchecker/exception/TestListedException.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 test.org.apache.skywalking.apm.testcase.exceptionchecker.exception; + +public class TestListedException extends RuntimeException { + + public TestListedException() { + } + + public TestListedException(final String message) { + super(message); + } + + public TestListedException(final String message, final Throwable cause) { + super(message, cause); + } + + public TestListedException(final Throwable cause) { + super(cause); + } + + public TestListedException(final String message, + final Throwable cause, + final boolean enableSuppression, + final boolean writableStackTrace) { + super(message, cause, enableSuppression, writableStackTrace); + } +} diff --git a/test/plugin/scenarios/exception-checker-spring-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/exceptionchecker/service/TestService.java b/test/plugin/scenarios/exception-checker-spring-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/exceptionchecker/service/TestService.java new file mode 100644 index 000000000..d8632dded --- /dev/null +++ b/test/plugin/scenarios/exception-checker-spring-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/exceptionchecker/service/TestService.java @@ -0,0 +1,50 @@ +/* + * 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 test.org.apache.skywalking.apm.testcase.exceptionchecker.service; + +import org.springframework.stereotype.Service; +import test.org.apache.skywalking.apm.testcase.exceptionchecker.exception.TestAnnotatedException; +import test.org.apache.skywalking.apm.testcase.exceptionchecker.exception.TestException; +import test.org.apache.skywalking.apm.testcase.exceptionchecker.exception.TestHierarchyListedException; +import test.org.apache.skywalking.apm.testcase.exceptionchecker.exception.TestListedException; + +@Service +public class TestService { + + public String testAnnotatedException() { + throw new TestAnnotatedException(); + } + + public String testException() { + throw new TestException(); + } + + public String testListedException() { + throw new TestListedException(); + } + + public String testHierarchyListedException() { + throw new TestHierarchyListedException(); + } + + public String testRecursiveException() { + throw new TestException(new TestListedException()); + } + +} diff --git a/test/plugin/scenarios/exception-checker-spring-scenario/src/main/resources/application.yaml b/test/plugin/scenarios/exception-checker-spring-scenario/src/main/resources/application.yaml new file mode 100644 index 000000000..a1de850fe --- /dev/null +++ b/test/plugin/scenarios/exception-checker-spring-scenario/src/main/resources/application.yaml @@ -0,0 +1,23 @@ +# +# 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. +# +# +server: + port: 8080 + servlet: + context-path: /exception-checker-spring +logging: + config: classpath:log4j2.xml \ No newline at end of file diff --git a/test/plugin/scenarios/exception-checker-spring-scenario/src/main/resources/log4j2.xml b/test/plugin/scenarios/exception-checker-spring-scenario/src/main/resources/log4j2.xml new file mode 100644 index 000000000..9849ed5a8 --- /dev/null +++ b/test/plugin/scenarios/exception-checker-spring-scenario/src/main/resources/log4j2.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/test/plugin/scenarios/exception-checker-spring-scenario/support-version.list b/test/plugin/scenarios/exception-checker-spring-scenario/support-version.list new file mode 100644 index 000000000..1130513ad --- /dev/null +++ b/test/plugin/scenarios/exception-checker-spring-scenario/support-version.list @@ -0,0 +1,18 @@ +# 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 +# "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. + +# lists your version here +1.0.0 \ No newline at end of file diff --git a/test/plugin/scenarios/exception-checker-tomcat-scenario/config/expectedData.yaml b/test/plugin/scenarios/exception-checker-tomcat-scenario/config/expectedData.yaml new file mode 100644 index 000000000..890365be0 --- /dev/null +++ b/test/plugin/scenarios/exception-checker-tomcat-scenario/config/expectedData.yaml @@ -0,0 +1,132 @@ +# 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. +segmentItems: + - serviceName: exception-checker-tomcat-scenario + segmentSize: gt 1 + segments: + - segmentId: not null + spans: + - operationName: test.org.apache.skywalking.apm.testcase.exceptionchecker.service.TestService.testAnnotatedException + operationId: 0 + parentSpanId: 0 + spanId: 1 + spanLayer: Unknown + startTime: nq 0 + endTime: nq 0 + componentId: 93 + isError: false + spanType: Local + peer: '' + skipAnalysis: false + logs: + - logEvent: + - {key: event, value: error} + - {key: error.kind, value: test.org.apache.skywalking.apm.testcase.exceptionchecker.exception.TestAnnotatedException} + - {key: message, value: ''} + - key: stack + value: not null + - operationName: test.org.apache.skywalking.apm.testcase.exceptionchecker.service.TestService.testListedException + operationId: 0 + parentSpanId: 0 + spanId: 2 + spanLayer: Unknown + startTime: nq 0 + endTime: nq 0 + componentId: 93 + isError: false + spanType: Local + peer: '' + skipAnalysis: false + logs: + - logEvent: + - {key: event, value: error} + - {key: error.kind, value: test.org.apache.skywalking.apm.testcase.exceptionchecker.exception.TestListedException} + - {key: message, value: ''} + - key: stack + value: not null + - operationName: test.org.apache.skywalking.apm.testcase.exceptionchecker.service.TestService.testHierarchyListedException + operationId: 0 + parentSpanId: 0 + spanId: 3 + spanLayer: Unknown + startTime: nq 0 + endTime: nq 0 + componentId: 93 + isError: false + spanType: Local + peer: '' + skipAnalysis: false + logs: + - logEvent: + - {key: event, value: error} + - {key: error.kind, value: test.org.apache.skywalking.apm.testcase.exceptionchecker.exception.TestHierarchyListedException} + - {key: message, value: ''} + - key: stack + value: not null + - operationName: test.org.apache.skywalking.apm.testcase.exceptionchecker.service.TestService.testException + operationId: 0 + parentSpanId: 0 + spanId: 4 + spanLayer: Unknown + startTime: nq 0 + endTime: nq 0 + componentId: 93 + isError: true + spanType: Local + peer: '' + skipAnalysis: false + logs: + - logEvent: + - {key: event, value: error} + - {key: error.kind, value: test.org.apache.skywalking.apm.testcase.exceptionchecker.exception.TestException} + - {key: message, value: ''} + - key: stack + value: not null + - operationName: test.org.apache.skywalking.apm.testcase.exceptionchecker.service.TestService.testRecursiveException + operationId: 0 + parentSpanId: 0 + spanId: 5 + spanLayer: Unknown + startTime: nq 0 + endTime: nq 0 + componentId: 93 + isError: false + spanType: Local + peer: '' + skipAnalysis: false + logs: + - logEvent: + - {key: event, value: error} + - {key: error.kind, value: test.org.apache.skywalking.apm.testcase.exceptionchecker.exception.TestException} + - {key: message, value: test.org.apache.skywalking.apm.testcase.exceptionchecker.exception.TestListedException} + - key: stack + value: not null + - operationName: /case/exceptionchecker + operationId: 0 + parentSpanId: -1 + spanId: 0 + spanLayer: Http + startTime: nq 0 + endTime: nq 0 + componentId: 14 + isError: false + spanType: Entry + peer: '' + skipAnalysis: false + tags: + - {key: url, value: 'http://localhost:8080/exception-checker-tomcat-scenario/case/exceptionchecker'} + - {key: http.method, value: GET} + diff --git a/test/plugin/scenarios/exception-checker-tomcat-scenario/configuration.yml b/test/plugin/scenarios/exception-checker-tomcat-scenario/configuration.yml new file mode 100644 index 000000000..0a55c087a --- /dev/null +++ b/test/plugin/scenarios/exception-checker-tomcat-scenario/configuration.yml @@ -0,0 +1,23 @@ +# 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. + +type: tomcat +entryService: http://localhost:8080/exception-checker-tomcat-scenario/case/exceptionchecker +healthCheck: http://localhost:8080/exception-checker-tomcat-scenario/case/healthCheck +runningMode: with_optional +withPlugins: apm-spring-annotation-plugin-*.jar +environment: + - CATALINA_OPTS="-Dskywalking.statuscheck.max_recursive_depth=2 -Dskywalking.statuscheck.max_recursive_depth=2 -Dskywalking.statuscheck.ignored_exceptions=test.org.apache.skywalking.apm.testcase.exceptionchecker.exception.TestListedException" diff --git a/test/plugin/scenarios/exception-checker-tomcat-scenario/pom.xml b/test/plugin/scenarios/exception-checker-tomcat-scenario/pom.xml new file mode 100644 index 000000000..813f35e65 --- /dev/null +++ b/test/plugin/scenarios/exception-checker-tomcat-scenario/pom.xml @@ -0,0 +1,97 @@ + + + + + org.apache.skywalking.apm.testcase + exception-checker-tomcat-scenario + 1.0.0 + war + + 4.0.0 + + skywalking-exception-checker-tomcat-scenario + + + UTF-8 + 1.8 + 1.18.10 + 4.3.0.RELEASE + + + + + javax.servlet + javax.servlet-api + 3.1.0 + provided + + + org.apache.logging.log4j + log4j-api + 2.8.1 + + + org.apache.logging.log4j + log4j-core + 2.8.1 + + + org.projectlombok + lombok + ${lombok.version} + provided + + + org.springframework + spring-context + ${spring.framework.version} + + + org.springframework + spring-aop + ${spring.framework.version} + + + org.springframework + spring-webmvc + ${spring.framework.version} + + + org.springframework + spring-web + ${spring.framework.version} + + + + + exception-checker-tomcat-scenario + + + maven-compiler-plugin + + ${compiler.version} + ${compiler.version} + ${project.build.sourceEncoding} + + + + + diff --git a/test/plugin/scenarios/exception-checker-tomcat-scenario/src/main/java/org/apache/skywalking/apm/toolkit/trace/IgnoredException.java b/test/plugin/scenarios/exception-checker-tomcat-scenario/src/main/java/org/apache/skywalking/apm/toolkit/trace/IgnoredException.java new file mode 100644 index 000000000..372c25010 --- /dev/null +++ b/test/plugin/scenarios/exception-checker-tomcat-scenario/src/main/java/org/apache/skywalking/apm/toolkit/trace/IgnoredException.java @@ -0,0 +1,35 @@ +/* + * 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.toolkit.trace; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * After the exception status checker activated in the agent, the span wouldn't be marked as error status if the + * exception has this annotation. + */ +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +@Inherited +public @interface IgnoredException { +} diff --git a/test/plugin/scenarios/exception-checker-tomcat-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/exceptionchecker/controller/CaseController.java b/test/plugin/scenarios/exception-checker-tomcat-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/exceptionchecker/controller/CaseController.java new file mode 100644 index 000000000..cb6f3afec --- /dev/null +++ b/test/plugin/scenarios/exception-checker-tomcat-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/exceptionchecker/controller/CaseController.java @@ -0,0 +1,79 @@ +/* + * 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 test.org.apache.skywalking.apm.testcase.exceptionchecker.controller; + +import lombok.extern.log4j.Log4j2; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestController; +import test.org.apache.skywalking.apm.testcase.exceptionchecker.service.TestService; + +@RestController +@RequestMapping("/case") +@Log4j2 +public class CaseController { + + private final TestService service; + + private static final String SUCCESS = "Success"; + + @Autowired + public CaseController(final TestService service) { + this.service = service; + } + + @RequestMapping("/exceptionchecker") + @ResponseBody + public String testcase() { + try { + service.testAnnotatedException(); + } catch (Exception ignore) { + } + + try { + service.testListedException(); + } catch (Exception ignore) { + } + + try { + service.testHierarchyListedException(); + } catch (Exception ignore) { + } + + try { + service.testException(); + } catch (Exception ignore) { + } + + try { + service.testRecursiveException(); + } catch (Exception ignore) { + } + return SUCCESS; + } + + @RequestMapping("/healthCheck") + @ResponseBody + public String healthCheck() { + // your codes + return SUCCESS; + } + +} diff --git a/test/plugin/scenarios/exception-checker-tomcat-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/exceptionchecker/exception/TestAnnotatedException.java b/test/plugin/scenarios/exception-checker-tomcat-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/exceptionchecker/exception/TestAnnotatedException.java new file mode 100644 index 000000000..70def468a --- /dev/null +++ b/test/plugin/scenarios/exception-checker-tomcat-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/exceptionchecker/exception/TestAnnotatedException.java @@ -0,0 +1,47 @@ +/* + * 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 test.org.apache.skywalking.apm.testcase.exceptionchecker.exception; + +import org.apache.skywalking.apm.toolkit.trace.IgnoredException; + +@IgnoredException +public class TestAnnotatedException extends RuntimeException { + + public TestAnnotatedException() { + } + + public TestAnnotatedException(final String message) { + super(message); + } + + public TestAnnotatedException(final String message, final Throwable cause) { + super(message, cause); + } + + public TestAnnotatedException(final Throwable cause) { + super(cause); + } + + public TestAnnotatedException(final String message, + final Throwable cause, + final boolean enableSuppression, + final boolean writableStackTrace) { + super(message, cause, enableSuppression, writableStackTrace); + } +} diff --git a/test/plugin/scenarios/exception-checker-tomcat-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/exceptionchecker/exception/TestException.java b/test/plugin/scenarios/exception-checker-tomcat-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/exceptionchecker/exception/TestException.java new file mode 100644 index 000000000..4118da259 --- /dev/null +++ b/test/plugin/scenarios/exception-checker-tomcat-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/exceptionchecker/exception/TestException.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 test.org.apache.skywalking.apm.testcase.exceptionchecker.exception; + +public class TestException extends RuntimeException { + + public TestException() { + } + + public TestException(final String message) { + super(message); + } + + public TestException(final String message, final Throwable cause) { + super(message, cause); + } + + public TestException(final Throwable cause) { + super(cause); + } + + public TestException(final String message, + final Throwable cause, + final boolean enableSuppression, + final boolean writableStackTrace) { + super(message, cause, enableSuppression, writableStackTrace); + } +} diff --git a/test/plugin/scenarios/exception-checker-tomcat-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/exceptionchecker/exception/TestHierarchyListedException.java b/test/plugin/scenarios/exception-checker-tomcat-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/exceptionchecker/exception/TestHierarchyListedException.java new file mode 100644 index 000000000..6f6b55c58 --- /dev/null +++ b/test/plugin/scenarios/exception-checker-tomcat-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/exceptionchecker/exception/TestHierarchyListedException.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 test.org.apache.skywalking.apm.testcase.exceptionchecker.exception; + +public class TestHierarchyListedException extends TestListedException { + + public TestHierarchyListedException() { + } + + public TestHierarchyListedException(final String message) { + super(message); + } + + public TestHierarchyListedException(final String message, final Throwable cause) { + super(message, cause); + } + + public TestHierarchyListedException(final Throwable cause) { + super(cause); + } + + public TestHierarchyListedException(final String message, + final Throwable cause, + final boolean enableSuppression, + final boolean writableStackTrace) { + super(message, cause, enableSuppression, writableStackTrace); + } +} diff --git a/test/plugin/scenarios/exception-checker-tomcat-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/exceptionchecker/exception/TestListedException.java b/test/plugin/scenarios/exception-checker-tomcat-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/exceptionchecker/exception/TestListedException.java new file mode 100644 index 000000000..909597052 --- /dev/null +++ b/test/plugin/scenarios/exception-checker-tomcat-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/exceptionchecker/exception/TestListedException.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 test.org.apache.skywalking.apm.testcase.exceptionchecker.exception; + +public class TestListedException extends RuntimeException { + + public TestListedException() { + } + + public TestListedException(final String message) { + super(message); + } + + public TestListedException(final String message, final Throwable cause) { + super(message, cause); + } + + public TestListedException(final Throwable cause) { + super(cause); + } + + public TestListedException(final String message, + final Throwable cause, + final boolean enableSuppression, + final boolean writableStackTrace) { + super(message, cause, enableSuppression, writableStackTrace); + } +} diff --git a/test/plugin/scenarios/exception-checker-tomcat-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/exceptionchecker/exception/TestOtherClassLoaderException.java b/test/plugin/scenarios/exception-checker-tomcat-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/exceptionchecker/exception/TestOtherClassLoaderException.java new file mode 100644 index 000000000..3df669813 --- /dev/null +++ b/test/plugin/scenarios/exception-checker-tomcat-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/exceptionchecker/exception/TestOtherClassLoaderException.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 test.org.apache.skywalking.apm.testcase.exceptionchecker.exception; + +public class TestOtherClassLoaderException extends RuntimeException{ + + public TestOtherClassLoaderException() { + } + + public TestOtherClassLoaderException(final String message) { + super(message); + } + + public TestOtherClassLoaderException(final String message, final Throwable cause) { + super(message, cause); + } + + public TestOtherClassLoaderException(final Throwable cause) { + super(cause); + } + + public TestOtherClassLoaderException(final String message, + final Throwable cause, + final boolean enableSuppression, + final boolean writableStackTrace) { + super(message, cause, enableSuppression, writableStackTrace); + } +} diff --git a/test/plugin/scenarios/exception-checker-tomcat-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/exceptionchecker/service/TestService.java b/test/plugin/scenarios/exception-checker-tomcat-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/exceptionchecker/service/TestService.java new file mode 100644 index 000000000..d8632dded --- /dev/null +++ b/test/plugin/scenarios/exception-checker-tomcat-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/exceptionchecker/service/TestService.java @@ -0,0 +1,50 @@ +/* + * 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 test.org.apache.skywalking.apm.testcase.exceptionchecker.service; + +import org.springframework.stereotype.Service; +import test.org.apache.skywalking.apm.testcase.exceptionchecker.exception.TestAnnotatedException; +import test.org.apache.skywalking.apm.testcase.exceptionchecker.exception.TestException; +import test.org.apache.skywalking.apm.testcase.exceptionchecker.exception.TestHierarchyListedException; +import test.org.apache.skywalking.apm.testcase.exceptionchecker.exception.TestListedException; + +@Service +public class TestService { + + public String testAnnotatedException() { + throw new TestAnnotatedException(); + } + + public String testException() { + throw new TestException(); + } + + public String testListedException() { + throw new TestListedException(); + } + + public String testHierarchyListedException() { + throw new TestHierarchyListedException(); + } + + public String testRecursiveException() { + throw new TestException(new TestListedException()); + } + +} diff --git a/test/plugin/scenarios/exception-checker-tomcat-scenario/src/main/resources/log4j2.xml b/test/plugin/scenarios/exception-checker-tomcat-scenario/src/main/resources/log4j2.xml new file mode 100644 index 000000000..9849ed5a8 --- /dev/null +++ b/test/plugin/scenarios/exception-checker-tomcat-scenario/src/main/resources/log4j2.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/test/plugin/scenarios/exception-checker-tomcat-scenario/src/main/webapp/WEB-INF/spring-mvc-servlet.xml b/test/plugin/scenarios/exception-checker-tomcat-scenario/src/main/webapp/WEB-INF/spring-mvc-servlet.xml new file mode 100644 index 000000000..10222c880 --- /dev/null +++ b/test/plugin/scenarios/exception-checker-tomcat-scenario/src/main/webapp/WEB-INF/spring-mvc-servlet.xml @@ -0,0 +1,30 @@ + + + + + + + \ No newline at end of file diff --git a/test/plugin/scenarios/exception-checker-tomcat-scenario/src/main/webapp/WEB-INF/web.xml b/test/plugin/scenarios/exception-checker-tomcat-scenario/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 000000000..9fecabc3b --- /dev/null +++ b/test/plugin/scenarios/exception-checker-tomcat-scenario/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,34 @@ + + + skywalking-exception-checker-tomcat-scenario + + + spring-mvc + org.springframework.web.servlet.DispatcherServlet + 1 + + + spring-mvc + / + + diff --git a/test/plugin/scenarios/exception-checker-tomcat-scenario/support-version.list b/test/plugin/scenarios/exception-checker-tomcat-scenario/support-version.list new file mode 100644 index 000000000..1130513ad --- /dev/null +++ b/test/plugin/scenarios/exception-checker-tomcat-scenario/support-version.list @@ -0,0 +1,18 @@ +# 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 +# "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. + +# lists your version here +1.0.0 \ No newline at end of file diff --git a/test/plugin/scenarios/grpc-scenario/config/expectedData.yaml b/test/plugin/scenarios/grpc-scenario/config/expectedData.yaml index d92679aef..4a46b5262 100644 --- a/test/plugin/scenarios/grpc-scenario/config/expectedData.yaml +++ b/test/plugin/scenarios/grpc-scenario/config/expectedData.yaml @@ -406,7 +406,7 @@ segmentItems: startTime: nq 0 endTime: nq 0 componentId: 23 - isError: false + isError: true spanType: Local peer: '' logs: