After you install an agent for an application, Cloud Monitor 2.0 begins monitoring it. On the Exception Analysis page, you can filter and analyze exceptions by exception name, interface name, and host to optimize your code.
What is an exception?
By default, the ARMS agent records an exception only when an instrumented method throws one.
The number of exceptions that ARMS records depends on how they are handled.
-
Scenario 1: methodA and methodB each catch and handle their own exceptions.
In this scenario, ARMS does not record any exceptions.
public int methodA() { try { return methodB(); } catch (Throwable e) { e.printStackTrace(); return 0; } } public int methodB() { try { return 1 / 0; } catch (Throwable e) { e.printStackTrace(); return 0; } } -
Scenario 2: methodA catches the exception, but methodB throws it.
In this scenario, ARMS records one
java.lang.ArithmeticException.public int methodA() { try { return methodB(); } catch (Throwable e) { e.printStackTrace(); return 0; } } public int methodB() { return 1 / 0; } -
Scenario 3: Both methodA and methodB throw their exceptions.
In this scenario, ARMS records two
java.lang.ArithmeticExceptionexceptions.public int methodA() { return methodB(); } public int methodB() { return 1 / 0; } -
Scenario 4: methodB throws an exception, which methodA then wraps and re-throws.
In this scenario, ARMS records one
java.lang.ArithmeticExceptionand onejava.lang.RuntimeException.public static int methodA() { try { return methodB(); } catch (Throwable e) { throw new RuntimeException(e); } } public static int methodB() { return 1 / 0; }
Prerequisites
The application must be connected to Cloud Monitor 2.0.
Try in Playground
Alibaba Cloud Playground provides a demo environment where you can experience the main features of Cloud Monitor 2.0.
-
Visit the Playground demo. By default, you are logged on to the
o11y-demo-cn-hangzhouworkspace. -
In the left navigation pane, choose .
View in console
Log on to the Cloud Monitor 2.0 console, and select a workspace. In the left navigation pane, choose .
-
On the Applications page, click an application. Then, choose .
-
In the Quick Filter section, filter exceptions by exception name, interface name, application, and instance.
-
The trend charts show exception counts over a specified time period, with bars stacked by exception name.
-
The exception list shows the interface name, exception count, proportion, and exception summary.
In the Actions column, you can:
-
Click Overview to view the exception count trend, distribution by interface and instance, and exception stack.
-
Click Traces to view trace details.
-
-