tencent cloud

Tencent Cloud Observability Platform

Data Reporting Verification

Download
Focus Mode
Font Size
Last updated: 2026-05-25 18:01:57

Error Monitoring

The React Native SDK collects JavaScript errors and uncaught Promise exceptions.

JS Errors

The SDK uses ErrorUtils.setGlobalHandler to listen for JavaScript errors. You can view error information and error stacks on the RUM Pro > Log page.


Promise Exceptions

The SDK uses onUnhandled to listen for uncaught Promise exceptions. You can view the exception information and stack traces on the RUM Pro > Log page.


Page view

The React Native SDK for RUM Pro implements the page visit feature based on the React Navigation and React Native Navigation libraries. You can view exception information and stack traces on the RUM Pro > Log page.

React Navigation

Use containerRef.addListener("state") to listen for route changes and obtain the page name based on getCurrentRoute().name.

React Native Navigation

Use Navigation.events().registerComponentDidAppearListener to listen for route changes and obtain the page name based on componentName.


Custom Reporting

The React Native SDK provides a rich set of custom reporting APIs for users.

Custom Log Reporting

info,error

These two methods are the primary means provided by the SDK for custom log reporting. Their usage is as follows:
Aegis.info('Report a log');
Aegis.error('Report an error log');

// You can also report logs using the following format.

Aegis.info({
 msg: 'xxx', // Recommended. If not set, the reported message will be empty.
[key: string]: any,
});

// Reports an error log (error level: custom_error).
Aegis.error({
 msg: 'Error log message', // Recommended. If not set, the reported message will be empty.
[key: string]: any,
});
You can view exception information and exception stacks on the RUM Pro > Log page.


Custom Event Reporting

reportEvent

This method can be used to report custom events. The platform automatically aggregates metrics for reported events, such as PV and platform distribution. The reportEvent method supports two types of reporting parameters:
String type.
aegis.reportEvent('XXX request successful');
Object type. Users can upload custom fields.
Aegis.reportEvent({
  name: 'XXX request successful', // Required
[key: string]: any,
})
Note:
For custom event reporting, the default log type is {level: "info", type: "custom_event"}.
You can view reported information on the Terminal Performance Monitoring Pro > Custom Event page.


Custom Speed Test Reporting

Custom speed test allows you to report arbitrary values, which are then statistically processed and calculated on the server. Since the server cannot handle dirty data, it is recommended to validate and restrict values at the reporting end to prevent dirty data from affecting the overall results.
Currently, Aegis only supports numerical values in the range 0 to 60000. If your values exceed this range, it is recommended to transform them appropriately before reporting.
For high-frequency custom speed test reporting, use reportTime whenever possible. Using time and timeEnd for reporting can lead to reported value overwriting issues. For example, if aegis.time(aaa) is called, and then aegis.time(aaa) is called again before aegis.timeEnd(aaa) is invoked, the reported time will be the timeEnd timestamp minus the timestamp of the second time call.

reportTime

This method can be used to report custom speed tests. Example:
// If the 'onload' time is 1s
aegis.reportTime('onload', 1000);
Alternatively, if you need to use additional parameters, you can pass custom fields:
aegis.reportTime({
name: 'onload', // Custom speed test name
duration: 1000, // Custom speed test duration (0 - 60000)
[key: string]: any,
});

time,timeEnd

These methods are also used for custom speed tests, suitable for measuring and reporting the duration between two points in time. Example:
aegis.time('complexOperation');
/**
* .
* .
* After performing complex operations for a long time...
* .
* .
*/
aegis.timeEnd('complexOperation'); /* The log has been reported at this point. */
You can view reported information on the Terminal Performance Monitoring Pro > Custom Speed page.



Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback