Exception Types
RUM can monitor the following types of exceptions:- JavaScript Exceptions
- Network Exceptions
- Resource Loading Exceptions
- Custom Exceptions
Includes code syntax errors, runtime exceptions, and unhandled Promise rejections. These issues can cause page functionality to fail, severely affecting user experience.
Reporting Methods
Automatic Error Capture
RUM SDK automatically captures the following types of browser errors:- Automatically captured errors include stack traces, error messages, and source information by default.
- Errors from browser extensions or third-party scripts (such as
networksource) are filtered to avoid data pollution.
Manual Error Reporting
Through theaddError API, you can manually report handled exceptions, custom errors, or other errors not automatically captured.
Applicable Scenarios:
- Log handled errors in business logic
- Attach context information (such as user ID, page state) for troubleshooting
- Monitor exceptions from third-party services or asynchronous operations
React Error Boundary Integration
RUM supports capturing component rendering errors through React Error Boundaries and reporting error information. You can call theaddError API in componentDidCatch, attaching component stack information for debugging.
1
Create Error Boundary Component
2
Wrap Components with Error Boundary
Error Data Structure
Each error record contains the following attributes to describe error details and context:string
Error source (e.g.,
console, network, custom, source, report)string
Error type or error code (e.g.,
TypeError, NetworkError)string
Concise, readable error message
string
Error stack trace or supplementary information
Array
List of related errors providing additional context (optional)
Object
Custom context information (e.g., page state, user ID), passed via
addErrorError Filtering and Configuration
To ensure accuracy and relevance of error data, RUM applies the following filtering rules:Default Filtering Rules
Default Filtering Rules
- Only processes errors with
sourceofcustom,source,report, orconsole - Ignores irrelevant errors from browser extensions, third-party scripts, or
networksource
Stack Requirements
Stack Requirements
Errors must contain stack trace information, otherwise they may be ignored
Custom Filtering
Custom Filtering
Use
beforeSend callback to customize error handling logic, filtering or modifying error dataCustom Error Filtering Example
FAQ
Why aren't some errors being grouped?
Why aren't some errors being grouped?
- Confirm stack trace is complete, or check if custom fingerprints conflict
- Check if
sourcemapis correctly uploaded; if not, stacks may not be parsed correctly
How to reduce third-party script error noise?
How to reduce third-party script error noise?
Use
beforeSend callback to filter specific error sources or messages:What if custom grouping isn't working?
What if custom grouping isn't working?
- Ensure
fingerprintattribute is correctly set and value is a string - Check if
beforeSendcallback is being called correctly
Best Practices
Enrich Context Information
Attach business-related context in
addError (such as user ID, action type) for easier problem location.Example: { userId: "12345", action: "submit_form" }Optimize Error Boundaries
Configure error boundaries for key React components to ensure rendering errors are captured. Record component names and versions for easier issue tracking.
Control Error Volume
Use sampling rates or
beforeSend to filter low-value errors and avoid data overload. Prioritize monitoring critical errors affecting user experience.Analysis & Visualization
View error data trends and distribution in the “Insights” - “Exception Analysis” Tab to resolve key exception issues.
Next Steps
View Exceptions
Learn how to view and analyze Issues in the error tracking module