Not a customer? Click the 'Start a free trial' link to begin a 30-day SaaS trial of our product and to join our community.
Existing Cisco AppDynamics customers should click the 'Sign In' button to authenticate to access the community
08-22-2024 09:24 PM - edited 08-23-2024 09:44 AM
The .NET Agent Ignore Exceptions Configuration allows you to ignore specific errors reported for a Business Transaction by adding the fully classified exception class to the .NET ignore exceptions list. This guide provides a comprehensive overview of how to configure and troubleshoot ignore exceptions for the .NET Agent.
Ignoring specific exceptions can help streamline your monitoring process by filtering out non-critical errors. This ensures that only relevant issues are brought to your attention, enhancing the efficiency of your application performance management.
Step 1: Identify Exception Details
Navigate to the BT (Business Transactions) snapshot Error Details page to find the exception details.
Step 2: Add Exception to Ignore List
Add the Fully Classified exception class to the .NET ignore exceptions list. This configuration is applied at the controller application level and affects all registered Business Transactions. Make sure you select the .NET Tab under the Error Detection to add the Ignore exception rule.
Step 3: Add Specific Exception Messages (Optional)
You can specify an exception message to ignore by defining the class of an exception in the exception chain. Note that the match condition is applied only to the root exception of the chain, not to any nested exceptions.
The location of the .NET Agent log files varies based on the underlying OS (Operating System):
Verify Ignore Rules
Check if the ignore rule configurations from the Controller are downloaded in the AgentLog.txt entry. Look for entries like:
Info ErrorMonitor Setting ignore exceptions to :[System.Net.WebException]
Info ErrorMonitor Setting ignore message patterns to :[SM{ex_type=CONTAINS, ex_pattern='The remote server returned an error: (401) Unauthorized', type=CONTAINS, pattern='The remote server returned an error: (401) Unauthorized', inList=System.String[], regexGroups=[]}]
Locate the Exception Key
The Ignore exceptions work based on the key sent by the agent for a specific exception. In AgentLog.txt, find the Exception Key in an entry like:
Info ErrorProcessor Sending ADDs to register [ApplicationDiagnosticData{key='System.Net.WebException:', name=WebException, diagnosticType=ERROR, configEntities=null, summary='System.Net.WebException'}]
Validating Exception Keys
Validate the exception key (e.g., key='System.Net.WebException:') entry seen in the AgentLog.txt file against the Ignore Exception configuration in your controller application. Modify/correct the configuration in your controller as needed and verify.
Let's use the System.AggregateException with an inner exception of SmallBusiness.Common.SmallBusinessException as an example. You want to ignore this exception only when the SmallBusiness.Common.SmallBusinessException has a specific message, such as "This is a known issue."
Here’s an example of how the System.AggregateException and SmallBusiness.Common.SmallBusinessException might be used in your application:
try
{
// Some code that might throw an exception
throw new System.AggregateException(new SmallBusiness.Common.SmallBusinessException("This is a known issue"));
}
catch (System.AggregateException ex)
{
// Handle the exception
Console.WriteLine(ex.Message);
}
When dealing with nested exceptions as above, the fully classified class name includes both the outer and inner exceptions to uniquely identify the specific error scenario.
Outer Exception: System.AggregateException
Inner Exception: SmallBusiness.Common.SmallBusinessException
In this case, the fully classified class name is:
System.AggregateException:SmallBusiness.Common.SmallBusinessException
When the exception is thrown, you see an entry in the AgentLog.txt like this:
Info ErrorProcessor Sending ADDs to register [ApplicationDiagnosticData{key='System.AggregateException:SmallBusiness.Common.SmallBusinessException:', name=AggregateException : SmallBusinessException, diagnosticType=ERROR, configEntities=null, summary='System.AggregateException caused by SmallBusiness.Common.SmallBusinessException: This is a known issue'}]
The match condition is applied only to the root exception of the chain. Here the System.AggregateException is thrown with an inner exception of SmallBusiness.Common.SmallBusinessException and the message "This is a known issue," will be ignored by the .NET Agent. The match condition will not apply to nested exceptions' messages unless they are the root exception.
Here’s how the Ignore Exception rule would look in the Controller configuration:
Fully Qualified Class Name: System.AggregateException:SmallBusiness.Common.SmallBusinessException:
Exception Message: Is Not Empty
Corresponding Configuration Entry in Agent logs:
Info ErrorMonitor Setting ignore exceptions to :[System.AggregateException:SmallBusiness.Common.SmallBusinessException]
Info ErrorMonitor Setting ignore message patterns to :[SM{ex_type=NOT_EMPTY, ex_pattern='', type=NOT_EMPTY, pattern='', inList=System.String[], regexGroups=[]}, SM{ex_type=NOT_EMPTY, ex_pattern='', type=NOT_EMPTY, pattern='', inList=System.String[], regexGroups=[]}]
Thank you! Your submission has been received!
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form