wu-sheng commented on a change in pull request #5426:
URL: https://github.com/apache/skywalking/pull/5426#discussion_r483329708
##########
File path:
apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/conf/Config.java
##########
@@ -268,6 +267,21 @@
public static String PATTERN = "%level %timestamp %thread %class :
%msg %throwable";
}
+ public static class StatusCheck {
+ /**
+ * Ignored exception list, also affect their subclasses.
Review comment:
```suggestion
* 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.
```
##########
File path:
apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/conf/Config.java
##########
@@ -268,6 +267,21 @@
public static String PATTERN = "%level %timestamp %thread %class :
%msg %throwable";
}
+ public static class StatusCheck {
+ /**
+ * Ignored exception list, also affect their subclasses.
+ */
+ public static String IGNORED_EXCEPTIONS = "";
+
+ /**
+ * The max depth for recursive check exception status. Default 0 means
all exceptions will be thought of as
+ * error status. If an exception is listed in
org.apache.skywalking.apm.agent.core.conf.Config.StatusCheck#IGNORED_EXCEPTIONS
+ * or tagged with
org.apache.skywalking.apm.toolkit.trace.IgnoredException, the exception will
not be thought of
+ * as error status, also affects its subclasses.
Review comment:
```suggestion
* 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.
```
##########
File path:
apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/conf/Config.java
##########
@@ -268,6 +267,21 @@
public static String PATTERN = "%level %timestamp %thread %class :
%msg %throwable";
}
+ public static class StatusCheck {
+ /**
+ * Ignored exception list, also affect their subclasses.
+ */
+ public static String IGNORED_EXCEPTIONS = "";
+
+ /**
+ * The max depth for recursive check exception status. Default 0 means
all exceptions will be thought of as
+ * error status. If an exception is listed in
org.apache.skywalking.apm.agent.core.conf.Config.StatusCheck#IGNORED_EXCEPTIONS
+ * or tagged with
org.apache.skywalking.apm.toolkit.trace.IgnoredException, the exception will
not be thought of
+ * as error status, also affects its subclasses.
+ */
+ public static Integer MAX_RECURSIVE_DEPTH = 0;
Review comment:
```suggestion
public static Integer MAX_RECURSIVE_DEPTH = 1;
```
##########
File path:
apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/status/AnnotationMatchExceptionCheckStrategy.java
##########
@@ -0,0 +1,52 @@
+/*
+ * 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;
+import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
+
+/**
+ * The exception tagged with
org.apache.skywalking.apm.toolkit.trace.IgnoredException will not be thought as
an error,
Review comment:
```suggestion
* The exception annotated with
org.apache.skywalking.apm.toolkit.trace.IgnoredException would not set the span
in the error status.
```
##########
File path:
apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/status/HierarchyMatchExceptionCheckStrategy.java
##########
@@ -0,0 +1,58 @@
+/*
+ * 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;
+import org.apache.skywalking.apm.agent.core.boot.ServiceManager;
+
+/**
+ * The exception listed in
org.apache.skywalking.apm.agent.core.conf.Config.StatusCheck#IGNORED_EXCEPTIONS
will not be
+ * thought as an error, also affects its subclasses.
Review comment:
```suggestion
* 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.
```
##########
File path:
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 will be thought of as error status.
Review comment:
```suggestion
* All exceptions would make the span tagged as the error status.
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]