Analyze exceptions and log messages

Goal of this tutorial

To explain how to use AppMon to diagnose the root cause of exceptions and error log messages.

Scenario

Use the attached easyTravel session or your own application with an injected Agent.

Requirements

Detailed steps

Prepare the application

If you use your own application, follow these steps to set the Exception and Logging Sensors to run by default:

  1. Go to the Sensor Configuration in the appropriate Agent.
  2. Click Properties for the Exception Sensor (or .NET Exceptions for .NET). The Java Exception Sensor does not capture JDK exceptions by default.
  3. Change this in your System Profile.
Specify Capture Settings For Exceptions
Specify Capture Settings For Exceptions

AppMon logging captures errors and warnings. To capture DEBUG messages, go to Sensor Configuration > Properties > Logging and .NET Logging Sensor.

Warning

DEBUG logging captures can cause considerable overhead in your application.

AppMon detects errors in your application with a configurable set of error detection rules. These rules are based on exceptions, HTTP response codes, and log messages. AppMon counts errors by transaction. The node that triggers the error is marked in the PurePath. Optionally, the transactions are marked as failed. The System Profile dictates the configuration for error detection rules. These rules are for common problems in applications, like unhandled exceptions that are outside of the transaction scope, or HTTP 500 responses. See System Profile - Error Detection for information about configuring error detection rules.

Create a New System Profile
Create a New System Profile

Monitor functional health

For an overview of the functional health of your application, use the Functional Health dashlet. You can see how the transaction's load and failure rate compare to another time frame.

For an overview of errors within a certain time frame, click Diagnose Events/Errors > Errors dashlet.

The Errors Dashboard
The Errors Dashboard

Identify errors

The Errors dashlet includes the following:

  • The Error Overview pane - Details errors and their occurrences.
  • The Error Details pane - Details the exception class and message for the selected group of error rules or a single rule.

Identify exceptions

To find where an exception occurs, open your System Profile or use the attached session and follow these steps:

  1. Click Diagnose Events.
  2. Open the Exceptions dashlet. This displays all of the exceptions in the stored session, or in the PurePaths of your live session. You can see the exception class, message, which class threw the exceptions, and how often it occurs.
  3. Right-click and select Drill Down to PurePath to identify where the exception comes from and why it occurs.

Drill down to business transactions (if available) or web requests to identify the transaction that triggers the exception.

Identify the root cause of error logs

Identify the root cause the same way you identify exceptions. Choose the Logging dashlet instead of the Exceptions dashlet. Drill down to the PurePath and determine the reason for the exception.

Automatically capture PurePath on exception

It's not always possible to check exceptions immediately in production or load test environments. It's more efficient to automatically store a transaction. To do this follow these steps:

  1. Subscribe a Measure and define an incident from the Exceptions dashlet.
  2. Right-click on an exception and subscribe a Measure for it (give it a meaningful name).
  3. Set the Severe threshold to one. You must use a running application to do this - either your own or easyTravel.

To create an Incident Rule, follow these steps:

  1. Open the System Profile Preferences dialog box, and click Measures.
  2. Find for your new Measure.
  3. If you set the threshold, click the Create Incident Rule button.
  4. To enable the Incident Rule, edit the Measure and set a threshold.

Click the Actions tab to configure additional actions for an incident, like an email notification.

When an exception occurs, you receive an incident and you can drill down to the PurePaths. If the exception occurs multiple times, you receive a single incident with multiple PurePaths attached to it.

Conclusion

Use AppMon to easily identify where and why exceptions happen.