Frontend Application Log Error Inspection
Background
Frontend error log inspection will help discover new error messages (Error Message after clustering) that have appeared in the frontend application within the last hour, helping developers and operations teams fix the code in time to avoid continuous damage to customer experience over time.
Prerequisites
- There are already connected applications in the "TrueWatch" RUM PV
- An offline deployment of DataFlux Func has been self-built
- Enable the script market for the self-built DataFlux Func
- Create an API Key for operations in the "TrueWatch" Manage / API Key Management
- In the self-built DataFlux Func, install via "Script Market" the following: Self-built Inspection Core Package, Algorithm Library, and Self-built Inspection (New RUM Error Types)
- In the self-built DataFlux Func, write a self-built inspection processing function
- In the self-built DataFlux Func, through Manage / Scheduled Tasks (Old Version: Automatic Trigger Configuration), create scheduled tasks (Old Version: Automatic Trigger Configuration) for the written functions
If you consider using a cloud server for the offline deployment of DataFlux Func, please ensure it is deployed with the currently used TrueWatch SaaS in the same operator and region
Configure Inspection
In the self-built DataFlux Func, create a new script set to enable the configuration of frontend error log inspection.
Python | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
|
Start Inspection
After configuring the inspection in DataFlux Func, you can test it by directly selecting and running the run()
method on the page. After publishing, you can view and configure it in DataFlux Func's Manage / Scheduled Tasks.
View Events
The inspection will automatically cluster all error information from browser clients. This inspection will compare all error information from the past hour and the past 12 hours. Once a previously unseen error occurs, an alert will be triggered, and the intelligent inspection will generate corresponding events. After generating events, they can be viewed in the Event Center for corresponding abnormal events.
Event Details
- Event Overview: Describes objects and content of abnormal inspection events
- Frontend Error Trend: You can view the error statistics for the current frontend application over the past hour
- New Error Details: View detailed error times, error messages, error types, error stacks, and error counts; click on the error message or error type to enter the corresponding data viewer; clicking the error stack will direct you to the specific error stack detail page.
Common Issues
1. How to configure the detection frequency for frontend application log error inspection
- In the self-built DataFlux Func, add
fixed_crontab='0 * * * *', timeout=900
when writing the self-built inspection processing function in the decorator, then configure it in Manage / Scheduled Tasks (Old Version: Automatic Trigger Configuration).
2. No anomaly analysis may occur during frontend application log error inspection
When there is no anomaly analysis in the inspection report, please check the data collection status of the current datakit
.
3. During the inspection process, previously normal scripts may encounter abnormal errors
Please update the referenced script sets in the DataFlux Func Script Market. You can review the update records via the Change Log to facilitate timely updates of the scripts.